appTemplate top-level constant

String const appTemplate

appTemplate this will be use in order to create app.dart for export and import

Implementation

/// this will be use in order to create app.dart for export and import
const String appTemplate = """
import 'core.dart';

class MyApp extends StatelessWidget {

  final AuthenticationController authenticationController;

  const MyApp({
    Key? key,
    required this.authenticationController,
  }) : super(key: key);

  static const String title = "MyApp";

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider<AuthenticationController>(
          create: (_) => authenticationController,
        ),
        Provider<MyRouter>(
          lazy: false,
          create: (_) => MyRouter(authenticationController),
        ),
      ],
      child: Builder(builder: (context) {
        final router = Provider.of<MyRouter>(context, listen: false).router;

        return MaterialApp.router(
          debugShowCheckedModeBanner: false,
          localizationsDelegates: context.localizationDelegates,
          supportedLocales: context.supportedLocales,
          locale: context.locale,
          title: MyApp.title,
          theme: ThemeData(primarySwatch: Colors.blue),
          routeInformationParser: router.routeInformationParser,
          routerDelegate: router.routerDelegate,
        );
      }),
    );
  }
}
""";