a library for personal use
the comments are poor, the code is horrible
i cannot (and don't want to) guarantee you the safety of your ass during its usage
it's mine
Future<void> main() async {
// These two lines are to use [Pref]s API.
// Can be omitted if you don't use them.
WidgetsFlutterBinding.ensureInitialized();
await NFPrefs.initialize();
runApp(App());
}
final RouteObserver<Route> routeObserver = RouteObserver();
class App extends StatefulWidget {
App({Key? key}) : super(key: key);
static final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
@override
_AppState createState() => _AppState();
}
class _AppState extends State<App> {
@override
void initState() {
super.initState();
NFWidgets.init(
routeObservers: [routeObserver],
navigatorKey: App.navigatorKey, // can omit if you don't use snackbars
);
}
@override
Widget build(BuildContext context) {
return NFTheme(
data: NFThemeData(systemUiStyle: SystemUiOverlayStyle.dark),
child: MaterialApp(
title: 'Example',
color: Colors.black,
navigatorKey: App.navigatorKey,
theme: Constants.AppTheme.theme,
navigatorObservers: [routeObserver],
),
);
}
}
names have NF
prefix if:
NFSnackbarController