Skip to content

Commit

Permalink
fix: button text native login (#968)
Browse files Browse the repository at this point in the history
* fix: button text native login

* fix: for email button
  • Loading branch information
Sembauke authored May 26, 2023
1 parent 7424a9c commit 11a3ef7
Showing 1 changed file with 53 additions and 50 deletions.
103 changes: 53 additions & 50 deletions mobile-app/lib/ui/views/login/native_login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ class NativeLoginView extends StatelessWidget {
ButtonStyle buttonStyle = ElevatedButton.styleFrom(
backgroundColor: Colors.white,
disabledBackgroundColor: Colors.grey,
);

BoxDecoration outerDecoration = BoxDecoration(
border: Border.all(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
side: const BorderSide(
width: 3,
color: Colors.black,
),
borderRadius: BorderRadius.circular(0),
);

TextStyle textStyle = const TextStyle(fontSize: 20, color: Colors.black);
TextStyle textStyle = const TextStyle(
fontSize: 20,
color: Colors.black,
);

return ViewModelBuilder<NativeLoginViewModel>.reactive(
viewModelBuilder: () => NativeLoginViewModel(),
Expand All @@ -36,36 +38,36 @@ class NativeLoginView extends StatelessWidget {
body: SingleChildScrollView(
child: Container(
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Container(
height: 50,
constraints: const BoxConstraints(minHeight: 50),
margin: const EdgeInsets.all(16),
decoration: outerDecoration,
child: ElevatedButton(
style: buttonStyle,
onPressed: () {
model.auth.login(context, 'google-oauth2');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/google-logo.png',
height: 25,
width: 25,
),
Image.asset(
'assets/images/google-logo.png',
height: 25,
width: 25,
),
Text(
'Continue with Google',
style: textStyle,
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Continue with Google',
style: textStyle,
),
),
),
],
),
Expand All @@ -78,28 +80,29 @@ class NativeLoginView extends StatelessWidget {
children: [
Expanded(
child: Container(
height: 50,
constraints: const BoxConstraints(minHeight: 50),
margin: const EdgeInsets.all(16),
decoration: outerDecoration,
child: ElevatedButton(
style: buttonStyle,
onPressed: () {
model.auth.login(context, 'github');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/github-logo.png',
height: 25,
width: 25,
),
Image.asset(
'assets/images/github-logo.png',
height: 25,
width: 25,
),
Text(
'Continue with GitHub',
style: textStyle,
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Continue with GitHub',
style: textStyle,
),
),
),
],
),
Expand All @@ -113,28 +116,27 @@ class NativeLoginView extends StatelessWidget {
Expanded(
child: Container(
margin: const EdgeInsets.all(16),
decoration: outerDecoration,
height: 50,
constraints: const BoxConstraints(minHeight: 50),
child: ElevatedButton(
style: buttonStyle,
onPressed: () {
model.auth.login(context, 'apple');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
'assets/images/apple-logo.png',
height: 25,
width: 25,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/apple-logo.png',
height: 25,
width: 25,
child: Text(
'Continue with Apple',
style: textStyle,
),
),
Text(
'Continue with Apple',
style: textStyle,
),
],
),
),
Expand Down Expand Up @@ -184,7 +186,6 @@ class NativeLoginView extends StatelessWidget {
? Expanded(
child: Container(
margin: const EdgeInsets.all(16),
decoration: outerDecoration,
child: ElevatedButton(
style: buttonStyle.copyWith(
padding: const MaterialStatePropertyAll(
Expand All @@ -207,18 +208,20 @@ class NativeLoginView extends StatelessWidget {
: Expanded(
child: Container(
margin: const EdgeInsets.all(16),
decoration: outerDecoration,
height: 50,
constraints: const BoxConstraints(minHeight: 50),
child: ElevatedButton(
style: buttonStyle,
onPressed: model.emailFieldIsValid
? () {
model.sendOTPtoEmail();
}
: null,
child: Text(
'Email a sign in code',
style: textStyle,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Email a sign in code',
style: textStyle,
),
),
),
),
Expand Down

0 comments on commit 11a3ef7

Please sign in to comment.