Clean up login form
This commit is contained in:
parent
f75368bbb1
commit
f57b3c5407
|
|
@ -30,8 +30,7 @@ class FormCard extends StatelessWidget {
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 4.0,
|
elevation: 4.0,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.all(16),
|
||||||
left: 16.0, top: 16.0, right: 16.0, bottom: 20.0),
|
|
||||||
child: child != null
|
child: child != null
|
||||||
? child
|
? child
|
||||||
: Container(
|
: Container(
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,10 @@ class _LoginState extends State<LoginView> {
|
||||||
_emailLogin = true;
|
_emailLogin = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (kIsWeb) {
|
||||||
|
_isSelfHosted = widget.viewModel.authState.isSelfHost;
|
||||||
|
}
|
||||||
|
|
||||||
if (_urlController.text.isEmpty) {
|
if (_urlController.text.isEmpty) {
|
||||||
_urlController.text = widget.viewModel.authState.url;
|
_urlController.text = widget.viewModel.authState.url;
|
||||||
}
|
}
|
||||||
|
|
@ -322,6 +326,7 @@ class _LoginState extends State<LoginView> {
|
||||||
Column(
|
Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
|
if (!kIsWeb)
|
||||||
_ToggleButtons(
|
_ToggleButtons(
|
||||||
tabLabels: [
|
tabLabels: [
|
||||||
localization.hosted,
|
localization.hosted,
|
||||||
|
|
@ -559,7 +564,7 @@ class _LoginState extends State<LoginView> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 30, bottom: 10),
|
padding: EdgeInsets.only(top: 20, bottom: 10),
|
||||||
child: viewModel.isLoading
|
child: viewModel.isLoading
|
||||||
? LoadingIndicator(height: 48)
|
? LoadingIndicator(height: 48)
|
||||||
: _createAccount
|
: _createAccount
|
||||||
|
|
@ -581,7 +586,6 @@ class _LoginState extends State<LoginView> {
|
||||||
.toUpperCase(),
|
.toUpperCase(),
|
||||||
onPressed: () => _submitLoginForm(),
|
onPressed: () => _submitLoginForm(),
|
||||||
)),
|
)),
|
||||||
SizedBox(height: 6),
|
|
||||||
if (!isOneTimePassword)
|
if (!isOneTimePassword)
|
||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
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 {
|
class _ToggleButtons extends StatelessWidget {
|
||||||
const _ToggleButtons({
|
const _ToggleButtons({
|
||||||
@required this.selectedIndex,
|
@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