This commit is contained in:
Shawn 2024-02-20 10:34:37 -07:00
parent dadb6275fc
commit 1b508f3200
5 changed files with 29 additions and 32 deletions

View File

@ -40,7 +40,7 @@ class CollectiblesLogic with ThrottledSaveLoadMixin {
statesById.value = states; statesById.value = states;
if (state == CollectibleState.discovered) { if (state == CollectibleState.discovered) {
final data = fromId(id)!; final data = fromId(id)!;
_updateNativeWidgetTextData( _updateNativeHomeWidgetData(
title: data.title, title: data.title,
id: data.id, id: data.id,
imageUrl: data.imageUrlSmall, imageUrl: data.imageUrlSmall,
@ -91,15 +91,14 @@ class CollectiblesLogic with ThrottledSaveLoadMixin {
for (int i = 0; i < all.length; i++) { for (int i = 0; i < all.length; i++) {
states[all[i].id] = CollectibleState.lost; states[all[i].id] = CollectibleState.lost;
} }
if (_nativeWidget.isSupported) { _updateNativeHomeWidgetData(); // clear home widget data
_updateNativeWidgetTextData(); // clear home widget data
}
statesById.value = states; statesById.value = states;
debugPrint('collection reset'); debugPrint('collection reset');
scheduleSave(); scheduleSave();
} }
Future<void> _updateNativeWidgetTextData({String title = '', String id = '', String imageUrl = ''}) async { Future<void> _updateNativeHomeWidgetData({String title = '', String id = '', String imageUrl = ''}) async {
if(!_nativeWidget.isSupported) return;
// Save title // Save title
await _nativeWidget.save<String>('lastDiscoveredTitle', title); await _nativeWidget.save<String>('lastDiscoveredTitle', title);
// Subtitle // Subtitle
@ -115,7 +114,7 @@ class CollectiblesLogic with ThrottledSaveLoadMixin {
if (imageUrl.isNotEmpty) { if (imageUrl.isNotEmpty) {
var bytes = await http.readBytes(Uri.parse(imageUrl)); var bytes = await http.readBytes(Uri.parse(imageUrl));
imageBase64 = base64Encode(bytes); imageBase64 = base64Encode(bytes);
debugPrint('Saving base64 bytes: $imageBase64'); debugPrint('Saving base64 bytes for homeWidget');
} }
await _nativeWidget.save<String>('lastDiscoveredImageData', imageBase64); await _nativeWidget.save<String>('lastDiscoveredImageData', imageBase64);
await _nativeWidget.markDirty(); await _nativeWidget.markDirty();

View File

@ -1,11 +1,13 @@
// This is a generated file; do not edit or check into version control. // This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\_dev\sdks\flutter FLUTTER_ROOT=/Users/shawn/Dev/flutter
FLUTTER_APPLICATION_PATH=C:\_dev\gskinner\flutter_wonders_app FLUTTER_APPLICATION_PATH=/Users/shawn/Dev/gskinner/flutter-wonders-app
COCOAPODS_PARALLEL_CODE_SIGN=true COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=/Users/shawn/Dev/gskinner/flutter-wonders-app/lib/main.dart
FLUTTER_BUILD_DIR=build FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=2.2.1 FLUTTER_BUILD_NAME=2.2.2
FLUTTER_BUILD_NUMBER=2.2.1 FLUTTER_BUILD_NUMBER=2.2.2
DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC81NGE3MTQ1MzAzZjBkZDlkMGY5MzQyNGEyZTEyNGViNGFiZWY1MDkxLw==
DART_OBFUSCATION=false DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json PACKAGE_CONFIG=/Users/shawn/Dev/gskinner/flutter-wonders-app/.dart_tool/package_config.json

View File

@ -1,12 +1,14 @@
#!/bin/sh #!/bin/sh
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\_dev\sdks\flutter" export "FLUTTER_ROOT=/Users/shawn/Dev/flutter"
export "FLUTTER_APPLICATION_PATH=C:\_dev\gskinner\flutter_wonders_app" export "FLUTTER_APPLICATION_PATH=/Users/shawn/Dev/gskinner/flutter-wonders-app"
export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/shawn/Dev/gskinner/flutter-wonders-app/lib/main.dart"
export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=2.2.1" export "FLUTTER_BUILD_NAME=2.2.2"
export "FLUTTER_BUILD_NUMBER=2.2.1" export "FLUTTER_BUILD_NUMBER=2.2.2"
export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC81NGE3MTQ1MzAzZjBkZDlkMGY5MzQyNGEyZTEyNGViNGFiZWY1MDkxLw=="
export "DART_OBFUSCATION=false" export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true" export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false" export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json" export "PACKAGE_CONFIG=/Users/shawn/Dev/gskinner/flutter-wonders-app/.dart_tool/package_config.json"

View File

@ -7,8 +7,6 @@ PODS:
- path_provider_foundation (0.0.1): - path_provider_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- share_plus (0.0.1):
- FlutterMacOS
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
@ -20,7 +18,6 @@ DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`) - FlutterMacOS (from `Flutter/ephemeral`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
@ -33,8 +30,6 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
path_provider_foundation: path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
share_plus:
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
shared_preferences_foundation: shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
url_launcher_macos: url_launcher_macos:
@ -44,11 +39,10 @@ SPEC CHECKSUMS:
desktop_window: fb7c4f12c1129f947ac482296b6f14059d57a3c3 desktop_window: fb7c4f12c1129f947ac482296b6f14059d57a3c3
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852 path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
COCOAPODS: 1.11.3 COCOAPODS: 1.15.0

View File

@ -332,10 +332,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: google_maps_flutter_ios name: google_maps_flutter_ios
sha256: b644d205c235f85dc60e22f46172a868b1cd642afd5a52b3808c789e461b025a sha256: c89556ed0338fcb4b843c9fcdafac7ad2df601c8b41286d82f0727f7f66434e4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.1" version: "2.3.6"
google_maps_flutter_platform_interface: google_maps_flutter_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -953,10 +953,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_wkwebview name: webview_flutter_wkwebview
sha256: b99ca8d8bae9c6b43d568218691aa537fb0aeae1d7d34eadf112a6aa36d26506 sha256: "4d062ad505390ecef1c4bfb6001cd857a51e00912cc9dfb66edb1886a9ebd80c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.11.0" version: "3.10.2"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@ -1006,5 +1006,5 @@ packages:
source: hosted source: hosted
version: "2.0.2" version: "2.0.2"
sdks: sdks:
dart: ">=3.2.3 <4.0.0" dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.6" flutter: ">=3.16.0"