Glint
This glint/shimmer reuasable widget can help you display bring simple yet loading animation while keeping it's usage extremely simple.
Installation
Use following command line to add this package to your flutter project.
flutter pub add glint
Or manually add to your pubspec.yml
glint: ^0.0.3
Usage
import 'package:glint/glint.dart';
ListView(
children: [
Glint(
isLoading: true,
glintItem: GlintItem(itemCount: 10, radius: 4),
child: Container(),
)
],
),
or
import 'package:glint/glint.dart';
Container(
child:
Glint(
isLoading: true,
glintItem: GlintItem(radius: 12),
child: Text('Something displayed here!')
)
],
),
Properties
Glint requires following parameters:
isLoading: true / falseglintItem: an object ofGlintItemto be displayed during loadingchild: child of the widget will be displayed whenisLoadingis false
GlintItem
GlintItem(
spacing: 5,
itemCount: 10,
direction: Axis.vertical,
height: 50,
radius: 4,
)
spacingis used to separate eachGlintItemwhen displayed during loading.radiusis size of the border radius in circular shape, can be 0 to completely disable border radius.
the rest of the properties is self explanatory, some are not required and posses default values which are:
itemCount = 1spacing = 5direction = Axis.verticalcolor = Colors.white
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.