mirror of
https://github.com/austinried/subtracks.git
synced 2026-03-28 23:32:42 +01:00
chore: upgrade to Flutter 3.24.5
At the time of writing the latest Flutter version.
This commit is contained in:
@@ -25,7 +25,7 @@ Future<T?> showContextMenu<T>({
|
||||
required WidgetBuilder builder,
|
||||
}) {
|
||||
return showModalBottomSheet<T>(
|
||||
backgroundColor: ref.read(baseThemeProvider).theme.colorScheme.background,
|
||||
backgroundColor: ref.read(baseThemeProvider).theme.colorScheme.surface,
|
||||
useRootNavigator: true,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
|
||||
@@ -112,9 +112,9 @@ List<DownloadAction> useListDownloadActions({
|
||||
DownloadAction cancel() {
|
||||
return DownloadAction(
|
||||
type: DownloadActionType.cancel,
|
||||
iconBuilder: (context) => Stack(
|
||||
iconBuilder: (context) => const Stack(
|
||||
alignment: Alignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
Icon(Icons.cancel_rounded),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
|
||||
@@ -213,7 +213,7 @@ class CardClip extends StatelessWidget {
|
||||
final cardShape = Theme.of(context).cardTheme.shape;
|
||||
return ClipRRect(
|
||||
borderRadius:
|
||||
cardShape is RoundedRectangleBorder ? cardShape.borderRadius : null,
|
||||
cardShape is RoundedRectangleBorder ? cardShape.borderRadius : BorderRadius.zero,
|
||||
child: !square
|
||||
? child
|
||||
: AspectRatio(
|
||||
|
||||
@@ -127,6 +127,7 @@ class SyncAllRefresh extends HookConsumerWidget {
|
||||
try {
|
||||
await ref.read(syncServiceProvider.notifier).syncAll();
|
||||
} catch (e) {
|
||||
if (!context.mounted) return;
|
||||
showErrorSnackbar(context, e.toString());
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30,13 +30,13 @@ class NowPlayingBar extends HookConsumerWidget {
|
||||
elevation: 3,
|
||||
color: colors?.darkBackground,
|
||||
// surfaceTintColor: theme?.colorScheme.background,
|
||||
child: Column(
|
||||
child: const Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 70,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: const [
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: _ArtImage(),
|
||||
@@ -54,7 +54,7 @@ class NowPlayingBar extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const _ProgressBar(),
|
||||
_ProgressBar(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -173,7 +173,7 @@ class PlayPauseButton extends HookConsumerWidget {
|
||||
width: size / 3,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: size / 16,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -195,7 +195,7 @@ class PlayPauseButton extends HookConsumerWidget {
|
||||
}
|
||||
},
|
||||
icon: icon,
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,13 +111,13 @@ class OfflineIndicator extends HookConsumerWidget {
|
||||
),
|
||||
child: FilledButton.tonal(
|
||||
style: const ButtonStyle(
|
||||
padding: MaterialStatePropertyAll<EdgeInsetsGeometry>(
|
||||
padding: WidgetStatePropertyAll<EdgeInsetsGeometry>(
|
||||
EdgeInsets.zero,
|
||||
),
|
||||
fixedSize: MaterialStatePropertyAll<Size>(
|
||||
fixedSize: WidgetStatePropertyAll<Size>(
|
||||
Size(42, 42),
|
||||
),
|
||||
minimumSize: MaterialStatePropertyAll<Size>(
|
||||
minimumSize: WidgetStatePropertyAll<Size>(
|
||||
Size(42, 42),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -55,13 +55,13 @@ class NowPlayingPage extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
body: const Stack(
|
||||
children: [
|
||||
const MediaItemGradient(),
|
||||
MediaItemGradient(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
child: Column(
|
||||
children: const [
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -229,8 +229,8 @@ class _Progress extends HookConsumerWidget {
|
||||
value: changing.value ? changeValue.value : position.toDouble(),
|
||||
min: 0,
|
||||
max: max(duration.toDouble(), position.toDouble()),
|
||||
thumbColor: colors?.theme.colorScheme.onBackground,
|
||||
activeColor: colors?.theme.colorScheme.onBackground,
|
||||
thumbColor: colors?.theme.colorScheme.surface,
|
||||
activeColor: colors?.theme.colorScheme.surface,
|
||||
inactiveColor: colors?.theme.colorScheme.surface,
|
||||
onChanged: (value) {
|
||||
changeValue.value = value;
|
||||
@@ -354,7 +354,7 @@ class _Controls extends HookConsumerWidget {
|
||||
final audio = ref.watch(audioControlProvider);
|
||||
|
||||
return IconTheme(
|
||||
data: IconThemeData(color: base.theme.colorScheme.onBackground),
|
||||
data: IconThemeData(color: base.theme.colorScheme.surface),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
|
||||
@@ -191,7 +191,7 @@ class _ShareLogsButton extends StatelessWidget {
|
||||
final files = await logFiles();
|
||||
if (files.isEmpty) return;
|
||||
|
||||
// ignore: use_build_context_synchronously
|
||||
if (!context.mounted) return;
|
||||
final value = await showDialog<String>(
|
||||
context: context,
|
||||
builder: (context) => MultipleChoiceDialog<String>(
|
||||
|
||||
@@ -76,8 +76,8 @@ class SourcePage extends HookConsumerWidget {
|
||||
onChanged: (value) => forcePlaintextPassword.value = value,
|
||||
);
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async => !isSaving.value && !isDeleting.value,
|
||||
return PopScope(
|
||||
canPop: !isSaving.value && !isDeleting.value,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(),
|
||||
floatingActionButton: Row(
|
||||
@@ -164,6 +164,7 @@ class SourcePage extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
} catch (e, st) {
|
||||
if (!context.mounted) return;
|
||||
showErrorSnackbar(context, e.toString());
|
||||
log.severe('Saving source', e, st);
|
||||
error = true;
|
||||
|
||||
@@ -534,7 +534,7 @@ class DownloadService extends _$DownloadService {
|
||||
|
||||
_port.asyncMap((dynamic data) async {
|
||||
final taskId = (data as List<dynamic>)[0] as String;
|
||||
final status = DownloadTaskStatus(data[1] as int);
|
||||
final status = DownloadTaskStatus.fromInt(data[1] as int);
|
||||
final progress = data[2] as int;
|
||||
|
||||
var download = state.downloads.firstWhereOrNull(
|
||||
@@ -579,11 +579,11 @@ class DownloadService extends _$DownloadService {
|
||||
@pragma('vm:entry-point')
|
||||
static void downloadCallback(
|
||||
String id,
|
||||
DownloadTaskStatus status,
|
||||
int status,
|
||||
int progress,
|
||||
) {
|
||||
IsolateNameServer.lookupPortByName('downloader_send_port')?.send(
|
||||
[id, status.value, progress],
|
||||
[id, status, progress],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ class SubsonicSource implements MusicSource {
|
||||
return Uri.tryParse(res.xml
|
||||
.getElement('artistInfo2')
|
||||
?.getElement(thumbnail ? 'smallImageUrl' : 'largeImageUrl')
|
||||
?.text ??
|
||||
?.value ??
|
||||
'');
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,6 @@ ColorTheme _colorTheme(_ColorThemeRef ref, Palette palette) {
|
||||
final colorScheme = ColorScheme.fromSeed(
|
||||
brightness: Brightness.dark,
|
||||
seedColor: background?.color ?? Colors.purple[800]!,
|
||||
background: background?.color,
|
||||
primaryContainer: primary?.color,
|
||||
onPrimaryContainer: primary?.bodyTextColor,
|
||||
secondaryContainer: secondary?.color,
|
||||
@@ -96,8 +95,8 @@ ColorTheme _colorTheme(_ColorThemeRef ref, Palette palette) {
|
||||
surfaceTint: vibrant?.color,
|
||||
);
|
||||
|
||||
final hsv = HSVColor.fromColor(colorScheme.background);
|
||||
final hsl = HSLColor.fromColor(colorScheme.background);
|
||||
final hsv = HSVColor.fromColor(colorScheme.surface);
|
||||
final hsl = HSLColor.fromColor(colorScheme.surface);
|
||||
|
||||
return base.copyWith(
|
||||
theme: ThemeData(
|
||||
@@ -106,7 +105,7 @@ ColorTheme _colorTheme(_ColorThemeRef ref, Palette palette) {
|
||||
brightness: base.theme.brightness,
|
||||
cardTheme: base.theme.cardTheme,
|
||||
),
|
||||
gradientHigh: colorScheme.background,
|
||||
gradientHigh: colorScheme.surface,
|
||||
darkBackground: hsv.withValue(kDarkBackgroundValue).toColor(),
|
||||
darkerBackground: hsl.withLightness(kDarkerBackgroundLightness).toColor(),
|
||||
onDarkerBackground:
|
||||
@@ -128,13 +127,13 @@ ColorTheme baseTheme(BaseThemeRef ref) {
|
||||
),
|
||||
);
|
||||
|
||||
final hsv = HSVColor.fromColor(theme.colorScheme.background);
|
||||
final hsl = HSLColor.fromColor(theme.colorScheme.background);
|
||||
final hsv = HSVColor.fromColor(theme.colorScheme.surface);
|
||||
final hsl = HSLColor.fromColor(theme.colorScheme.surface);
|
||||
|
||||
return ColorTheme(
|
||||
theme: theme,
|
||||
gradientHigh: theme.colorScheme.background,
|
||||
gradientLow: HSLColor.fromColor(theme.colorScheme.background)
|
||||
gradientHigh: theme.colorScheme.surface,
|
||||
gradientLow: HSLColor.fromColor(theme.colorScheme.surface)
|
||||
.withLightness(0.06)
|
||||
.toColor(),
|
||||
darkBackground: hsv.withValue(kDarkBackgroundValue).toColor(),
|
||||
|
||||
Reference in New Issue
Block a user