@@ -37,64 +37,67 @@ class _StateHomePage extends State<HomePage> {
3737 @override
3838 Widget build (BuildContext context) {
3939 return Scaffold (
40- body: Container (
41- color: Colors .black,
42- child: Padding (
43- padding: EdgeInsets .all (20 ),
44- child: Column (
45- children: < Widget > [
46- SizedBox (height: 100 ,),
47- Container (
48- width: 80 ,
49- height: 80 ,
50- child: CircleAvatar (
51- backgroundColor: Colors .transparent,
52- backgroundImage: NetworkImage ('https://icon-library.net/images/github-icon-png/github-icon-png-29.jpg' ),
40+ body: SingleChildScrollView (
41+ child: Container (
42+ height: MediaQuery .of (context).size.height,
43+ color: Colors .black,
44+ child: Padding (
45+ padding: EdgeInsets .all (20 ),
46+ child: Column (
47+ children: < Widget > [
48+ SizedBox (height: 100 ,),
49+ Container (
50+ width: 80 ,
51+ height: 80 ,
52+ child: CircleAvatar (
53+ backgroundColor: Colors .transparent,
54+ backgroundImage: NetworkImage ('https://icon-library.net/images/github-icon-png/github-icon-png-29.jpg' ),
5355
54- ),
56+ ),
5557
56- ),
57- SizedBox (height: 30 ,),
58- Text ("Github" , style: TextStyle (color: Colors .white, fontSize: 40 , fontWeight: FontWeight .bold),),
59- SizedBox (height: 150 ,),
60- Container (
61- padding: EdgeInsets .symmetric (horizontal: 15 , vertical: 10 ),
62- decoration: BoxDecoration (
63- borderRadius: BorderRadius .circular (10 ),
64- color: Colors .white.withOpacity (.1 )
6558 ),
66- child: TextField (
67- onChanged: (value) {
68- Provider .of <UserProvider >(context).setMessage (null );
69- },
70- controller: _controller,
71- enabled: ! Provider .of <UserProvider >(context).isLoading (),
72- style: TextStyle (color: Colors .white),
73- decoration: InputDecoration (
74- errorText: Provider .of <UserProvider >(context).getMessage (),
75- border: InputBorder .none,
76- hintText: "Github username" ,
77- hintStyle: TextStyle (color: Colors .grey)
59+ SizedBox (height: 30 ,),
60+ Text ("Github" , style: TextStyle (color: Colors .white, fontSize: 40 , fontWeight: FontWeight .bold),),
61+ SizedBox (height: 150 ,),
62+ Container (
63+ padding: EdgeInsets .symmetric (horizontal: 15 , vertical: 10 ),
64+ decoration: BoxDecoration (
65+ borderRadius: BorderRadius .circular (10 ),
66+ color: Colors .white.withOpacity (.1 )
67+ ),
68+ child: TextField (
69+ onChanged: (value) {
70+ Provider .of <UserProvider >(context).setMessage (null );
71+ },
72+ controller: _controller,
73+ enabled: ! Provider .of <UserProvider >(context).isLoading (),
74+ style: TextStyle (color: Colors .white),
75+ decoration: InputDecoration (
76+ errorText: Provider .of <UserProvider >(context).getMessage (),
77+ border: InputBorder .none,
78+ hintText: "Github username" ,
79+ hintStyle: TextStyle (color: Colors .grey)
80+ ),
7881 ),
7982 ),
80- ),
81- SizedBox (height : 20 ,),
82- MaterialButton (
83- padding : EdgeInsets . all ( 20 ) ,
84- color : Colors .blue,
85- shape : RoundedRectangleBorder (
86- borderRadius : BorderRadius . circular ( 10 )
87- ),
88- child: Align (
89- child :
90- Provider . of < UserProvider >(context). isLoading () ?
91- CircularProgressIndicator (backgroundColor : Colors .white, strokeWidth : 2 ,) :
92- Text ( 'Get Your Following Now' , style : TextStyle (color : Colors .white),),
93- ), onPressed : () {
94- _getUser ();
95- },
96- )
97- ] ,
83+ SizedBox (height : 20 , ),
84+ MaterialButton (
85+ padding : EdgeInsets . all ( 20 ),
86+ color : Colors .blue ,
87+ shape : RoundedRectangleBorder (
88+ borderRadius : BorderRadius . circular ( 10 )
89+ ),
90+ child : Align (
91+ child:
92+ Provider . of < UserProvider >(context). isLoading () ?
93+ CircularProgressIndicator (backgroundColor : Colors .white, strokeWidth : 2 ,) :
94+ Text ( 'Get Your Following Now' , style : TextStyle (color : Colors .white),),
95+ ), onPressed : () {
96+ _getUser ();
97+ },
98+ )
99+ ],
100+ ) ,
98101 ),
99102 ),
100103 ),
0 commit comments