diff --git a/api/pubspec.lock b/api/pubspec.lock index 01ac4e8e..fe1fbab3 100644 --- a/api/pubspec.lock +++ b/api/pubspec.lock @@ -397,10 +397,10 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.0" shelf: dependency: transitive description: @@ -445,10 +445,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: "4ac0537115a24d772c408a2520ecd0abb99bca2ea9c4e634ccbdbfae64fe17ec" + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" stream_transform: dependency: transitive description: diff --git a/app/android/Gemfile.lock b/app/android/Gemfile.lock index ec0116cb..489c1d50 100644 --- a/app/android/Gemfile.lock +++ b/app/android/Gemfile.lock @@ -10,7 +10,7 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.1033.0) + aws-partitions (1.1034.0) aws-sdk-core (3.214.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) diff --git a/app/android/gradle/wrapper/gradle-wrapper.properties b/app/android/gradle/wrapper/gradle-wrapper.properties index 68e8816d..e1b837a1 100644 --- a/app/android/gradle/wrapper/gradle-wrapper.properties +++ b/app/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionSha256Sum=7a00d51fb93147819aab76024feece20b6b84e420694101f276be952e08bef03 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/app/android/settings.gradle b/app/android/settings.gradle index c020fad3..951934bb 100644 --- a/app/android/settings.gradle +++ b/app/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.7.2' apply false - id "org.jetbrains.kotlin.android" version "2.0.21" apply false + id "com.android.application" version '8.7.3' apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false } include ":app" diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb index e2c31587..fd5dec35 100644 --- a/app/lib/l10n/app_en.arb +++ b/app/lib/l10n/app_en.arb @@ -219,5 +219,7 @@ "offset": "Offset", "wholeSizeClickCustomize": "Whole size, click to customize", "clear": "Clear", - "textures": "Textures" + "textures": "Textures", + "texture": "Texture", + "notSet": "Not set" } diff --git a/app/lib/pages/editor/shell.dart b/app/lib/pages/editor/shell.dart index 0c55b458..62c0927a 100644 --- a/app/lib/pages/editor/shell.dart +++ b/app/lib/pages/editor/shell.dart @@ -84,6 +84,7 @@ class EditorNavigatorView extends StatelessWidget { return NavigationDrawer( selectedIndex: isMobile ? currentPage.index + 1 : currentPage.index, onDestinationSelected: (value) { + if (isMobile) Navigator.of(context).pop(); if (isMobile && value == 0) { context.go('/'); } else { diff --git a/app/lib/pages/editor/textures.dart b/app/lib/pages/editor/textures.dart index ea47855d..5813a84b 100644 --- a/app/lib/pages/editor/textures.dart +++ b/app/lib/pages/editor/textures.dart @@ -64,6 +64,51 @@ class TexturesEditorPage extends StatelessWidget { } } +class EditorTextureListTile extends StatelessWidget { + final String? label; + final String value; + final ValueChanged onChanged; + final VoidCallback? onRemove; + + const EditorTextureListTile({ + super.key, + this.label, + required this.value, + required this.onChanged, + this.onRemove, + }); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + final data = state.getTexture(value); + return ListTile( + title: Text(label ?? AppLocalizations.of(context).texture), + subtitle: + Text(value.isEmpty ? AppLocalizations.of(context).notSet : ''), + leading: + data == null ? null : Image.memory(data, width: 48, height: 48), + onTap: () => showDialog( + context: context, + builder: (context) => + TextureDialog(textures: state.getTexturesData()), + ).then((texture) { + if (texture == null) return; + onChanged(texture); + }), + trailing: onRemove == null + ? null + : IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: onRemove, + ), + ); + }, + ); + } +} + class TextureDialog extends StatelessWidget { final Map textures; @@ -80,6 +125,12 @@ class TextureDialog extends StatelessWidget { content: _TexturesColumn( textures: textures, onClick: (texture) => Navigator.of(context).pop(texture)), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(AppLocalizations.of(context).cancel), + ), + ], ); } } @@ -139,6 +190,14 @@ class VisualEditingView extends StatelessWidget { final size = value.size; return Column( children: [ + EditorTextureListTile( + value: value.texture, + onChanged: (texture) => + onChanged(value.copyWith(texture: texture) as T), + onRemove: value.texture.isEmpty + ? null + : () => onChanged(value.copyWith(texture: '') as T), + ), OffsetListTile( value: value.offset.toOffset(), title: Text(AppLocalizations.of(context).offset), diff --git a/app/pubspec.lock b/app/pubspec.lock index 330117b6..a9c2a088 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -458,10 +458,10 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: c0f1abb088adddc193286ea91eedd71900ec5707ac86503a7ae09d88c9ffc22b + sha256: "127f5ab0b6402baa7a3322bddb419a22874f7b5b1e12c9946e329c7f846d8e4e" url: "https://pub.dev" source: hosted - version: "10.0.0-beta.2" + version: "10.0.0-beta.3" flutter_secure_storage_linux: dependency: transitive description: @@ -506,10 +506,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "54900a1a1243f3c4a5506d853a2b5c2dbc38d5f27e52a52618a8054401431123" + sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b url: "https://pub.dev" source: hosted - version: "2.0.16" + version: "2.0.17" flutter_test: dependency: "direct dev" description: flutter @@ -614,10 +614,10 @@ packages: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "0.7.1" json_annotation: dependency: transitive description: @@ -1289,10 +1289,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.0" url_launcher_windows: dependency: transitive description: