mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Improve login route
This commit is contained in:
57
lib/ui/widgets/login_scaffold.dart
Normal file
57
lib/ui/widgets/login_scaffold.dart
Normal file
@ -0,0 +1,57 @@
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Custom "Scaffold" for signed out users
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
class LoginScaffold extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
||||
const LoginScaffold({Key key, @required this.child})
|
||||
: assert(child != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
|
||||
final availableHeight =
|
||||
mediaQuery.size.height - mediaQuery.viewInsets.bottom;
|
||||
final minHeight = 400.0;
|
||||
|
||||
final contentHeight =
|
||||
availableHeight < minHeight ? minHeight : availableHeight;
|
||||
|
||||
return Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: contentHeight,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 300),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Spacer(flex: 3),
|
||||
Text("Comunic", style: TextStyle(fontSize: 50)),
|
||||
Spacer(flex: 1),
|
||||
Text(tr("Free social network that respect your privacy")),
|
||||
Spacer(flex: 1),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Material(
|
||||
child: child,
|
||||
color: Colors.indigo.shade500,
|
||||
),
|
||||
),
|
||||
Spacer(flex: 5),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.indigo.shade900,
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user