eventful_widget 0.0.1 copy "eventful_widget: ^0.0.1" to clipboard
eventful_widget: ^0.0.1 copied to clipboard

A new Flutter package project.

example/lib/main.dart

import 'package:example/random_color_button.dart';
import 'package:example/random_number_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: [
            RandomNumberButton(context.read<RandomNumberBloc>()),
            RandomColorButton(context.read<RandomColorBloc>()),
          ],
        ),
      ),
    );
  }
}

void main() {
  runApp(MaterialApp(
    home: MultiBlocProvider(
      providers: [
        BlocProvider(
          create: (_) => RandomNumberBloc(
              max: 1000,
              initial: RandomNumberState(active: false, value: 1000)),
        ),
        BlocProvider(create: (_) => RandomColorBloc()),
      ],
      child: Home(),
    ),
  ));
}
0
likes
120
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, flutter_bloc

More

Packages that depend on eventful_widget