Skip to content

Commit ccd1a61

Browse files
committed
Create Loading Indicators
1 parent 3bf24a5 commit ccd1a61

19 files changed

+37
-36
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

example/lib/main.dart

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:flutter/cupertino.dart';
12
import 'package:flutter/material.dart';
23

34
void main() {
@@ -8,55 +9,55 @@ class MyApp extends StatelessWidget {
89
@override
910
Widget build(BuildContext context) {
1011
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(),
1614
);
1715
}
1816
}
1917

2018
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+
2321
@override
2422
_MyHomePageState createState() => _MyHomePageState();
2523
}
2624

2725
class _MyHomePageState extends State<MyHomePage> {
28-
int _counter = 0;
29-
void _incrementCounter() {
30-
setState(() {
31-
_counter++;
32-
});
33-
}
34-
3526
@override
3627
Widget build(BuildContext context) {
28+
double screenWidth = MediaQuery.of(context).size.width;
3729
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,
5337
),
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+
));
6162
}
6263
}
159 KB
Loading

0 commit comments

Comments
 (0)