-
Notifications
You must be signed in to change notification settings - Fork 358
/
Copy pathdevices.dart
192 lines (176 loc) · 4.74 KB
/
devices.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import 'package:device_frame/src/info/info.dart';
import 'package:device_frame/src/devices/android/samsung_galaxy_s20/device.dart'
as i_samsung_galaxy_s20;
import 'package:device_frame/src/devices/android/samsung_galaxy_note20/device.dart'
as i_samsung_galaxy_note20;
import 'package:device_frame/src/devices/android/samsung_galaxy_note20_ultra/device.dart'
as i_samsung_galaxy_note20_ultra;
import 'package:device_frame/src/devices/android/samsung_galaxy_a50/device.dart'
as samsung_galaxy_a50;
import 'package:device_frame/src/devices/android/oneplus_8_pro/device.dart'
as i_oneplus_8_pro;
import 'package:device_frame/src/devices/android/sony_xperia_1_ii/device.dart'
as i_sony_xperia_1_ii;
import 'package:flutter/material.dart';
/// A set of iOS devices.
class AndroidDevices {
const AndroidDevices();
DeviceInfo get samsungGalaxyS20 => i_samsung_galaxy_s20.info;
DeviceInfo get samsungGalaxyNote20 => i_samsung_galaxy_note20.info;
DeviceInfo get samsungGalaxyNote20Ultra => i_samsung_galaxy_note20_ultra.info;
DeviceInfo get samsungGalaxyA50 => samsung_galaxy_a50.info;
DeviceInfo get onePlus8Pro => i_oneplus_8_pro.info;
DeviceInfo get sonyXperia1II => i_sony_xperia_1_ii.info;
DeviceInfo get pixel4 => _pixel4;
static final _pixel4 = DeviceInfo.genericPhone(
platform: TargetPlatform.android,
id: 'pixel4',
name: 'Pixel 4',
pixelRatio: 3.5,
screenSize: const Size(412.0, 869.0),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
DeviceInfo get smallPhone => _smallPhone;
static final _smallPhone = DeviceInfo.genericPhone(
platform: TargetPlatform.android,
name: 'Small',
id: 'small',
screenSize: const Size(360, 640),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
DeviceInfo get mediumPhone => _mediumPhone;
static final _mediumPhone = DeviceInfo.genericPhone(
platform: TargetPlatform.android,
name: 'Medium',
id: 'medium',
screenSize: const Size(412, 732),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
DeviceInfo get bigPhone => _bigPhone;
static final _bigPhone = DeviceInfo.genericPhone(
platform: TargetPlatform.android,
name: 'Big',
id: 'big',
screenSize: const Size(480, 853),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
DeviceInfo get smallTablet => _smallTablet;
static final _smallTablet = DeviceInfo.genericTablet(
platform: TargetPlatform.android,
name: 'Small',
id: 'small',
screenSize: const Size(800, 1280),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
DeviceInfo get mediumTablet => _mediumTablet;
static final _mediumTablet = DeviceInfo.genericTablet(
platform: TargetPlatform.android,
name: 'Medium',
id: 'medium',
screenSize: const Size(1024, 1350),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
DeviceInfo get largeTablet => _largeTablet;
static final _largeTablet = DeviceInfo.genericTablet(
platform: TargetPlatform.android,
name: 'Large',
id: 'large',
screenSize: const Size(1280, 1880),
safeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
rotatedSafeAreas: const EdgeInsets.only(
left: 0.0,
top: 24.0,
right: 0.0,
bottom: 0.0,
),
);
/// All available devices.
List<DeviceInfo> get all => [
//Phones
samsungGalaxyA50,
samsungGalaxyS20,
samsungGalaxyNote20,
samsungGalaxyNote20Ultra,
pixel4,
onePlus8Pro,
sonyXperia1II,
smallPhone,
mediumPhone,
bigPhone,
// Tablets
smallTablet,
mediumTablet,
largeTablet,
];
}