Clean up login form
This commit is contained in:
parent
f75368bbb1
commit
f57b3c5407
|
|
@ -30,8 +30,7 @@ class FormCard extends StatelessWidget {
|
|||
child: Card(
|
||||
elevation: 4.0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16.0, top: 16.0, right: 16.0, bottom: 20.0),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: child != null
|
||||
? child
|
||||
: Container(
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@ class _LoginState extends State<LoginView> {
|
|||
_emailLogin = true;
|
||||
}
|
||||
|
||||
if (kIsWeb) {
|
||||
_isSelfHosted = widget.viewModel.authState.isSelfHost;
|
||||
}
|
||||
|
||||
if (_urlController.text.isEmpty) {
|
||||
_urlController.text = widget.viewModel.authState.url;
|
||||
}
|
||||
|
|
@ -322,6 +326,7 @@ class _LoginState extends State<LoginView> {
|
|||
Column(
|
||||
children: <Widget>[
|
||||
SizedBox(height: 10),
|
||||
if (!kIsWeb)
|
||||
_ToggleButtons(
|
||||
tabLabels: [
|
||||
localization.hosted,
|
||||
|
|
@ -559,7 +564,7 @@ class _LoginState extends State<LoginView> {
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 30, bottom: 10),
|
||||
padding: EdgeInsets.only(top: 20, bottom: 10),
|
||||
child: viewModel.isLoading
|
||||
? LoadingIndicator(height: 48)
|
||||
: _createAccount
|
||||
|
|
@ -581,7 +586,6 @@ class _LoginState extends State<LoginView> {
|
|||
.toUpperCase(),
|
||||
onPressed: () => _submitLoginForm(),
|
||||
)),
|
||||
SizedBox(height: 6),
|
||||
if (!isOneTimePassword)
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
|
@ -634,34 +638,6 @@ class _LoginState extends State<LoginView> {
|
|||
}
|
||||
}
|
||||
|
||||
// https://github.com/iampawan/Flutter-UI-Kit
|
||||
class ArcClipper extends CustomClipper<Path> {
|
||||
@override
|
||||
Path getClip(Size size) {
|
||||
final path = Path();
|
||||
path.lineTo(0.0, size.height - 30);
|
||||
|
||||
final firstControlPoint = Offset(size.width / 4, size.height);
|
||||
final firstPoint = Offset(size.width / 2, size.height);
|
||||
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
|
||||
firstPoint.dx, firstPoint.dy);
|
||||
|
||||
final secondControlPoint =
|
||||
Offset(size.width - (size.width / 4), size.height);
|
||||
final secondPoint = Offset(size.width, size.height - 30);
|
||||
path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy,
|
||||
secondPoint.dx, secondPoint.dy);
|
||||
|
||||
path.lineTo(size.width, 0.0);
|
||||
path.close();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
|
||||
}
|
||||
|
||||
class _ToggleButtons extends StatelessWidget {
|
||||
const _ToggleButtons({
|
||||
@required this.selectedIndex,
|
||||
|
|
@ -701,3 +677,31 @@ class _ToggleButtons extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/iampawan/Flutter-UI-Kit
|
||||
class ArcClipper extends CustomClipper<Path> {
|
||||
@override
|
||||
Path getClip(Size size) {
|
||||
final path = Path();
|
||||
path.lineTo(0.0, size.height - 30);
|
||||
|
||||
final firstControlPoint = Offset(size.width / 4, size.height);
|
||||
final firstPoint = Offset(size.width / 2, size.height);
|
||||
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
|
||||
firstPoint.dx, firstPoint.dy);
|
||||
|
||||
final secondControlPoint =
|
||||
Offset(size.width - (size.width / 4), size.height);
|
||||
final secondPoint = Offset(size.width, size.height - 30);
|
||||
path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy,
|
||||
secondPoint.dx, secondPoint.dy);
|
||||
|
||||
path.lineTo(size.width, 0.0);
|
||||
path.close();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue