my_progress_bar 1.0.2 copy "my_progress_bar: ^1.0.2" to clipboard
my_progress_bar: ^1.0.2 copied to clipboard

Flutter package for displaying progress bars

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:my_progress_bar/progress_bar.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'My progressbar package',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

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

class _MyHomePageState extends State<MyHomePage> {
  double p1 = 0;
  double p2 = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color.fromARGB(255, 211, 211, 211),
      appBar: AppBar(
        backgroundColor: Colors.blue,
        title: Text(
          'MyProgressBar example',
          style: TextStyle(color: Colors.white),
        ),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('Horizontal Progressbar example'),
            const SizedBox(
              height: 20,
            ),
            HorizontalProgressBar(
              maxValue: 30,
              currentPosition: p1,
              enabledHeight: 20,
              onChanged: (val) {
                setState(() {
                  p1 = val;
                });
              },
            ),
            const SizedBox(
              height: 50,
            ),
            const Text('Vertical Progressbar example'),
            const SizedBox(
              height: 20,
            ),
            VerticalProgressBar(
              height: 200,
              maxValue: 10,
              currentPosition: p2,
              bufferedPosition: 4,
              // enabledWidth: 50,
              onChanged: (val) {
                setState(() {
                  p2 = val;
                });
              },
            )
          ],
        ),
      ),
    );
  }
}
4
likes
150
points
55
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter package for displaying progress bars

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on my_progress_bar