📱 Login and register screen form maxWidth
This commit is contained in:
parent
a70092c6f4
commit
6d5b690450
@ -33,67 +33,67 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Theme(
|
||||||
constraints: const BoxConstraints(maxWidth: 280),
|
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
|
||||||
child: Theme(
|
child: SingleChildScrollView(
|
||||||
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
|
child: PageTransitionSwitcher(
|
||||||
child: SingleChildScrollView(
|
transitionBuilder: (
|
||||||
child: PageTransitionSwitcher(
|
Widget child,
|
||||||
transitionBuilder: (
|
Animation<double> primaryAnimation,
|
||||||
Widget child,
|
Animation<double> secondaryAnimation,
|
||||||
Animation<double> primaryAnimation,
|
) {
|
||||||
Animation<double> secondaryAnimation,
|
return SharedAxisTransition(
|
||||||
) {
|
animation: primaryAnimation,
|
||||||
return SharedAxisTransition(
|
secondaryAnimation: secondaryAnimation,
|
||||||
animation: primaryAnimation,
|
transitionType: SharedAxisTransitionType.horizontal,
|
||||||
secondaryAnimation: secondaryAnimation,
|
child: Container(
|
||||||
transitionType: SharedAxisTransitionType.horizontal,
|
constraints: BoxConstraints(maxWidth: 380),
|
||||||
child: child,
|
child: child,
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
child: switch (_period % 3) {
|
},
|
||||||
1 => _LoginPickerScreen(
|
child: switch (_period % 3) {
|
||||||
key: const ValueKey(1),
|
1 => _LoginPickerScreen(
|
||||||
ticket: _currentTicket,
|
key: const ValueKey(1),
|
||||||
factors: _factors,
|
ticket: _currentTicket,
|
||||||
onTicket: (p0) => setState(() {
|
factors: _factors,
|
||||||
_currentTicket = p0;
|
onTicket: (p0) => setState(() {
|
||||||
}),
|
_currentTicket = p0;
|
||||||
onPickFactor: (p0) => setState(() {
|
}),
|
||||||
_factorPicked = p0;
|
onPickFactor: (p0) => setState(() {
|
||||||
}),
|
_factorPicked = p0;
|
||||||
onNext: () => setState(() {
|
}),
|
||||||
_period++;
|
onNext: () => setState(() {
|
||||||
}),
|
_period++;
|
||||||
),
|
}),
|
||||||
2 => _LoginCheckScreen(
|
),
|
||||||
key: const ValueKey(2),
|
2 => _LoginCheckScreen(
|
||||||
ticket: _currentTicket,
|
key: const ValueKey(2),
|
||||||
factor: _factorPicked,
|
ticket: _currentTicket,
|
||||||
onTicket: (p0) => setState(() {
|
factor: _factorPicked,
|
||||||
_currentTicket = p0;
|
onTicket: (p0) => setState(() {
|
||||||
}),
|
_currentTicket = p0;
|
||||||
onNext: () => setState(() {
|
}),
|
||||||
_period = 1;
|
onNext: () => setState(() {
|
||||||
}),
|
_period = 1;
|
||||||
),
|
}),
|
||||||
_ => _LoginLookupScreen(
|
),
|
||||||
key: const ValueKey(0),
|
_ => _LoginLookupScreen(
|
||||||
ticket: _currentTicket,
|
key: const ValueKey(0),
|
||||||
onTicket: (p0) => setState(() {
|
ticket: _currentTicket,
|
||||||
_currentTicket = p0;
|
onTicket: (p0) => setState(() {
|
||||||
}),
|
_currentTicket = p0;
|
||||||
onFactor: (p0) => setState(() {
|
}),
|
||||||
_factors = p0;
|
onFactor: (p0) => setState(() {
|
||||||
}),
|
_factors = p0;
|
||||||
onNext: () => setState(() {
|
}),
|
||||||
_period++;
|
onNext: () => setState(() {
|
||||||
}),
|
_period++;
|
||||||
),
|
}),
|
||||||
},
|
),
|
||||||
).padding(all: 24),
|
},
|
||||||
).center(),
|
).padding(all: 24),
|
||||||
),
|
).center(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,109 +52,107 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return StyledWidget(Container(
|
||||||
constraints: const BoxConstraints(maxWidth: 280),
|
constraints: const BoxConstraints(maxWidth: 380),
|
||||||
child: StyledWidget(
|
child: SingleChildScrollView(
|
||||||
SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Align(
|
||||||
Align(
|
alignment: Alignment.centerLeft,
|
||||||
alignment: Alignment.centerLeft,
|
child: CircleAvatar(
|
||||||
child: CircleAvatar(
|
radius: 26,
|
||||||
radius: 26,
|
child: const Icon(
|
||||||
child: const Icon(
|
Symbols.person_add,
|
||||||
Symbols.person_add,
|
size: 28,
|
||||||
size: 28,
|
),
|
||||||
),
|
).padding(bottom: 8),
|
||||||
).padding(bottom: 8),
|
),
|
||||||
|
Text(
|
||||||
|
'screenAuthRegister',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 28,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
Text(
|
).tr().padding(left: 4, bottom: 16),
|
||||||
'screenAuthRegister',
|
Column(
|
||||||
style: const TextStyle(
|
children: [
|
||||||
fontSize: 28,
|
TextField(
|
||||||
fontWeight: FontWeight.w900,
|
autocorrect: false,
|
||||||
|
enableSuggestions: false,
|
||||||
|
controller: _usernameController,
|
||||||
|
autofillHints: const [AutofillHints.username],
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
border: const UnderlineInputBorder(),
|
||||||
|
labelText: 'fieldUsername'.tr(),
|
||||||
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
),
|
),
|
||||||
).tr().padding(left: 4, bottom: 16),
|
const Gap(12),
|
||||||
Column(
|
TextField(
|
||||||
children: [
|
autocorrect: false,
|
||||||
TextField(
|
enableSuggestions: false,
|
||||||
autocorrect: false,
|
controller: _nicknameController,
|
||||||
enableSuggestions: false,
|
autofillHints: const [AutofillHints.nickname],
|
||||||
controller: _usernameController,
|
decoration: InputDecoration(
|
||||||
autofillHints: const [AutofillHints.username],
|
isDense: true,
|
||||||
decoration: InputDecoration(
|
border: const UnderlineInputBorder(),
|
||||||
isDense: true,
|
labelText: 'fieldNickname'.tr(),
|
||||||
border: const UnderlineInputBorder(),
|
|
||||||
labelText: 'fieldUsername'.tr(),
|
|
||||||
),
|
|
||||||
onTapOutside: (_) =>
|
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
|
||||||
const Gap(12),
|
|
||||||
TextField(
|
|
||||||
autocorrect: false,
|
|
||||||
enableSuggestions: false,
|
|
||||||
controller: _nicknameController,
|
|
||||||
autofillHints: const [AutofillHints.nickname],
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
border: const UnderlineInputBorder(),
|
|
||||||
labelText: 'fieldNickname'.tr(),
|
|
||||||
),
|
|
||||||
onTapOutside: (_) =>
|
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
|
||||||
const Gap(12),
|
|
||||||
TextField(
|
|
||||||
autocorrect: false,
|
|
||||||
enableSuggestions: false,
|
|
||||||
controller: _emailController,
|
|
||||||
autofillHints: const [AutofillHints.email],
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
border: const UnderlineInputBorder(),
|
|
||||||
labelText: 'fieldEmail'.tr(),
|
|
||||||
),
|
|
||||||
onTapOutside: (_) =>
|
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
|
||||||
const Gap(12),
|
|
||||||
TextField(
|
|
||||||
obscureText: true,
|
|
||||||
autocorrect: false,
|
|
||||||
enableSuggestions: false,
|
|
||||||
autofillHints: const [AutofillHints.password],
|
|
||||||
controller: _passwordController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
border: const UnderlineInputBorder(),
|
|
||||||
labelText: 'fieldPassword'.tr(),
|
|
||||||
),
|
|
||||||
onTapOutside: (_) =>
|
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
onSubmitted: (_) => _performAction(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
).padding(horizontal: 7),
|
|
||||||
const Gap(16),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: () => _performAction(context),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text('next').tr(),
|
|
||||||
const Icon(Symbols.chevron_right),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
),
|
),
|
||||||
)
|
const Gap(12),
|
||||||
],
|
TextField(
|
||||||
),
|
autocorrect: false,
|
||||||
|
enableSuggestions: false,
|
||||||
|
controller: _emailController,
|
||||||
|
autofillHints: const [AutofillHints.email],
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
border: const UnderlineInputBorder(),
|
||||||
|
labelText: 'fieldEmail'.tr(),
|
||||||
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
),
|
||||||
|
const Gap(12),
|
||||||
|
TextField(
|
||||||
|
obscureText: true,
|
||||||
|
autocorrect: false,
|
||||||
|
enableSuggestions: false,
|
||||||
|
autofillHints: const [AutofillHints.password],
|
||||||
|
controller: _passwordController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
border: const UnderlineInputBorder(),
|
||||||
|
labelText: 'fieldPassword'.tr(),
|
||||||
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
onSubmitted: (_) => _performAction(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).padding(horizontal: 7),
|
||||||
|
const Gap(16),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () => _performAction(context),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text('next').tr(),
|
||||||
|
const Icon(Symbols.chevron_right),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
).padding(all: 24).center(),
|
),
|
||||||
);
|
)).padding(all: 24).center();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user