Skip to content

Commit

Permalink
refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
mikezamayias committed Jan 31, 2022
1 parent 4921192 commit f10d3e2
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 66 deletions.
1 change: 1 addition & 0 deletions lib/flutter_ecommerce_website_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class _FlutterEcommerceWebsiteDemoState
return ColorfulSafeArea(
color: Colors.orange,
child: Scaffold(
resizeToAvoidBottomInset: false,
key: locator<ScaffoldService>().scaffoldKey,
endDrawer: context
.watch<SizingInformationProvider>()
Expand Down
132 changes: 66 additions & 66 deletions lib/pages/sign_in/view/sign_in_page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,78 +48,78 @@ class SignInPageView extends StatelessWidget {

return ResponsiveBuilder(builder: (context, sizingInformation) {
return SingleChildScrollView(
child: Align(
alignment: Alignment.topCenter,
child: AnimatedContainer(
constraints: sizingInformation.isDesktop
? const BoxConstraints(maxWidth: 1200)
: BoxConstraints(
maxWidth: sizingInformation.screenSize.width,
),
duration: const Duration(milliseconds: 60),
padding: sizingInformation.isDesktop
? const EdgeInsets.symmetric(horizontal: 90)
: const EdgeInsets.symmetric(horizontal: 30),
child: Form(
key: locator<FormService>().signInFormKey(),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sign In',
style: Theme.of(context).textTheme.headline2,
softWrap: true,
overflow: TextOverflow.visible,
),
RichText(
text: TextSpan(
text: 'Don\'t have an account?',
style: Theme.of(context).textTheme.bodyText1,
children: [
TextSpan(
text: ' Sign Up',
style: Theme.of(context)
.textTheme
.bodyText1!
.copyWith(
color: Theme.of(context).primaryColor,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Provider.of<PageKeyProvider>(context,
listen: false)
.key = '/signup';
},
),
],
child: Align(
alignment: Alignment.topCenter,
child: AnimatedContainer(
constraints: sizingInformation.isDesktop
? const BoxConstraints(maxWidth: 1200)
: BoxConstraints(
maxWidth: sizingInformation.screenSize.width,
),
),
..._logInFormFields,
BusyButton(
title: 'Sign In',
busy: model.isBusy,
onPressed: () {
model.signIn(
context: context,
email: _emailController.text,
password: _passwordController.text,
duration: const Duration(milliseconds: 60),
padding: sizingInformation.isDesktop
? const EdgeInsets.symmetric(horizontal: 90)
: const EdgeInsets.symmetric(horizontal: 30),
child: Form(
key: locator<FormService>().signInFormKey(),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sign In',
style: Theme.of(context).textTheme.headline2,
softWrap: true,
overflow: TextOverflow.visible,
),
RichText(
text: TextSpan(
text: 'Don\'t have an account?',
style: Theme.of(context).textTheme.bodyText1,
children: [
TextSpan(
text: ' Sign Up',
style: Theme.of(context)
.textTheme
.bodyText1!
.copyWith(
color: Theme.of(context).primaryColor,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Provider.of<PageKeyProvider>(context,
listen: false)
.key = '/signup';
},
),
],
),
),
..._logInFormFields,
BusyButton(
title: 'Sign In',
busy: model.isBusy,
onPressed: () {
model.signIn(
context: context,
email: _emailController.text,
password: _passwordController.text,
);
},
),
].map(
(item) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 9),
child: item,
);
},
),
].map(
(item) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 9),
child: item,
);
},
).toList(),
).toList(),
),
),
),
),
),
);
});
},
Expand Down

0 comments on commit f10d3e2

Please sign in to comment.