volskaya / fancy_switcher

Wrapper around the material design transitions of "animations" package + Animated image decoder, to better apply the switching behavior to images in πŸ’™ Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fancy Switcher

Wrapper for animations package to abstract away transitions and just use the widget as an animated switcher.

Switching Image

Includes a switcher for image providers, to support gapless decoding & gapless switching, idle children and animated gifs.

Examples

Check Flutter Firestore for real usage.

Animated switcher using the material design vertical animation
Widget list;
switch (listStatus) {
  case ListStatus.loading:
    list = KeyedSubtree(
      key: ObjectKey(listStatus),
      child: CircularProgressIndicator(),
    );
    break;
  case ListStatus.empty:
    list = KeyedSubtree(
      key: ObjectKey(listStatus),
      child: Text('Nothing here'),
    );
    break;
  case ListStatus.paginated:
    list = KeyedSubtree(
      key: ObjectKey(listStatus),
      child: ListView(...),
    );
    break;
}

return FancySwitcher.vertical(
  child: list,
);
Animated switching of an image
return SwitchingImage(
  imageProvider: NetworkImage(...),
  idleChild: CircularProgressIndicator(),
);

About

Wrapper around the material design transitions of "animations" package + Animated image decoder, to better apply the switching behavior to images in πŸ’™ Flutter

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Dart 100.0%