Skip to content

Commit c721b26

Browse files
committed
:(
1 parent 5de8498 commit c721b26

File tree

5 files changed

+83
-64
lines changed

5 files changed

+83
-64
lines changed

lib/pages/home/change_password/change_password_bottomsheet.dart

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ class _ChangePasswordBottomSheetState extends State<ChangePasswordBottomSheet>
133133
stream: changePasswordBloc.changePasswordState$,
134134
builder: (context, snapshot) {
135135
if (!snapshot.hasData || !snapshot.data.isLoading) {
136-
return RaisedButton(
137-
padding: const EdgeInsets.all(12),
138-
elevation: 8,
136+
return ElevatedButton(
137+
style: ElevatedButton.styleFrom(
138+
padding: const EdgeInsets.all(12),
139+
elevation: 4,
140+
),
139141
onPressed: () {
140142
FocusScope.of(context).unfocus();
141143
changePasswordBloc.changePassword();
@@ -150,29 +152,28 @@ class _ChangePasswordBottomSheetState extends State<ChangePasswordBottomSheet>
150152
},
151153
);
152154

153-
return Padding(
154-
padding:
155-
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
156-
child: SingleChildScrollView(
157-
child: Column(
158-
mainAxisSize: MainAxisSize.min,
159-
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
160-
children: <Widget>[
161-
Padding(
162-
padding: const EdgeInsets.all(8.0),
163-
child: passwordTextField,
164-
),
165-
Padding(
166-
padding: const EdgeInsets.all(8.0),
167-
child: newPasswordTextField,
168-
),
169-
messageText,
170-
Padding(
171-
padding: const EdgeInsets.all(32.0),
172-
child: changePasswordButton,
173-
)
174-
],
175-
),
155+
return SingleChildScrollView(
156+
child: Column(
157+
mainAxisSize: MainAxisSize.min,
158+
mainAxisAlignment: MainAxisAlignment.start,
159+
children: <Widget>[
160+
Padding(
161+
padding: const EdgeInsets.all(8.0),
162+
child: passwordTextField,
163+
),
164+
Padding(
165+
padding: const EdgeInsets.all(8.0),
166+
child: newPasswordTextField,
167+
),
168+
messageText,
169+
Padding(
170+
padding: const EdgeInsets.all(32.0),
171+
child: changePasswordButton,
172+
),
173+
SizedBox(
174+
height: MediaQuery.of(context).viewInsets.bottom,
175+
)
176+
],
176177
),
177178
);
178179
}

lib/pages/home/home_page.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,26 @@ class _HomePageState extends State<HomePage>
8282
height: 48.0,
8383
margin: EdgeInsets.only(left: 8.0, right: 8.0, top: 16.0),
8484
width: double.infinity,
85-
child: RaisedButton.icon(
85+
child: ElevatedButton.icon(
8686
onPressed: showChangePassword,
8787
label: Text('Change password'),
8888
icon: Icon(Icons.lock_outline),
89-
color: Theme.of(context).backgroundColor,
90-
colorBrightness: Brightness.dark,
91-
splashColor: Colors.white.withOpacity(0.5),
89+
style: ElevatedButton.styleFrom(
90+
primary: Theme.of(context).backgroundColor,
91+
),
9292
),
9393
),
9494
Container(
9595
height: 48.0,
9696
margin: EdgeInsets.only(left: 8.0, right: 8.0, top: 16.0),
9797
width: double.infinity,
98-
child: RaisedButton.icon(
98+
child: ElevatedButton.icon(
9999
onPressed: homeBloc.logout,
100100
label: Text('Logout'),
101101
icon: Icon(Icons.exit_to_app),
102-
color: Theme.of(context).backgroundColor,
103-
colorBrightness: Brightness.dark,
104-
splashColor: Colors.white.withOpacity(0.5),
102+
style: ElevatedButton.styleFrom(
103+
primary: Theme.of(context).backgroundColor,
104+
),
105105
),
106106
),
107107
Center(

lib/pages/login/login_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class _MyLoginPageState extends State<LoginPage>
250250
}
251251

252252
Widget needAnAccount(LoginBloc loginBloc) {
253-
return FlatButton(
253+
return TextButton(
254254
onPressed: () async {
255255
context.hideCurrentSnackBar();
256256
final email = await Navigator.pushNamed(
@@ -276,7 +276,7 @@ class _MyLoginPageState extends State<LoginPage>
276276
}
277277

278278
Widget forgotPassword(LoginBloc loginBloc) {
279-
return FlatButton(
279+
return TextButton(
280280
onPressed: () async {
281281
context.hideCurrentSnackBar();
282282
final email = await Navigator.pushNamed(

lib/pages/reset_password/input_token/input_token_and_reset_password_page.dart

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,25 @@ class _InputTokenAndResetPasswordPageState
158158
},
159159
);
160160

161+
final overlayColor = MaterialStateProperty.resolveWith((states) {
162+
if (states.contains(MaterialState.hovered)) {
163+
return Theme.of(context).accentColor.withOpacity(0.5);
164+
}
165+
if (states.contains(MaterialState.focused) ||
166+
states.contains(MaterialState.pressed)) {
167+
return Theme.of(context).accentColor.withOpacity(0.8);
168+
}
169+
return null;
170+
});
171+
172+
final buttonStyle = ElevatedButton.styleFrom(
173+
padding: const EdgeInsets.all(16),
174+
shape: RoundedRectangleBorder(
175+
borderRadius: BorderRadius.circular(8),
176+
),
177+
primary: Theme.of(context).cardColor,
178+
).copyWith(overlayColor: overlayColor);
179+
161180
return Container(
162181
decoration: BoxDecoration(
163182
image: DecorationImage(
@@ -202,28 +221,18 @@ class _InputTokenAndResetPasswordPageState
202221
),
203222
Container(
204223
margin: const EdgeInsets.symmetric(horizontal: 16),
205-
child: RaisedButton(
224+
child: ElevatedButton(
206225
child: Text('Submit'),
207-
padding: const EdgeInsets.all(16),
208-
shape: RoundedRectangleBorder(
209-
borderRadius: BorderRadius.circular(8),
210-
),
211-
color: Theme.of(context).cardColor,
212-
splashColor: Theme.of(context).accentColor,
226+
style: buttonStyle,
213227
onPressed: resetPasswordBloc.submit,
214228
),
215229
),
216230
SizedBox(height: 8),
217231
Container(
218232
margin: const EdgeInsets.symmetric(horizontal: 16),
219-
child: RaisedButton(
233+
child: ElevatedButton(
220234
child: Text('Request email'),
221-
padding: const EdgeInsets.all(16),
222-
color: Theme.of(context).cardColor,
223-
splashColor: Theme.of(context).accentColor,
224-
shape: RoundedRectangleBorder(
225-
borderRadius: BorderRadius.circular(8),
226-
),
235+
style: buttonStyle,
227236
onPressed: widget.toggle,
228237
),
229238
),

lib/pages/reset_password/send_email/send_email_page.dart

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,25 @@ class _SendEmailPageState extends State<SendEmailPage>
9292
},
9393
);
9494

95+
final overlayColor = MaterialStateProperty.resolveWith((states) {
96+
if (states.contains(MaterialState.hovered)) {
97+
return Theme.of(context).accentColor.withOpacity(0.5);
98+
}
99+
if (states.contains(MaterialState.focused) ||
100+
states.contains(MaterialState.pressed)) {
101+
return Theme.of(context).accentColor.withOpacity(0.8);
102+
}
103+
return null;
104+
});
105+
106+
final buttonStyle = ElevatedButton.styleFrom(
107+
padding: const EdgeInsets.all(16),
108+
shape: RoundedRectangleBorder(
109+
borderRadius: BorderRadius.circular(8),
110+
),
111+
primary: Theme.of(context).cardColor,
112+
).copyWith(overlayColor: overlayColor);
113+
95114
return Container(
96115
decoration: BoxDecoration(
97116
image: DecorationImage(
@@ -127,28 +146,18 @@ class _SendEmailPageState extends State<SendEmailPage>
127146
),
128147
Container(
129148
margin: const EdgeInsets.symmetric(horizontal: 16),
130-
child: RaisedButton(
149+
child: ElevatedButton(
131150
child: Text('Send'),
132-
padding: const EdgeInsets.all(16),
133-
shape: RoundedRectangleBorder(
134-
borderRadius: BorderRadius.circular(8),
135-
),
136-
color: Theme.of(context).cardColor,
137-
splashColor: Theme.of(context).accentColor,
151+
style: buttonStyle,
138152
onPressed: bloc.submit,
139153
),
140154
),
141155
SizedBox(height: 8),
142156
Container(
143157
margin: const EdgeInsets.symmetric(horizontal: 16),
144-
child: RaisedButton(
158+
child: ElevatedButton(
145159
child: Text('Input received token'),
146-
padding: const EdgeInsets.all(16),
147-
color: Theme.of(context).cardColor,
148-
splashColor: Theme.of(context).accentColor,
149-
shape: RoundedRectangleBorder(
150-
borderRadius: BorderRadius.circular(8),
151-
),
160+
style: buttonStyle,
152161
onPressed: widget.toggle,
153162
),
154163
),

0 commit comments

Comments
 (0)