waiting 1.0.3 copy "waiting: ^1.0.3" to clipboard
waiting: ^1.0.3 copied to clipboard

Waiting is a part of any app: loading resources takes time and the user needs to be informed that he has to wait. This package provides a `WaitingWidget`: a widget showing a progress indicator, includ [...]

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Waiting Example',
      theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
          useMaterial3: true),
      home: Example(),
    );
  }
}

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

  @override
  State<StatefulWidget> createState() => ExampleState();
}

class ExampleState extends State<Example> {
  bool _show = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: WaitingWidget(
          show: _show,
          child: const Center(
              child: SizedBox(width: 200, height: 200, child: FlutterLogo()))),
      floatingActionButton: FloatingActionButton(
        onPressed: _toggle,
        child: !_show ? const Icon(Icons.play_arrow) : const Icon(Icons.pause),
      ),
    );
  }

  void _toggle() {
    setState(() {
      _show = !_show;
    });
  }
}
5
likes
130
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

Waiting is a part of any app: loading resources takes time and the user needs to be informed that he has to wait. This package provides a `WaitingWidget`: a widget showing a progress indicator, including animations, transitions and customizations.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

async, flutter

More

Packages that depend on waiting