diff --git a/lib/ui/app/form_card.dart b/lib/ui/app/form_card.dart index 1ce0b6af5..92cc77361 100644 --- a/lib/ui/app/form_card.dart +++ b/lib/ui/app/form_card.dart @@ -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( diff --git a/lib/ui/auth/login_view.dart b/lib/ui/auth/login_view.dart index 925668d99..e1e457b14 100644 --- a/lib/ui/auth/login_view.dart +++ b/lib/ui/auth/login_view.dart @@ -84,6 +84,10 @@ class _LoginState extends State { _emailLogin = true; } + if (kIsWeb) { + _isSelfHosted = widget.viewModel.authState.isSelfHost; + } + if (_urlController.text.isEmpty) { _urlController.text = widget.viewModel.authState.url; } @@ -322,21 +326,22 @@ class _LoginState extends State { Column( children: [ SizedBox(height: 10), - _ToggleButtons( - tabLabels: [ - localization.hosted, - localization.selfhosted, - ], - selectedIndex: _isSelfHosted ? 1 : 0, - onTabChanged: (index) { - setState(() { - _isSelfHosted = index == 1; - _loginError = ''; - _emailLogin = _isSelfHosted; - _createAccount = !_isSelfHosted; - }); - }, - ), + if (!kIsWeb) + _ToggleButtons( + tabLabels: [ + localization.hosted, + localization.selfhosted, + ], + selectedIndex: _isSelfHosted ? 1 : 0, + onTabChanged: (index) { + setState(() { + _isSelfHosted = index == 1; + _loginError = ''; + _emailLogin = _isSelfHosted; + _createAccount = !_isSelfHosted; + }); + }, + ), if (!_isSelfHosted) _ToggleButtons( tabLabels: [ @@ -559,7 +564,7 @@ class _LoginState extends State { ), ), 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 { .toUpperCase(), onPressed: () => _submitLoginForm(), )), - SizedBox(height: 6), if (!isOneTimePassword) Column( mainAxisAlignment: MainAxisAlignment.center, @@ -634,34 +638,6 @@ class _LoginState extends State { } } -// https://github.com/iampawan/Flutter-UI-Kit -class ArcClipper extends CustomClipper { - @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 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 { + @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 oldClipper) => false; +}