/
main.dart
52 lines (49 loc) · 1.6 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import 'package:device_preview/device_preview.dart';
import 'package:example/screens/gallery_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
DevicePreview(
// enabled: kIsWeb ? false : !kReleaseMode,
enabled: false,
builder: (_) => MyApp(),
),
);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
/// Set to `true` to see the full possibilities of the iOS Developer Screen
final bool runCupertinoApp = false;
if (runCupertinoApp) {
return CupertinoApp(
useInheritedMediaQuery: true,
locale: DevicePreview.locale(context),
debugShowCheckedModeBanner: false,
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
DefaultMaterialLocalizations.delegate,
DefaultWidgetsLocalizations.delegate,
DefaultCupertinoLocalizations.delegate,
],
title: 'Settings UI Demo',
home: GalleryScreen(),
);
} else {
return MaterialApp(
useInheritedMediaQuery: true,
debugShowCheckedModeBanner: false,
locale: DevicePreview.locale(context),
theme: ThemeData.light(),
darkTheme: ThemeData(
cupertinoOverrideTheme: CupertinoThemeData(
barBackgroundColor: Color(0xFF1b1b1b),
brightness: Brightness.dark,
textTheme: CupertinoTextThemeData(primaryColor: Colors.white)),
brightness: Brightness.dark),
title: 'Settings UI Demo',
home: GalleryScreen(),
);
}
}
}