|
...
|
...
|
@@ -26,14 +26,18 @@ class WatchFacePreview extends StatelessWidget { |
|
|
|
final WatchFacePreviewType type;
|
|
|
|
final Function()? switchFriend;
|
|
|
|
|
|
|
|
String get _backgroundAsset {
|
|
|
|
String _backgroundAsset(BuildContext context) {
|
|
|
|
final isChinese = Localizations.localeOf(context).languageCode == 'zh';
|
|
|
|
final directory =
|
|
|
|
isChinese ? 'assets/images/watch_theme/zh' : 'assets/images/watch_theme';
|
|
|
|
|
|
|
|
if (type == WatchFacePreviewType.surface) {
|
|
|
|
return 'assets/images/watch_theme/watch_theme_preview_surface.png';
|
|
|
|
return '$directory/watch_theme_preview_surface.png';
|
|
|
|
}
|
|
|
|
if (type == WatchFacePreviewType.coupleSmall) {
|
|
|
|
return 'assets/images/watch_theme/watch_theme_preview_couple.png';
|
|
|
|
return '$directory/watch_theme_preview_couple.png';
|
|
|
|
}
|
|
|
|
return 'assets/images/watch_theme/watch_theme_preview_single.png';
|
|
|
|
return '$directory/watch_theme_preview_single.png';
|
|
|
|
}
|
|
|
|
|
|
|
|
Size get _previewSize {
|
|
...
|
...
|
@@ -68,7 +72,7 @@ class WatchFacePreview extends StatelessWidget { |
|
|
|
clipBehavior: Clip.none,
|
|
|
|
children: [
|
|
|
|
Image(
|
|
|
|
image: AssetImage(_backgroundAsset),
|
|
|
|
image: AssetImage(_backgroundAsset(context)),
|
|
|
|
width: size.width,
|
|
|
|
height: size.height,
|
|
|
|
fit: BoxFit.fitWidth,
|
...
|
...
|
|