📱 Login and register screen form maxWidth

This commit is contained in:
LittleSheep 2024-12-02 22:48:11 +08:00
parent a70092c6f4
commit 6d5b690450
2 changed files with 157 additions and 159 deletions

View File

@ -33,9 +33,7 @@ class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
return Container(
constraints: const BoxConstraints(maxWidth: 280),
child: Theme(
return Theme(
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
child: SingleChildScrollView(
child: PageTransitionSwitcher(
@ -48,7 +46,10 @@ class _LoginScreenState extends State<LoginScreen> {
animation: primaryAnimation,
secondaryAnimation: secondaryAnimation,
transitionType: SharedAxisTransitionType.horizontal,
child: Container(
constraints: BoxConstraints(maxWidth: 380),
child: child,
),
);
},
child: switch (_period % 3) {
@ -93,7 +94,6 @@ class _LoginScreenState extends State<LoginScreen> {
},
).padding(all: 24),
).center(),
),
);
}
}

View File

@ -52,10 +52,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
@override
Widget build(BuildContext context) {
return Container(
constraints: const BoxConstraints(maxWidth: 280),
child: StyledWidget(
SingleChildScrollView(
return StyledWidget(Container(
constraints: const BoxConstraints(maxWidth: 380),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -154,7 +153,6 @@ class _RegisterScreenState extends State<RegisterScreen> {
],
),
),
).padding(all: 24).center(),
);
)).padding(all: 24).center();
}
}