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

A Flutter package to display a linear progress bar indicator.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:smooth_progress_bar_indicator/progress_indicator_smooth_transition.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return const GetMaterialApp(
      home: ProgressBarExample(),
    );
  }
}

class ProgressBarExample extends StatefulWidget {
  const ProgressBarExample({key});

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

class _ProgressBarExampleState extends State<ProgressBarExample> {
  // Define the end time as a reactive value
  final RxInt endTime = 10.obs;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Progress Bar Indicator Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ProgressBarIndicator(
              width: 300,
              height: 10,
              color: Colors.blue,
              endTime: endTime,
              onProgressComplete: () {
                // Show a snackbar when the progress is complete
                Get.snackbar(
                  'Progress Complete',
                  'The progress bar has completed.',
                  snackPosition: SnackPosition.BOTTOM,
                );
              },
            ),
            SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                // Restart the progress bar
                setState(() {
                  endTime.value = 10;
                  Get.find<ProgressBarIndicatorController>().reBuildWidget();
                });
              },
              child: Text('Restart Progress'),
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
0
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to display a linear progress bar indicator.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, get

More

Packages that depend on smooth_progress_bar_indicator