Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
proninyaroslav committed Dec 19, 2024
1 parent 0ff15f4 commit 24cc118
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lib/ui/components/search_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class _SearchBarState extends State<SearchBar> {
),
),
color: AppTheme.isDark(context)
? colorScheme.onSurface.withOpacity(0.24)
: colorScheme.onPrimary.withOpacity(0.7),
? colorScheme.onSurface.withValues(alpha: 0.24)
: colorScheme.onPrimary.withValues(alpha: 0.7),
child: Focus(
focusNode: _focusNode,
onFocusChange: (hasFocus) {
Expand Down
12 changes: 1 addition & 11 deletions lib/ui/components/side_backdrop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,6 @@ class SideBackdropScaffoldState extends State<SideBackdropScaffold>
return false;
}
return true;
default:
throw UnsupportedError('Unknown side: $_currentActiveSide');
}
}

Expand Down Expand Up @@ -588,7 +586,7 @@ class SideBackdropScaffoldState extends State<SideBackdropScaffold>
behavior: HitTestBehavior.opaque,
child: Container(
color: widget.inactiveOverlayColor
.withOpacity(widget.inactiveOverlayOpacity),
.withValues(alpha: widget.inactiveOverlayOpacity),
),
),
),
Expand All @@ -603,8 +601,6 @@ class SideBackdropScaffoldState extends State<SideBackdropScaffold>
case _SideType.end:
flingEndSide();
break;
default:
throw UnsupportedError('Unknown side: $_currentActiveSide');
}
}

Expand All @@ -614,8 +610,6 @@ class SideBackdropScaffoldState extends State<SideBackdropScaffold>
return startSideController;
case _SideType.end:
return endSideController;
default:
throw UnsupportedError('Unknown side: $_currentActiveSide');
}
}

Expand All @@ -635,8 +629,6 @@ class SideBackdropScaffoldState extends State<SideBackdropScaffold>
sideWidth = _endSideWidth;
miniSideWidth = _miniEndSideWidth;
break;
default:
throw UnsupportedError('Unknown side: $_currentActiveSide');
}

if (widget.stickyFrontLayer &&
Expand Down Expand Up @@ -681,8 +673,6 @@ class SideBackdropScaffoldState extends State<SideBackdropScaffold>
begin = leftToRight;
}
break;
default:
throw UnsupportedError('Unknown side: $_currentActiveSide');
}

return RelativeRectTween(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/components/toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Toast {
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
color: Theme.of(context).cardColor.withOpacity(0.8),
color: Theme.of(context).cardColor.withValues(alpha: 0.8),
),
padding: const EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 16.0),
child: Text(text),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/home/components/navigation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ class _NavigationDrawerItem extends StatelessWidget {
if (AppTheme.isDark(context)) {
return AppTheme.itemSelectableColor(context);
} else {
return Theme.of(context).colorScheme.onPrimary.withOpacity(0.24);
return Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.24);
}
} else {
return Colors.transparent;
Expand All @@ -1257,7 +1257,7 @@ class _NavigationDrawerItem extends StatelessWidget {

Color _getItemTintColor(BuildContext context) => isSelected
? _foregroundColor(context)
: _foregroundColor(context).withOpacity(0.54);
: _foregroundColor(context).withValues(alpha: 0.54);
}

class _BackdropAutoFling extends StatefulWidget {
Expand Down
18 changes: 9 additions & 9 deletions lib/ui/parcels/components/parcels_filter_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,14 @@ class _FilterSwitchListTile extends StatelessWidget {
value: value,
secondary: IconTheme(
data: iconTheme.copyWith(
color: iconTheme.color!.withOpacity(0.87),
color: iconTheme.color!.withValues(alpha: 0.87),
),
child: icon,
),
title: Text(
title,
style: _getTextTheme(context).titleMedium!.copyWith(
color: iconTheme.color!.withOpacity(0.87),
color: iconTheme.color!.withValues(alpha: 0.87),
),
),
onChanged: onChanged,
Expand Down Expand Up @@ -410,14 +410,14 @@ class _FilterDropdownListTile<T> extends StatelessWidget {
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
leading: IconTheme(
data: iconTheme.copyWith(
color: iconTheme.color!.withOpacity(0.87),
color: iconTheme.color!.withValues(alpha: 0.87),
),
child: icon,
),
title: Text(
title,
style: textTheme.titleMedium!.copyWith(
color: iconTheme.color!.withOpacity(0.87),
color: iconTheme.color!.withValues(alpha: 0.87),
),
),
),
Expand Down Expand Up @@ -541,14 +541,14 @@ class _SortListItem extends StatelessWidget {
selectedTileColor: _getItemSelectableColor(context),
secondary: IconTheme(
data: iconTheme.copyWith(
color: iconTheme.color!.withOpacity(0.87),
color: iconTheme.color!.withValues(alpha: 0.87),
),
child: icon,
),
title: Text(
title,
style: textTheme.titleMedium!.copyWith(
color: iconTheme.color!.withOpacity(0.87),
color: iconTheme.color!.withValues(alpha: 0.87),
),
),
onChanged: (dynamic _) => onSelected(),
Expand All @@ -575,16 +575,16 @@ IconThemeData _getIconTheme(BuildContext context) {

Color _getForegroundColor(BuildContext context) {
if (AppTheme.isDark(context)) {
return Theme.of(context).colorScheme.onSurface.withOpacity(0.24);
return Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.24);
} else {
return Theme.of(context).colorScheme.onPrimary.withOpacity(0.24);
return Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.24);
}
}

Color _getItemSelectableColor(BuildContext context) {
if (AppTheme.isDark(context)) {
return AppTheme.itemSelectableColor(context);
} else {
return Theme.of(context).colorScheme.onPrimary.withOpacity(0.24);
return Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.24);
}
}
2 changes: 1 addition & 1 deletion lib/ui/parcels/parcels_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class _TabBar extends StatelessWidget {
controller: tabController,
tabs: tabs,
indicator: BoxDecoration(
color: AppTheme.textPrimaryColorLight(context).withOpacity(0.2),
color: AppTheme.textPrimaryColorLight(context).withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(32.0),
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class AppTheme {
}

static Color itemSelectableColor(BuildContext context) {
return AppTheme.textPrimaryColorLight(context).withOpacity(0.24);
return AppTheme.textPrimaryColorLight(context).withValues(alpha: 0.24);
}

static AppPalette palette(BuildContext context) {
Expand Down

0 comments on commit 24cc118

Please sign in to comment.