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

A Flutter package that creates a progress button with smooth animation with the supplied value in percentage.

example/lib/main.dart

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

void main() {
  runApp(ProgressValueButtonApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "Progress Button App",
      debugShowCheckedModeBanner: false,
      home: Material(
        child: HomeScreen(),
      ),
    );
  }
}

class HomeScreen extends StatefulWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  bool _loaded = false;
  @override
  void initState() {
    super.initState();
    Future.delayed(
      Duration(milliseconds: 2000),
      () => setState(() => _loaded = true),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: _loaded
            ? ProgressValueButton(
                value: 100.0,
                animationDuration: Duration(milliseconds: 8000),
                height: 65.0,
                onPressed: (progress) {},
                margin: const EdgeInsets.all(10.0),
                child: Text(
                  "Uploading...",
                  style: TextStyle(
                    fontWeight: FontWeight.bold,
                    color: Colors.white,
                    fontSize: 18.0,
                  ),
                ),
              )
            : Container(),
      ),
    );
  }
}
2
likes
130
pub points
24%
popularity

Publisher

unverified uploader

A Flutter package that creates a progress button with smooth animation with the supplied value in percentage.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on progress_value_button