adaptive_shimmer 0.1.2 copy "adaptive_shimmer: ^0.1.2" to clipboard
adaptive_shimmer: ^0.1.2 copied to clipboard

A package to give adaptive shimmer effect to your widgets with automatic shape adaptability

example/lib/main.dart

import 'package:adaptive_shimmer/adaptive_shimmer.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Adaptive Shimmer Example',
      theme: ThemeData(

        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Adaptive Shimmer Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});


  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {


  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(

        backgroundColor: Theme.of(context).colorScheme.inversePrimary,

        title: Text(widget.title),
      ),
      body: Center(

        child: AdaptiveShimmer(
          //pass any widget you want to shimmer, here using a empty container
          //other properties like colors,loop,duration etc are customisable
          child: Container(
            color: Colors.amber,
         height: 100,width: 100,
        ),
          //set loading to true to turn on shimmer & false to turn off shimmer (typically to represent when data is loading or not)
          loading: true,)
      ),
    );
  }
}
9
likes
130
pub points
66%
popularity

Publisher

unverified uploader

A package to give adaptive shimmer effect to your widgets with automatic shape adaptability

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, shimmer

More

Packages that depend on adaptive_shimmer