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_state.dart" show AppState;
|
||||
import "services/api.dart" show Api;
|
||||
|
||||
/// Global key for showing snackbars from anywhere in the app
|
||||
final GlobalKey<ScaffoldMessengerState> rootScaffoldMessengerKey =
|
||||
|
|
@ -28,7 +29,26 @@ class PayfritApp extends StatelessWidget {
|
|||
providers: [
|
||||
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(
|
||||
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: "Payfrit DEV",
|
||||
initialRoute: AppRoutes.splash,
|
||||
routes: AppRoutes.routes,
|
||||
),
|
||||
)
|
||||
: MaterialApp(
|
||||
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: "Payfrit",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue