Format main.dart
This commit is contained in:
parent
9d0c3640fe
commit
cf97068d7b
|
@ -85,44 +85,44 @@ class _AppState extends State<App> {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: brightness == Brightness.light ? lightTheme : darkTheme,
|
theme: brightness == Brightness.light ? lightTheme : darkTheme,
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: PlatformProvider(
|
body: PlatformProvider(
|
||||||
//initialPlatform: initialPlatform,
|
//initialPlatform: initialPlatform,
|
||||||
builder: (context) => PlatformApp(
|
builder: (context) => PlatformApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
||||||
DefaultMaterialLocalizations.delegate,
|
DefaultMaterialLocalizations.delegate,
|
||||||
DefaultWidgetsLocalizations.delegate,
|
DefaultWidgetsLocalizations.delegate,
|
||||||
DefaultCupertinoLocalizations.delegate,
|
DefaultCupertinoLocalizations.delegate,
|
||||||
],
|
],
|
||||||
title: 'Nebula',
|
title: 'Nebula',
|
||||||
material: (_, __) {
|
material: (_, __) {
|
||||||
return new MaterialAppData(
|
return new MaterialAppData(
|
||||||
themeMode: brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
|
themeMode: brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
|
||||||
);
|
|
||||||
},
|
|
||||||
cupertino: (_, __) => CupertinoAppData(
|
|
||||||
theme: CupertinoThemeData(brightness: brightness),
|
|
||||||
),
|
|
||||||
onGenerateRoute: (settings) {
|
|
||||||
if (settings.name == '/') {
|
|
||||||
return platformPageRoute(context: context, builder: (context) => MainScreen(this.dnEnrolled));
|
|
||||||
}
|
|
||||||
|
|
||||||
final uri = Uri.parse(settings.name!);
|
|
||||||
if (uri.path == EnrollmentScreen.routeName) {
|
|
||||||
// TODO: maybe implement this as a dialog instead of a page, you can stack multiple enrollment screens which is annoying in dev
|
|
||||||
return platformPageRoute(
|
|
||||||
context: context,
|
|
||||||
builder: (context) =>
|
|
||||||
EnrollmentScreen(code: EnrollmentScreen.parseCode(settings.name!), stream: this.dnEnrolled),
|
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
cupertino: (_, __) => CupertinoAppData(
|
||||||
|
theme: CupertinoThemeData(brightness: brightness),
|
||||||
|
),
|
||||||
|
onGenerateRoute: (settings) {
|
||||||
|
if (settings.name == '/') {
|
||||||
|
return platformPageRoute(context: context, builder: (context) => MainScreen(this.dnEnrolled));
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
final uri = Uri.parse(settings.name!);
|
||||||
},
|
if (uri.path == EnrollmentScreen.routeName) {
|
||||||
|
// TODO: maybe implement this as a dialog instead of a page, you can stack multiple enrollment screens which is annoying in dev
|
||||||
|
return platformPageRoute(
|
||||||
|
context: context,
|
||||||
|
builder: (context) =>
|
||||||
|
EnrollmentScreen(code: EnrollmentScreen.parseCode(settings.name!), stream: this.dnEnrolled),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue