skeletons 0.0.1 skeletons: ^0.0.1 copied to clipboard
A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.
Skeletons #
A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.
Examples #
Items | |
---|---|
ListView (Default) | ListView (Custom) |
---|---|
SkeletonTheme | Light/Dark modes |
---|---|
Right-To-Left | Custom Shimmer |
---|---|
All examples can be found here examples.
How To Use #
Can be used by encapsulating the child widget in a Skeleton widget:
import 'package:skeletons/skeletons.dart';
Skeleton(
isLoading: _isLoading,
skeleton: SkeletonListView(),
child: Container(child: Center(child: Text("Content"))),
)
or directly:
Container(
child: _isLoading
? SkeletonListView()
: Container(child: Center(
child: Text("Content"))),
)
a SkeletonTheme can be used to set the default configs for all skeleton descendants in the tree.
SkeletonTheme(
// themeMode: ThemeMode.light,
shimmerGradient: LinearGradient(
colors: [
Color(0xFFD8E3E7),
Color(0xFFC8D5DA),
Color(0xFFD8E3E7),
],
stops: [
0.1,
0.5,
0.9,
],
),
darkShimmerGradient: LinearGradient(
colors: [
Color(0xFF222222),
Color(0xFF242424),
Color(0xFF2B2B2B),
Color(0xFF242424),
Color(0xFF222222),
],
stops: [
0.0,
0.2,
0.5,
0.8,
1,
],
begin: Alignment(-2.4, -0.2),
end: Alignment(2.4, 0.2),
tileMode: TileMode.clamp,
),
child: MateriaApp(
...
),
),
Issues and feedback #
For issues, please report here. Contributions are welcome.