Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class CounterPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Counter')),
body: BlocBuilder<CounterCubit, int>(
builder: (context, count) => Center(child: Text('$count')),
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.add),
onPressed: () => context.bloc<CounterCubit>().increment(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment