diff options
Diffstat (limited to 'lib/data')
-rw-r--r-- | lib/data/data_providers/app.dart | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/data/data_providers/app.dart b/lib/data/data_providers/app.dart index acfaa01..3368a83 100644 --- a/lib/data/data_providers/app.dart +++ b/lib/data/data_providers/app.dart @@ -1,25 +1,32 @@ import '../../export.dart'; +final homeScreenProvider = Provider((ref) { + final Map<String, String> envVars = Platform.environment; + final ciFlagStr = envVars['HOMESCREEN_DEMO_CI']; + final bool ciFlag = ciFlagStr != null && ciFlagStr != "0"; + return ciFlag ? const HomeScreenCI() : const HomeScreen(); +}); + class App extends StatelessWidget { const App({super.key}); @override Widget build(BuildContext context) { - return const AppView(); - } -} - -class AppView extends StatelessWidget { - const AppView({super.key}); - - @override - Widget build(BuildContext context) { return ProviderScope( child: MaterialApp( debugShowCheckedModeBanner: false, theme: theme, - home: const HomeScreen(), + home: const AppView(), ), ); } } + +class AppView extends ConsumerWidget { + const AppView({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return ref.watch(homeScreenProvider); + } +} |