mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-13 09:20:29 +00:00
feat: Refactor MaterialApp initialization into a separate method for improved readability
This commit is contained in:
@@ -136,10 +136,16 @@ class _MeshCoreSarAppState extends State<MeshCoreSarApp> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: Builder(
|
child: _buildMaterialApp(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMaterialApp() {
|
||||||
|
return Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final systemBrightness = MediaQuery.platformBrightnessOf(context);
|
final systemBrightness = MediaQuery.platformBrightnessOf(context);
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
|
key: ValueKey<String?>('${_locale?.languageCode ?? 'system'}_${_themeMode.name}'),
|
||||||
title: 'MeshCore SAR',
|
title: 'MeshCore SAR',
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: AppTheme.getTheme(_themeMode, systemBrightness),
|
theme: AppTheme.getTheme(_themeMode, systemBrightness),
|
||||||
@@ -159,7 +165,6 @@ class _MeshCoreSarAppState extends State<MeshCoreSarApp> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user