Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified art/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 59 additions & 23 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:loading/indicator.dart';
import 'package:loading/loading.dart';
import 'package:loading/indicator/ball_scale_indicator.dart';
import 'package:loading/indicator/ball_pulse_indicator.dart';
Expand Down Expand Up @@ -34,48 +35,83 @@ class ShowLoading extends StatelessWidget {
title: Text('Loading View'),
),
body: Center(
child: RaisedButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
child: const Text('Show Time'),
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new LoadingList()),
);
})),
}),
],
)),
);
}
}

class LoadingList extends StatelessWidget {
final indicatorList = [
BallPulseIndicator(),
BallBeatIndicator(),
BallGridPulseIndicator(),
BallScaleIndicator(),
BallScaleMultipleIndicator(),
BallSpinFadeLoaderIndicator(),
LineScaleIndicator(),
LineScalePartyIndicator(),
LineScalePulseOutIndicator(),
];
final Map<String, Indicator> indicatorList = {
'BallPulseIndicator': BallPulseIndicator(),
'BallBeatIndicator': BallBeatIndicator(),
'BallGridPulseIndicator': BallGridPulseIndicator(),
'BallScaleIndicator': BallScaleIndicator(),
'BallScaleMultipleIndicator': BallScaleMultipleIndicator(),
'BallSpinFadeLoaderIndicator': BallSpinFadeLoaderIndicator(),
'LineScaleIndicator': LineScaleIndicator(),
'LineScalePartyIndicator': LineScalePartyIndicator(),
'LineScalePulseOutIndicator': LineScalePulseOutIndicator(),
};

Widget _buildItem(BuildContext context, int index) {
final indicatorName = indicatorList.keys.elementAt(index);
return ListTile(
leading: Loading(
indicator: indicatorList[indicatorName],
color: Colors.lightBlue,
),
title: Text(
indicatorName,
style: TextStyle(fontWeight: FontWeight.bold),
),
contentPadding: EdgeInsets.all(10),
);
}

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Loading View List"),
),

body: Container(
color: Colors.lightBlue,
child: Center(
child: Loading(indicator: BallPulseIndicator(), size: 100.0, color: Colors.pink,),
),
),
// body: Container(
// color: Colors.lightBlue,
// child: GridView.count(
color: Colors.white,
child: Column(
children: <Widget>[
TextField(
decoration: InputDecoration(
prefixIcon: Padding(
padding: const EdgeInsets.all(11.0),
child: Loading(
indicator: BallSpinFadeLoaderIndicator(),
size: 25.0,
color: Colors.lightBlue),
),
hintText: 'Input sample',
),
),
ListView.builder(
shrinkWrap: true,
itemBuilder: _buildItem,
itemCount: indicatorList.length,
),
],
)

// GridView.count(
// padding: EdgeInsets.all(16.0),
// crossAxisSpacing: 36,
// crossAxisCount: 3,
Expand All @@ -86,7 +122,7 @@ class LoadingList extends StatelessWidget {
// );
// }),
// ),
// ),
),
);
}
}