native_progress_indicator 0.0.3 copy "native_progress_indicator: ^0.0.3" to clipboard
native_progress_indicator: ^0.0.3 copied to clipboard

Flutter progress indicators as platform views

example/lib/main.dart

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

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  double progress = 0.5;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Native progress indicators')),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: SizedBox(
              width: 400,
              child: Column(
                spacing: 8,
                children: [
                  Row(
                    spacing: 8,
                    children: [
                      Expanded(
                        flex: 1,
                        child: Column(
                          spacing: 8,
                          children: [
                            Text('Flutter'),
                            CircularProgressIndicator(),
                            CircularProgressIndicator(
                              value: progress,
                              backgroundColor: Theme.of(context)
                                  .colorScheme
                                  .secondaryContainer,
                            ),
                            LinearProgressIndicator(),
                            LinearProgressIndicator(
                              value: progress,
                            ),
                          ],
                        ),
                      ),
                      Expanded(
                        flex: 1,
                        child: Column(
                          spacing: 8,
                          children: [
                            Text('Native'),
                            NativeCircularProgressIndicator(),
                            NativeCircularProgressIndicator(
                              value: progress,
                              backgroundColor: Theme.of(context)
                                  .colorScheme
                                  .secondaryContainer,
                            ),
                            NativeLinearProgressIndicator(),
                            NativeLinearProgressIndicator(
                              value: progress,
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                  Slider(
                    value: progress,
                    onChanged: (newValue) =>
                        setState(() => progress = newValue),
                    min: 0,
                    max: 1,
                  ),
                  Text(progress.toString())
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
182
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter progress indicators as platform views

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web

More

Packages that depend on native_progress_indicator