V_Root function

MaterialApp V_Root(
  1. String strfrm, {
  2. String title = "",
  3. String cp_name = "",
  4. String strparameter = "",
  5. bool ShowTitleBar = true,
})

Implementation

MaterialApp V_Root(
  String strfrm, {
  String title = "",
  // ignore: non_constant_identifier_names
  String cp_name = "",
  String strparameter = "",
  // ignore: non_constant_identifier_names
  bool ShowTitleBar = true,
}) {
  return MaterialApp(
    title: (ShowTitleBar || title == "") ? title : null,
    navigatorKey: AppNavigator.navigatorKey,
    debugShowCheckedModeBanner: false,
    theme: ThemeData(
      colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
      useMaterial3: true,
      pageTransitionsTheme: const PageTransitionsTheme(
        builders: {
          TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
          TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
        },
      ),
    ),
    home:
        V_getScreen(
          strfrm,
          title,
          cp_name,
          strparameter,
          hideAppBar: true,
          isMainScreen: true,
        ) ??
        const Scaffold(body: Center(child: Text('Không tìm thấy màn hình'))),
  );
}