Skip to content

Commit

Permalink
Merge pull request #153 from LittleLightForDestiny/quickfixes
Browse files Browse the repository at this point in the history
warning fixes
  • Loading branch information
joaopmarquesini authored Feb 17, 2022
2 parents 05a9825 + a78eeef commit 944282b
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 235 deletions.
4 changes: 4 additions & 0 deletions lib/core/theme/littlelight.theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ class LittleLightThemeData {
onSurface: primaryLayers,
),
),
toggleButtonsTheme: ToggleButtonsThemeData(
selectedColor: primaryLayers.layer1,
color: surfaceLayers.layer2,
),
textTheme: _textTheme,
switchTheme: _switchTheme);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/languages/languages.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _LanguagesPageState extends State<LanguagesPage> with LanguageConsumer {
}

Widget buildLanguageItem(BuildContext context, LanguageInfo language) {
var color = Theme.of(context).colorScheme.secondaryVariant;
var color = Theme.of(context).colorScheme.secondaryContainer;
if (language.code == currentLanguage) {
color = Theme.of(context).colorScheme.secondary;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/objectives/objectives.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ObjectivesScreenState extends State<ObjectivesScreen> with ProfileConsumer
bottom: 8 + bottomPadding,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryVariant, borderRadius: BorderRadius.circular(18)),
color: Theme.of(context).colorScheme.secondaryContainer, borderRadius: BorderRadius.circular(18)),
width: 36,
height: 36,
child: RefreshButtonWidget(),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings/about.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class _AboutScreenState extends State<AboutScreen> with StorageConsumer, Languag
.map((l) => l.name)
.join("/"));
return Container(
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
padding: EdgeInsets.all(4),
child: Row(
children: flags + [Container(width: 4), languageNames],
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/settings/accounts.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _AccountsScreenState extends State<AccountsScreen> with AuthConsumer {
Widget buildBottomBar(BuildContext context) {
var bottomPadding = MediaQuery.of(context).padding.bottom;
return Container(
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
padding: EdgeInsets.all(8).copyWith(bottom: bottomPadding + 8),
child: ElevatedButton(
onPressed: () {
Expand All @@ -83,7 +83,8 @@ class _AccountsScreenState extends State<AccountsScreen> with AuthConsumer {
return Container(
margin: EdgeInsets.symmetric(vertical: 4),
height: 140,
decoration: BoxDecoration(border: Border.all(width: 1, color: Theme.of(context).colorScheme.secondaryVariant)),
decoration:
BoxDecoration(border: Border.all(width: 1, color: Theme.of(context).colorScheme.secondaryContainer)),
child: Stack(
children: <Widget>[
Positioned.fill(
Expand Down
7 changes: 4 additions & 3 deletions lib/pages/settings/settings.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ class _SettingsPageState extends State<SettingsPage> with UserSettingsConsumer,
});
},
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
));
}

Expand Down Expand Up @@ -378,7 +379,7 @@ class _SettingsPageState extends State<SettingsPage> with UserSettingsConsumer,
child: Container(
color: parameter.active
? Theme.of(context).colorScheme.secondary
: Theme.of(context).colorScheme.secondaryVariant,
: Theme.of(context).colorScheme.secondaryContainer,
child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
buildHandle(context, index),
Container(width: 8),
Expand Down Expand Up @@ -409,8 +410,8 @@ class _SettingsPageState extends State<SettingsPage> with UserSettingsConsumer,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: selected
? LittleLightTheme.of(context).primaryLayers
: LittleLightTheme.of(context).surfaceLayers.layer2,
? Theme.of(context).toggleButtonsTheme.selectedColor
: Theme.of(context).toggleButtonsTheme.color,
padding: EdgeInsets.all(0),
),
child: Icon(direction > 0 ? FontAwesomeIcons.chevronUp : FontAwesomeIcons.chevronDown, size: 14),
Expand Down
1 change: 1 addition & 0 deletions lib/services/littlelight/wishlists.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ extension on ParsedWishlistItem {
itemPlugs.addAll(build.tags);
});
});
return this;
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/services/storage/storage.base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ abstract class StorageBase<T> {
final directory = await getApplicationSupportDirectory();
return directory.path;
} catch (e) {}
return null;
}
}

Expand Down
8 changes: 4 additions & 4 deletions lib/utils/wishlists_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class WishlistsData {

case WishlistTag.Controller:
return BoxDecoration(
border: Border.all(color: Theme.of(context).colorScheme.secondaryVariant, width: 1),
border: Border.all(color: Theme.of(context).colorScheme.secondaryContainer, width: 1),
color: Theme.of(context).colorScheme.primary);

case WishlistTag.Mouse:
return BoxDecoration(
border: Border.all(color: Theme.of(context).colorScheme.primary, width: 1),
color: Theme.of(context).colorScheme.secondaryVariant);
color: Theme.of(context).colorScheme.secondaryContainer);
default:
return BoxDecoration(color: getBgColor(context, tag));
}
Expand All @@ -46,7 +46,7 @@ class WishlistsData {
return Colors.black;

case WishlistTag.Controller:
return Theme.of(context).colorScheme.secondaryVariant;
return Theme.of(context).colorScheme.secondaryContainer;

case WishlistTag.Mouse:
return Theme.of(context).colorScheme.primary;
Expand Down Expand Up @@ -117,7 +117,7 @@ class WishlistsData {
child: CenterIconWorkaround(
FontAwesomeIcons.gamepad,
size: size * .6,
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
));

case WishlistTag.Mouse:
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/common/generic_progress_bar.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class GenericProgressBarWidget extends StatelessWidget {
if (completed) return Container();
return Container(
margin: EdgeInsets.all(2),
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
alignment: Alignment.centerLeft,
child: FractionallySizedBox(
widthFactor: min(progress / total, 1),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/common/objective.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class ObjectiveWidgetState extends State<ObjectiveWidget> with LanguageConsumer,
if (isComplete) return Container();
return Container(
margin: EdgeInsets.all(2),
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
alignment: Alignment.centerLeft,
child: FractionallySizedBox(
widthFactor: max(0.01, min(progress / total, 1)),
Expand Down
205 changes: 0 additions & 205 deletions lib/widgets/common/perk_list_item.widget.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class QuickTransferDestinationItemWidget extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onSurface.withOpacity(.1),
border: Border.all(
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
width: 2,
)),
child: Center(
Expand Down
2 changes: 2 additions & 0 deletions lib/widgets/item_stats/base_item_stats.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class BaseItemStatsState<T extends BaseItemStatsWidget> extends BaseDestinyItemS
var selectedPlugHash = socketController.socketSelectedPlugHash(index);
DestinyInventoryItemDefinition selectedDef = plugDefinitions[selectedPlugHash];
def?.investmentStats?.forEach((stat) {
if (stat.isConditionallyActive) return;
StatValues values = map[stat.statTypeHash] ?? StatValues();
if (def.plug?.uiPlugLabel == 'masterwork') {
if (selectedDef == null) {
Expand All @@ -175,6 +176,7 @@ class BaseItemStatsState<T extends BaseItemStatsWidget> extends BaseDestinyItemS

if (selectedDef != null) {
selectedDef?.investmentStats?.forEach((stat) {
if (stat.isConditionallyActive) return;
StatValues values = map[stat.statTypeHash] ?? StatValues();
if (selectedDef.plug?.uiPlugLabel == 'masterwork') {
values.masterwork += stat.value;
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/loadouts/loadout_destinations.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LoadoutDestinationsWidgetState extends State<LoadoutDestinationsWidget>
Widget build(BuildContext context) {
var screenPadding = MediaQuery.of(context).padding;
return Container(
color: Theme.of(context).colorScheme.secondaryVariant,
color: Theme.of(context).colorScheme.secondaryContainer,
padding: EdgeInsets.only(left: max(screenPadding.left, 4), right: max(screenPadding.right, 4)),
child: Column(mainAxisSize: MainAxisSize.min, children: [
FreeSlotsSliderWidget(
Expand Down
Loading

0 comments on commit 944282b

Please sign in to comment.