Shimmer

Features

This package is for custom shimmer loader animation container which gives you a modern and elegant loading animation to your flutter apps.

Installation

Step 1 : Add the latest version of the package to your pubspec.yaml file and run (flutter pub get) or (dart pub get)


dependencies:
    shimmer_flutter: ^1.0.1

Step 2 : Import the package and use it in your flutter app.


import 'package:shimmer_container/shimmer.dart';   

Example

There are a number of properties that you can modify:

  • height
  • width
  • baseColor
  • animationDuration
  • cornerRadius

class XYZScreen extends StatelessWidget {
  const XYZScreen({Key? key}) : super(key: key);

  bool? isLoading;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: isLoading ? Shimmer(width: MediaQuery
            .of(context)
            .size
            .width * 0.6,
            height: 16.0,
            baseColor: Colors.grey[200],
            animationDuration: 800,
            //ms
            cornerRadius: 10.0
        )
            : Text('Some Data'),
      ),
    );
  }
}

Next Goals

  • x Add more animation or custom effects.

Libraries

shimmer_flutter