init static method
void
init(})
Implementation
static void init(
BuildContext context, {
String widgetCode = '',
Color backgroundColor = Colors.white, // Default background color
String appBarTitle = 'Chat With Us', // Default app bar title
Color appBarBackgroundColor = Colors.blueAccent, // Default background color
Color appBarTitleColor = Colors.white, // Default title color
Color appBarBackButtonColor = Colors.white, // Default back button color
}) async {
debugPrint("Quick chat ---------- start chat");
PreferencesManager preferencesManager = PreferencesManager();
await preferencesManager.savePreferences(
widgetCode: widgetCode,
backgroundColor: backgroundColor,
appBarTitle: appBarTitle,
appBarBackgroundColor: appBarBackgroundColor,
appBarTitleColor: appBarTitleColor,
appBarBackButtonColor: appBarBackgroundColor,
);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => QuickChatWidget(
widgetCode: widgetCode,
appBarTitle: appBarTitle,
appBarBackgroundColor: appBarBackgroundColor,
appBarTitleColor: appBarTitleColor,
appBarBackButtonColor: appBarBackButtonColor,
backgroundColor: backgroundColor),
),
);
}