crappy load animation
This commit is contained in:
parent
56bcef493a
commit
c9d62743f6
1 changed files with 10 additions and 2 deletions
|
|
@ -12,13 +12,15 @@ class WoolScreen extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget child;
|
||||
|
||||
return FutureBuilder(
|
||||
future: Provider.of<AppDatabase>(context)
|
||||
.select(Provider.of<AppDatabase>(context).wolle)
|
||||
.get(),
|
||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return Center(
|
||||
child = Center(
|
||||
child: Shimmer.fromColors(
|
||||
baseColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
highlightColor: Theme.of(context)
|
||||
|
|
@ -49,7 +51,7 @@ class WoolScreen extends StatelessWidget {
|
|||
);
|
||||
} else {
|
||||
// Hier können Sie den Inhalt basierend auf den geladenen Daten anzeigen
|
||||
return Scaffold(
|
||||
child = Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
label: Text("Hinzufügen"),
|
||||
onPressed: () {
|
||||
|
|
@ -93,6 +95,12 @@ class WoolScreen extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
return AnimatedSwitcher(
|
||||
duration: Duration(milliseconds: 500),
|
||||
switchInCurve: Curves.easeOut,
|
||||
switchOutCurve: Curves.ease,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue