Fix deep links (#207)
This commit is contained in:
parent
c97732d1be
commit
a449a650c3
|
@ -94,46 +94,42 @@ class _AppState extends State<App> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return MaterialApp(
|
return PlatformProvider(
|
||||||
theme: brightness == Brightness.light ? lightTheme : darkTheme,
|
settings: PlatformSettingsData(iosUsesMaterialWidgets: true),
|
||||||
home: Scaffold(
|
builder: (context) => PlatformApp(
|
||||||
body: PlatformProvider(
|
debugShowCheckedModeBanner: false,
|
||||||
//initialPlatform: initialPlatform,
|
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
||||||
builder: (context) => PlatformApp(
|
DefaultMaterialLocalizations.delegate,
|
||||||
debugShowCheckedModeBanner: false,
|
DefaultWidgetsLocalizations.delegate,
|
||||||
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
DefaultCupertinoLocalizations.delegate,
|
||||||
DefaultMaterialLocalizations.delegate,
|
],
|
||||||
DefaultWidgetsLocalizations.delegate,
|
title: 'Nebula',
|
||||||
DefaultCupertinoLocalizations.delegate,
|
material: (_, __) {
|
||||||
],
|
return new MaterialAppData(
|
||||||
title: 'Nebula',
|
themeMode: brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
|
||||||
material: (_, __) {
|
theme: brightness == Brightness.light ? lightTheme : darkTheme,
|
||||||
return new MaterialAppData(
|
);
|
||||||
themeMode: brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
|
},
|
||||||
);
|
cupertino: (_, __) => CupertinoAppData(
|
||||||
},
|
theme: CupertinoThemeData(brightness: brightness),
|
||||||
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),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
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),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue