cupertino_progress_bar 0.2.0 copy "cupertino_progress_bar: ^0.2.0" to clipboard
cupertino_progress_bar: ^0.2.0 copied to clipboard

A non-interactive progress bar includes a track that fills from left to right to show the progression of a task with a known duration.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:cupertino_progress_bar/cupertino_progress_bar.dart';

void main() => runApp(Container(child: ExampleApp()));

class ExampleApp extends StatefulWidget {
  @override
  _ExampleAppState createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  bool _dark = false;
  double _value = 0.77;

  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      debugShowCheckedModeBanner: false,
      theme: CupertinoThemeData(
        brightness: _dark ? Brightness.dark : Brightness.light,
      ),
      home: CupertinoPageScaffold(
        navigationBar: CupertinoNavigationBar(
          padding: EdgeInsetsDirectional.zero,
          middle: Stack(
            overflow: Overflow.visible,
            children: [
              Center(child: Text('CupertinoProgressBar')),
              Positioned(
                left: -8,
                right: -8,
                bottom: 0,
                child: CupertinoProgressBar(
                  value: _value,
                  trackColor: null,
                ),
              ),
              Positioned(
                top: 0,
                right: 0,
                bottom: 0,
                child: CupertinoSwitch(
                  value: _dark,
                  onChanged: (value) => setState(() => _dark = value),
                ),
              )
            ],
          ),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Expanded(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text('${(_value * 100).round()}%'),
                  SizedBox(height: 48),
                  CupertinoProgressBar(
                    value: _value,
                  ),
                ],
              ),
            ),
            CupertinoSlider(
              value: _value,
              onChanged: (value) => setState(() => _value = value),
            ),
          ],
        ),
      ),
    );
  }
}
15
likes
150
pub points
82%
popularity

Publisher

unverified uploader

A non-interactive progress bar includes a track that fills from left to right to show the progression of a task with a known duration.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on cupertino_progress_bar