File tree Expand file tree Collapse file tree 3 files changed +29
-18
lines changed Expand file tree Collapse file tree 3 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter_twitter_clone/helper/theme.dart' ;
3
+ import 'package:flutter_twitter_clone/helper/utility.dart' ;
3
4
import 'package:flutter_twitter_clone/state/authState.dart' ;
4
5
import 'package:flutter_twitter_clone/widgets/customWidgets.dart' ;
5
6
import 'package:provider/provider.dart' ;
@@ -104,6 +105,12 @@ class _ForgetPasswordPageState extends State<ForgetPasswordPage>{
104
105
customSnackBar (_scaffoldKey, 'Email field cannot be empty' );
105
106
return ;
106
107
}
108
+ var isValidEmail = validateEmal (_emailController.text, );
109
+ if (! isValidEmail){
110
+ customSnackBar (_scaffoldKey, 'Please enter valid email address' );
111
+ return ;
112
+ }
113
+
107
114
_focusNode.unfocus ();
108
115
var state = Provider .of <AuthState >(context,listen: false );
109
116
state.forgetPassword (_emailController.text,scaffoldKey: _scaffoldKey);
Original file line number Diff line number Diff line change @@ -41,10 +41,12 @@ class _HomePageState extends State<HomePage> {
41
41
state.databaseInit ();
42
42
state.getDataFromDatabase ();
43
43
}
44
+
44
45
void initProfile () {
45
46
var state = Provider .of <AuthState >(context, listen: false );
46
47
state.databaseInit ();
47
48
}
49
+
48
50
void initSearch () {
49
51
var searchState = Provider .of <SearchState >(context, listen: false );
50
52
searchState.getDataFromDatabase ();
@@ -64,7 +66,7 @@ class _HomePageState extends State<HomePage> {
64
66
65
67
Widget _body () {
66
68
var state = Provider .of <AppState >(context);
67
- return Container (child: _getPage (state.pageIndex));
69
+ return SafeArea (child : Container (child: _getPage (state.pageIndex) ));
68
70
}
69
71
70
72
Widget _getPage (int index) {
Original file line number Diff line number Diff line change @@ -131,14 +131,14 @@ class _ChatScreenPageState extends State<ChatScreenPage> {
131
131
Clipboard .setData (text);
132
132
_scaffoldKey.currentState.hideCurrentSnackBar ();
133
133
_scaffoldKey.currentState.showSnackBar (
134
- SnackBar (
135
- backgroundColor: TwitterColor .white,
136
- content: Text (
137
- 'Message copied' ,
138
- style: TextStyle (color: Colors .black),
134
+ SnackBar (
135
+ backgroundColor: TwitterColor .white,
136
+ content: Text (
137
+ 'Message copied' ,
138
+ style: TextStyle (color: Colors .black),
139
+ ),
139
140
),
140
- ),
141
- );
141
+ );
142
142
},
143
143
child: SizedBox (),
144
144
),
@@ -287,17 +287,19 @@ class _ChatScreenPageState extends State<ChatScreenPage> {
287
287
})
288
288
],
289
289
),
290
- body: Stack (
291
- children: < Widget > [
292
- Align (
293
- alignment: Alignment .topRight,
294
- child: Padding (
295
- padding: EdgeInsets .only (bottom: 50 ),
296
- child: _chatScreenBody (),
290
+ body: SafeArea (
291
+ child: Stack (
292
+ children: < Widget > [
293
+ Align (
294
+ alignment: Alignment .topRight,
295
+ child: Padding (
296
+ padding: EdgeInsets .only (bottom: 50 ),
297
+ child: _chatScreenBody (),
298
+ ),
297
299
),
298
- ),
299
- _bottomEntryField ()
300
- ] ,
300
+ _bottomEntryField ()
301
+ ],
302
+ ) ,
301
303
),
302
304
),
303
305
);
You can’t perform that action at this time.
0 commit comments