This commit is contained in:
@ -25,28 +25,28 @@ class MyApp extends StatelessWidget {
|
|||||||
initialRoute: '/',
|
initialRoute: '/',
|
||||||
routes: {'/': (context) => const MyHomePage(title: constants.appTitle)},
|
routes: {'/': (context) => const MyHomePage(title: constants.appTitle)},
|
||||||
onGenerateRoute: (settings) {
|
onGenerateRoute: (settings) {
|
||||||
if (settings.name == '/settings') {
|
if (settings.name != '/settings') {
|
||||||
final mountConfig = settings.arguments as MountConfig;
|
return null;
|
||||||
return MaterialPageRoute(
|
|
||||||
builder: (context) {
|
|
||||||
return MountSettingsWidget(
|
|
||||||
title:
|
|
||||||
'${initialCaps(mountConfig.type)} [${formatMountName(mountConfig.type, mountConfig.name)}] Settings',
|
|
||||||
config: mountConfig,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
|
final mountConfig = settings.arguments as MountConfig;
|
||||||
|
return MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return MountSettingsWidget(
|
||||||
|
title:
|
||||||
|
'${initialCaps(mountConfig.type)} [${formatMountName(mountConfig.type, mountConfig.name)}] Settings',
|
||||||
|
config: mountConfig,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyHomePage extends StatefulWidget {
|
class MyHomePage extends StatefulWidget {
|
||||||
const MyHomePage({super.key, required this.title});
|
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
|
const MyHomePage({super.key, required this.title});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MyHomePage> createState() => _MyHomePageState();
|
State<MyHomePage> createState() => _MyHomePageState();
|
||||||
|
Reference in New Issue
Block a user