class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: BotToastInit(), //1. call BotToastInit
navigatorObservers: [BotToastNavigatorObserver()],
debugShowCheckedModeBanner: false,
title: 'Pak Coins',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MySplashScreen(),
);
}
}
this is my MyApp Class where want to call 2 builder
The builder
parameter must return one widget. If you like to do initialization or return two widgets, you've to nest them yourself inside the builder
:
builder: (context, child) {
// do your initialization here
child = EasyLoading.init(); // assuming this is returning a widget
child = botToastBuilder(context,child);
return child;
}
if you look at the getting started guide of bot_toast package, they've an example at step 3.
Update: Or utilize the builder methods provided by BotToast or EasyLoading such as:
builder: EasyLoading.init(builder: BotToastInit()),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With