-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhandle_platform.dart
More file actions
33 lines (30 loc) · 842 Bytes
/
Copy pathhandle_platform.dart
File metadata and controls
33 lines (30 loc) · 842 Bytes
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
import 'dart:io';
import 'package:platform_code_builder/platform_type.dart';
main(List<String> args) {
var platformMaskCode = PlatformType.fromName(args.first);
File(
'assets/${getLogoPath(platformMaskCode)}',
).copySync('assets/logo.png');
}
String getLogoPath(int platformMaskCode) {
switch (platformMaskCode) {
case PlatformType.xiaomi:
return 'xiaomi.png';
case PlatformType.huawei:
return 'huawei.png';
case PlatformType.oppo:
return 'oppo.png';
case PlatformType.vivo:
return 'vivo.png';
case PlatformType.iphone:
case PlatformType.mac:
return 'apple.png';
case PlatformType.linux:
return 'linux.png';
case PlatformType.windows:
return 'windows.png';
case PlatformType.web:
return 'chrome.png';
}
throw Exception('No logo found');
}