1
+ import 'package:flutter/cupertino.dart' ;
1
2
import 'package:flutter/material.dart' ;
2
3
3
4
void main () {
@@ -8,55 +9,55 @@ class MyApp extends StatelessWidget {
8
9
@override
9
10
Widget build (BuildContext context) {
10
11
return MaterialApp (
11
- title: 'Flutter Demo' ,
12
- theme: ThemeData (
13
- primarySwatch: Colors .blue,
14
- ),
15
- home: MyHomePage (title: 'Flutter Demo Home Page' ),
12
+ title: 'Loading GIFS' ,
13
+ home: MyHomePage (),
16
14
);
17
15
}
18
16
}
19
17
20
18
class MyHomePage extends StatefulWidget {
21
- MyHomePage ({Key key, this .title }) : super (key: key);
22
- final String title;
19
+ MyHomePage ({Key key}) : super (key: key);
20
+
23
21
@override
24
22
_MyHomePageState createState () => _MyHomePageState ();
25
23
}
26
24
27
25
class _MyHomePageState extends State <MyHomePage > {
28
- int _counter = 0 ;
29
- void _incrementCounter () {
30
- setState (() {
31
- _counter++ ;
32
- });
33
- }
34
-
35
26
@override
36
27
Widget build (BuildContext context) {
28
+ double screenWidth = MediaQuery .of (context).size.width;
37
29
return Scaffold (
38
- appBar: AppBar (
39
- title: Text (widget.title),
40
- ),
41
- body: Center (
42
- child: Column (
43
- mainAxisAlignment: MainAxisAlignment .center,
44
- children: < Widget > [
45
- Text (
46
- 'You have pushed the button this many times:' ,
47
- ),
48
- Text (
49
- '$_counter ' ,
50
- style: Theme .of (context).textTheme.headline4,
51
- ),
52
- ],
30
+ appBar: AppBar (
31
+ title: Text (
32
+ "Loading GIFs" ,
33
+ style: TextStyle (color: Colors .black),
34
+ ),
35
+ centerTitle: true ,
36
+ backgroundColor: Colors .white,
53
37
),
54
- ),
55
- floatingActionButton: FloatingActionButton (
56
- onPressed: _incrementCounter,
57
- tooltip: 'Increment' ,
58
- child: Icon (Icons .add),
59
- ),
60
- );
38
+ body: SingleChildScrollView (
39
+ child: Column (
40
+ children: < Widget > [
41
+ Padding (
42
+ padding: const EdgeInsets .all (16 ),
43
+ child: Container (
44
+ width: screenWidth - 32 ,
45
+ height: screenWidth - 32 ,
46
+ child: FittedBox (child: CupertinoActivityIndicator ()),
47
+ ),
48
+ ),
49
+ Padding (
50
+ padding: const EdgeInsets .all (16 ),
51
+ child: Container (
52
+ width: screenWidth - 32 ,
53
+ height: screenWidth - 32 ,
54
+ child: FittedBox (
55
+ child: CircularProgressIndicator (),
56
+ ),
57
+ ),
58
+ ),
59
+ ],
60
+ ),
61
+ ));
61
62
}
62
63
}
0 commit comments