atom_event_bus 0.0.1 atom_event_bus: ^0.0.1 copied to clipboard
An Event Bus to decouple your code dependencies.
import 'package:flutter/material.dart';
import 'emitter.dart';
import 'subscriber.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ATOM EVENT BUS',
theme: ThemeData(
primarySwatch: Colors.green,
),
home: const MyHomePage(title: 'ATOM EVENT BUS'),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
centerTitle: true,
),
body: const SignedInStatus(),
floatingActionButton: const ToggleSignInStatus(),
);
}
}