From b339996a83db922b373f823ccd0a5526b55529fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Marquesini?= Date: Sat, 19 Feb 2022 00:33:03 -0300 Subject: [PATCH 1/6] upgrading compileSdkVersion to 31 --- android/app/build.gradle | 2 +- android/app/src/main/AndroidManifest.xml | 4 +--- .../me/markezine/littlelight_desktop/MainActivity.kt | 10 ---------- android/gradle.properties | 1 - 4 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 android/app/src/main/kotlin/me/markezine/littlelight_desktop/MainActivity.kt diff --git a/android/app/build.gradle b/android/app/build.gradle index 17ba8426..dbebd02f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,7 +38,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply plugin: 'com.google.firebase.crashlytics' android { - compileSdkVersion 29 + compileSdkVersion 31 lintOptions { disable 'InvalidPackage' diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index bb641c32..2f6217ef 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - Date: Sat, 19 Feb 2022 01:15:42 -0300 Subject: [PATCH 2/6] fixing dialogs --- .../dialogs/littlelight.base.dialog.dart | 25 +++++++++++-------- .../dialogs/tags/select_tag.dialog.dart | 5 ++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/widgets/dialogs/littlelight.base.dialog.dart b/lib/widgets/dialogs/littlelight.base.dialog.dart index 8997d903..7c9c4b6c 100644 --- a/lib/widgets/dialogs/littlelight.base.dialog.dart +++ b/lib/widgets/dialogs/littlelight.base.dialog.dart @@ -15,7 +15,7 @@ abstract class LittleLightBaseDialog extends StatelessWidget { final double maxHeight; const LittleLightBaseDialog( - {Key? key, this.titleBuilder, this.bodyBuilder, this.actionsBuilder, this.maxWidth = 600, this.maxHeight = 500}) + {Key? key, this.titleBuilder, this.bodyBuilder, this.actionsBuilder, this.maxWidth = 600, this.maxHeight = 400}) : super(key: key); CrossAxisAlignment get crossAxisAlignment => CrossAxisAlignment.stretch; @@ -24,13 +24,19 @@ abstract class LittleLightBaseDialog extends StatelessWidget { @override Widget build(BuildContext context) { + final padding = getDialogInsetPaddings(context) ?? EdgeInsets.all(0); + final size = MediaQuery.of(context).size; + double maxWidth = this.maxWidth.clamp(0, size.width - padding.left - padding.right); + double maxHeight = this.maxHeight.clamp(0, size.height - padding.top - padding.bottom); return Dialog( - insetPadding: getDialogInsetPaddings(context), - child: Column( - crossAxisAlignment: crossAxisAlignment, - mainAxisSize: MainAxisSize.min, - children: [buildTitleContainer(context), buildBodyContainer(context), buildActionsContainer(context)], - ), + insetPadding: padding, + child: Container( + constraints: BoxConstraints(maxHeight: maxHeight, maxWidth: maxWidth), + child: Column( + crossAxisAlignment: crossAxisAlignment, + mainAxisSize: MainAxisSize.min, + children: [buildTitleContainer(context), buildBodyContainer(context), buildActionsContainer(context)], + )), ); } @@ -50,10 +56,7 @@ abstract class LittleLightBaseDialog extends StatelessWidget { Widget buildBodyContainer(BuildContext context) { final body = buildBody(context); if (body == null) return Container(); - return Container( - constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight), - padding: EdgeInsets.all(16), - child: body); + return Flexible(child: Container(padding: EdgeInsets.all(16), child: body)); } Widget buildActionsContainer(BuildContext context) { diff --git a/lib/widgets/dialogs/tags/select_tag.dialog.dart b/lib/widgets/dialogs/tags/select_tag.dialog.dart index 4eea3750..e2caee66 100644 --- a/lib/widgets/dialogs/tags/select_tag.dialog.dart +++ b/lib/widgets/dialogs/tags/select_tag.dialog.dart @@ -72,11 +72,12 @@ class TagListWidget extends StatelessWidget with ItemNotesConsumer { @override Widget build(BuildContext context) { final tags = context.watch().tags; - return Column( + return SingleChildScrollView( + child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, children: tags.map((t) => buildTag(context, t)).toList(), - ); + )); } Widget buildTag(BuildContext context, ItemNotesTag tag) => Container( From ad3f87492168d8dd0f29d43ce0013e58f3e26aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Marquesini?= Date: Sat, 19 Feb 2022 01:17:10 -0300 Subject: [PATCH 3/6] fixing loadouts order --- lib/services/storage/membership_storage.service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/storage/membership_storage.service.dart b/lib/services/storage/membership_storage.service.dart index 9d01907d..137979a9 100644 --- a/lib/services/storage/membership_storage.service.dart +++ b/lib/services/storage/membership_storage.service.dart @@ -101,7 +101,7 @@ class MembershipStorage extends StorageBase { } Future saveLoadoutsOrder(List order) async { - await setJson(MembershipStorageKeys.cachedLoadouts, order); + await setJson(MembershipStorageKeys.loadoutsOrder, order); } Future getCachedProfile() async { From 44f42bf19db19c518f89a544fad3c033103c2fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Marquesini?= Date: Sat, 19 Feb 2022 01:25:56 -0300 Subject: [PATCH 4/6] fixing loadouts order --- lib/services/storage/membership_storage.service.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/storage/membership_storage.service.dart b/lib/services/storage/membership_storage.service.dart index 137979a9..b6c4bff6 100644 --- a/lib/services/storage/membership_storage.service.dart +++ b/lib/services/storage/membership_storage.service.dart @@ -90,9 +90,9 @@ class MembershipStorage extends StorageBase { Future?> getLoadoutsOrder() async { try { - final List? json = await getJson(MembershipStorageKeys.loadoutsOrder); + final List? json = await getJson(MembershipStorageKeys.loadoutsOrder); if (json == null) return null; - return json; + return json.map((s) => "$s").toList(); } catch (e) { print("can't parse loadouts order"); print(e); From 48bac8328f2b927a2fcd603136e86c79c52de91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Marquesini?= Date: Sat, 19 Feb 2022 01:38:24 -0300 Subject: [PATCH 5/6] re adding catalysts page --- lib/pages/triumphs/triumphs_root.page.dart | 11 +++++++++++ lib/services/profile/destiny_settings.service.dart | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/lib/pages/triumphs/triumphs_root.page.dart b/lib/pages/triumphs/triumphs_root.page.dart index 29a22866..de7c723f 100644 --- a/lib/pages/triumphs/triumphs_root.page.dart +++ b/lib/pages/triumphs/triumphs_root.page.dart @@ -87,6 +87,7 @@ class TriumphsRootPageState extends PresentationNodesTabsScaffoldState(rootNodes + subNodeHashes); setState(() { @@ -142,6 +143,7 @@ class TriumphsRootPageState extends PresentationNodesTabsScaffoldState onTriumphSelect( + node, + pathHashes: [catalystsHash, node.presentationNodeHash], + )), + if (catalystsHash != null) buildSpacer(), if (legacy != null) buildCategoryTitle(legacy), if (legacy != null) buildCategoryList( diff --git a/lib/services/profile/destiny_settings.service.dart b/lib/services/profile/destiny_settings.service.dart index c0b5df77..14c9751a 100644 --- a/lib/services/profile/destiny_settings.service.dart +++ b/lib/services/profile/destiny_settings.service.dart @@ -84,4 +84,8 @@ class DestinySettingsService with StorageConsumer, BungieApiConsumer, ManifestCo int? get legacySealsRootNode { return _currentSettings?.destiny2CoreSettings?.legacySealsRootNodeHash; } + + int? get catalystsRootNode { + return _currentSettings?.destiny2CoreSettings?.exoticCatalystsRootNodeHash; + } } From f9fddb83dbe229df222b3df533eb4a5ca77241bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Marquesini?= Date: Sat, 19 Feb 2022 05:19:03 -0300 Subject: [PATCH 6/6] adding mods previews on select --- lib/pages/objectives/objectives.screen.dart | 6 ++---- .../littlelight/objectives.service.dart | 4 ++-- .../item_sockets/details_item_mods.widget.dart | 18 ++++++++++++++++-- .../item_details_socket_details.widget.dart | 5 +++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/lib/pages/objectives/objectives.screen.dart b/lib/pages/objectives/objectives.screen.dart index 86c4ff0a..53641090 100644 --- a/lib/pages/objectives/objectives.screen.dart +++ b/lib/pages/objectives/objectives.screen.dart @@ -126,7 +126,7 @@ class ObjectivesScreenState extends State with ProfileConsumer right: max(screenPadding.right, 4), bottom: max(screenPadding.bottom, 4), top: 4), - itemCount: items.length, + itemCount: objectives.length, gridDelegate: SliverSimpleGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 2 : 1), itemBuilder: (context, index) => Container(height: 132, child: getItem(context, index))); } @@ -135,9 +135,7 @@ class ObjectivesScreenState extends State with ProfileConsumer TrackedObjective objective = objectives[index]; switch (objective.type) { case TrackedObjectiveType.Triumph: - return RecordItemWidget( - key: Key("objective_${objective.hash}_objective_${objective.instanceId}_${objective.characterId}"), - hash: objective.hash); + return RecordItemWidget(key: Key("objective_${objective.hash}"), hash: objective.hash); case TrackedObjectiveType.Item: if (items[objective] != null) { diff --git a/lib/services/littlelight/objectives.service.dart b/lib/services/littlelight/objectives.service.dart index d27a8cc2..fcd641e3 100644 --- a/lib/services/littlelight/objectives.service.dart +++ b/lib/services/littlelight/objectives.service.dart @@ -24,8 +24,8 @@ class ObjectivesService with StorageConsumer, ProfileConsumer, ManifestConsumer await _loadTrackedObjectivesFromCache(); } var dirty = false; - var itemObjectives = _trackedObjectives!.where((o) => o.type == TrackedObjectiveType.Item).toList(); - var plugObjectives = _trackedObjectives!.where((o) => o.type == TrackedObjectiveType.Plug).toList(); + final itemObjectives = _trackedObjectives!.where((o) => o.type == TrackedObjectiveType.Item).toList(); + final plugObjectives = _trackedObjectives!.where((o) => o.type == TrackedObjectiveType.Plug).toList(); for (var o in itemObjectives) { DestinyItemComponent? item = await findObjectiveItem(o); if (item == null) { diff --git a/lib/widgets/item_sockets/details_item_mods.widget.dart b/lib/widgets/item_sockets/details_item_mods.widget.dart index a55bd825..5cac0115 100644 --- a/lib/widgets/item_sockets/details_item_mods.widget.dart +++ b/lib/widgets/item_sockets/details_item_mods.widget.dart @@ -9,6 +9,7 @@ import 'package:bungie_api/models/destiny_item_socket_category_definition.dart'; import 'package:bungie_api/models/destiny_socket_category_definition.dart'; import 'package:bungie_api/models/destiny_stat_definition.dart'; import 'package:flutter/material.dart'; +import 'package:little_light/core/theme/littlelight.theme.dart'; import 'package:little_light/utils/destiny_data.dart'; import 'package:little_light/utils/media_query_helper.dart'; import 'package:little_light/widgets/common/definition_provider.widget.dart'; @@ -204,6 +205,8 @@ class DetailsItemPerksWidgetState extends BaseI var canEquip = controller?.canEquip(socketIndex, plugItemHash); var selectedSocketIndex = controller.selectedSocketIndex; bool selected = selectedSocketIndex == socketIndex; + int selectedPlugForSocket = controller.socketSelectedPlugHash(socketIndex); + bool isSelectedForSocket = plugItemHash == selectedPlugForSocket; return Container( key: Key("item_mod_$plugItemHash"), child: AspectRatio( @@ -236,10 +239,21 @@ class DetailsItemPerksWidgetState extends BaseI child: Container( color: Colors.black.withOpacity(.5), ), - ) + ), + if (!isSelectedForSocket) + Positioned( + key: Key('selected_$selectedPlugForSocket'), + child: Container( + color: LittleLightTheme.of(context).onSurfaceLayers.layer3, + padding: EdgeInsets.all(1), + child: ManifestImageWidget(selectedPlugForSocket)), + bottom: 2, + right: 2, + width: 24, + height: 24) ]), onPressed: () { - controller.selectSocket(socketIndex, plugItemHash); + controller.selectSocket(socketIndex, selectedPlugForSocket); }, ))); } diff --git a/lib/widgets/item_sockets/item_details_socket_details.widget.dart b/lib/widgets/item_sockets/item_details_socket_details.widget.dart index 79e28f93..df68b0c4 100644 --- a/lib/widgets/item_sockets/item_details_socket_details.widget.dart +++ b/lib/widgets/item_sockets/item_details_socket_details.widget.dart @@ -179,9 +179,10 @@ class ItemDetailsSocketDetailsWidgetState extends BaseSocketDetailsWidgetState