fleasy 0.17.0 copy "fleasy: ^0.17.0" to clipboard
fleasy: ^0.17.0 copied to clipboard

Useful and easy to use extensions, helper classes and widgets to create Flutter apps easier.

example/lib/main.dart

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

void main() => runApp(FleasyExamples());

class FleasyExamples extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Fleasy examples',
      home: EasyFutureBuilderExampleInt(),
      //home: EasyFutureBuilderExampleList(),
      //home: EasyStreamBuilderExampleInt(),
      //home: EasyStreamBuilderExampleList(),
    );
  }
}

class EasyFutureBuilderExampleInt extends StatelessWidget {
  final Future<int?> future = (() async {
    await Future<void>.delayed(const Duration(seconds: 1));
    return 1;
    //return null;
    //return throw ('TEST ERROR');
  })();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: EasyFutureBuilder<int?>(
          future: future,
          dataBuilder: (context, data) => Text(data.toString()),
        ),
      ),
    );
  }
}

class EasyFutureBuilderExampleList extends StatelessWidget {
  final Future<List<int>?> future = (() async {
    await Future<void>.delayed(const Duration(seconds: 1));
    return <int>[1, 2, 3];
    //return <int>[];
    //return null;
    //return throw ('TEST ERROR');
  })();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: EasyFutureBuilder<List<int>?>(
          future: future,
          dataBuilder: (context, data) => Text(data.toString()),
        ),
      ),
    );
  }
}

class EasyStreamBuilderExampleInt extends StatelessWidget {
  final Stream<int?> stream = (() async* {
    await Future<void>.delayed(const Duration(seconds: 1));
    yield 1;
    //yield null;
    //yield throw ('TEST ERROR');
  })();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: EasyStreamBuilder<int?>(
          stream: stream,
          dataBuilder: (context, data) => Text(data.toString()),
        ),
      ),
    );
  }
}

class EasyStreamBuilderExampleList extends StatelessWidget {
  final Stream<List<int>?> stream = (() async* {
    await Future<void>.delayed(const Duration(seconds: 1));
    yield <int>[1, 2, 3];
    //yield <int>[];
    //yield null;
    //yield throw ('TEST ERROR');
  })();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: EasyStreamBuilder<List<int>?>(
          stream: stream,
          dataBuilder: (context, data) => Text(data.toString()),
        ),
      ),
    );
  }
}
82
likes
150
points
75
downloads

Publisher

verified publisherjensbecker.dev

Weekly Downloads

Useful and easy to use extensions, helper classes and widgets to create Flutter apps easier.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flash, flutter, flutter_lints, font_awesome_flutter, intl

More

Packages that depend on fleasy