advance_animated_progress_indicator 0.0.1 copy "advance_animated_progress_indicator: ^0.0.1" to clipboard
advance_animated_progress_indicator: ^0.0.1 copied to clipboard

A new Flutter project.

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Animated Progress Indicator',
      darkTheme: ThemeData.dark().copyWith(

      ),
      themeMode: ThemeMode.dark,
      home: const MyHomePage(title: 'Animated Progress Indicator'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  double _percentage = 0.0;

  void _incrementPercentage() {
    setState(() {
      _percentage = _percentage+0.1;
    });
  }

  void _decrementPercentage() {
    setState(() {
      _percentage = _percentage-0.1;
    });
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        children: [
          Container(
            alignment: Alignment.center,
            margin: const EdgeInsets.all(10),
            child: AnimatedCircularProgressIndicator(
              percentage: _percentage,
              animationDuration: const Duration(
                seconds: 1,
              ),
            ),
          ),
          const SizedBox(height: 20,),
          Container(
            alignment: Alignment.center,
            margin: const EdgeInsets.all(10),
            child: AnimatedLinearProgressIndicator(
              percentage: _percentage,
              animationDuration: const Duration(
                seconds: 1,
              ),
              label: 'Dart',
            ),
          ),
        ],
      ),
      floatingActionButton: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          FloatingActionButton(
            onPressed: _incrementPercentage,
            tooltip: 'Increment',
            child: const Icon(Icons.add),
          ), // This trailing comma
          const SizedBox(height: 20,),
          FloatingActionButton(
            onPressed: _decrementPercentage,
            tooltip: 'Decrement',
            child: const Icon(Icons.remove),
          ), // This trailing comma
        ],
      ),
    );
  }
}
//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
10
likes
70
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter project.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on advance_animated_progress_indicator