Add DEV banner when isDev=true
This commit is contained in:
parent
55da667a73
commit
c71432e91d
1 changed files with 27 additions and 7 deletions
|
|
@ -4,6 +4,7 @@ import "package:provider/provider.dart";
|
||||||
|
|
||||||
import "app/app_router.dart" show AppRoutes;
|
import "app/app_router.dart" show AppRoutes;
|
||||||
import "app/app_state.dart" show AppState;
|
import "app/app_state.dart" show AppState;
|
||||||
|
import "services/api.dart" show Api;
|
||||||
|
|
||||||
/// Global key for showing snackbars from anywhere in the app
|
/// Global key for showing snackbars from anywhere in the app
|
||||||
final GlobalKey<ScaffoldMessengerState> rootScaffoldMessengerKey =
|
final GlobalKey<ScaffoldMessengerState> rootScaffoldMessengerKey =
|
||||||
|
|
@ -28,7 +29,26 @@ class PayfritApp extends StatelessWidget {
|
||||||
providers: [
|
providers: [
|
||||||
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
|
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
|
||||||
],
|
],
|
||||||
|
child: Api.isDev
|
||||||
|
? Banner(
|
||||||
|
message: "DEV",
|
||||||
|
location: BannerLocation.topEnd,
|
||||||
|
color: Colors.orange,
|
||||||
|
textStyle: const TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
layoutDirection: TextDirection.ltr,
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
|
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
title: "Payfrit DEV",
|
||||||
|
initialRoute: AppRoutes.splash,
|
||||||
|
routes: AppRoutes.routes,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: MaterialApp(
|
||||||
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: "Payfrit",
|
title: "Payfrit",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue