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

View File

@ -52,10 +52,9 @@ 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: [
@ -154,7 +153,6 @@ class _RegisterScreenState extends State<RegisterScreen> {
], ],
), ),
), ),
).padding(all: 24).center(), )).padding(all: 24).center();
);
} }
} }