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

Are you tired of always writing the same future and stream builders? Use AdvAsyncWidget to write only the code that you need for!

example/lib/main.dart

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

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

const TITLE = "AdvAsyncWidget Demo";

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => MyAppState();
}

class MyAppState extends State<MyApp> {

  late final Future<String> exampleFuture;

  @override
  void initState() {
    super.initState();
    exampleFuture = Future.delayed(Duration(seconds: 5), () => "FINISHED");
  }

  @override
  Widget build(BuildContext context) => MaterialApp(
    title: TITLE,
    home: Scaffold(
      appBar: AppBar(
        title: Text(TITLE),
      ),
      body: AdvFutureBuilder<String>(
        future: exampleFuture,
        onWait: (context) => CircularProgressIndicator(),
        onData: (context, data) => Text(data!),
      ),
    ),
  );
}
2
likes
150
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

Are you tired of always writing the same future and stream builders? Use AdvAsyncWidget to write only the code that you need for!

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on adv_async_widget