fix: dialog logo in android, lyrics visible timer adjust button

This commit is contained in:
Kingkor Roy Tirtho 2022-11-24 11:06:14 +06:00
parent be56ad4477
commit 3c6803bb3f
9 changed files with 57 additions and 48 deletions

View File

@ -18,7 +18,7 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
double.tryParse(controller.text.replaceAll("ms", "")) ?? 0;
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: const Center(child: Text("Adjust Lyrics Delay")),
secondaryActions: [
PlatformFilledButton(
@ -41,36 +41,39 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
},
)
],
content: Row(
mainAxisSize: MainAxisSize.min,
children: [
PlatformIconButton(
icon: const Icon(Icons.remove_rounded),
onPressed: () {
controller.text = "${getValue() - 25}ms";
},
),
Flexible(
child: PlatformTextField(
keyboardType: TextInputType.number,
controller: controller,
placeholder: "Delay in milliseconds",
onSubmitted: (_) {
Navigator.of(context).pop(
Duration(
milliseconds: getValue().toInt(),
),
);
content: SizedBox(
height: 100,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
PlatformIconButton(
icon: const Icon(Icons.remove_rounded),
onPressed: () {
controller.text = "${getValue() - 25}ms";
},
),
),
PlatformIconButton(
icon: const Icon(Icons.add_rounded),
onPressed: () {
controller.text = "${getValue() + 25}ms";
},
),
],
Flexible(
child: PlatformTextField(
keyboardType: TextInputType.number,
controller: controller,
placeholder: "Delay in milliseconds",
onSubmitted: (_) {
Navigator.of(context).pop(
Duration(
milliseconds: getValue().toInt(),
),
);
},
),
),
PlatformIconButton(
icon: const Icon(Icons.add_rounded),
onPressed: () {
controller.text = "${getValue() + 25}ms";
},
),
],
),
),
);
}

View File

@ -87,18 +87,24 @@ class SyncedLyrics extends HookConsumerWidget {
Positioned.fill(
child: Align(
alignment: Alignment.centerRight,
child: PlatformIconButton(
tooltip: "Lyrics Delay",
icon: const Icon(Icons.av_timer_rounded),
onPressed: () async {
final delay = await showPlatformAlertDialog(
context,
builder: (context) => const LyricDelayAdjustDialog(),
);
if (delay != null) {
ref.read(lyricDelayState.notifier).state = delay;
}
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: PlatformFilledButton(
child: const Icon(
Icons.av_timer_rounded,
size: 16,
),
onPressed: () async {
final delay = await showPlatformAlertDialog(
context,
builder: (context) =>
const LyricDelayAdjustDialog(),
);
if (delay != null) {
ref.read(lyricDelayState.notifier).state = delay;
}
},
),
),
),
),

View File

@ -26,7 +26,7 @@ class PlaylistCreateDialog extends HookConsumerWidget {
final collaborative = useState(false);
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: const Text("Create a Playlist"),
primaryActions: [
PlatformFilledButton(

View File

@ -68,7 +68,7 @@ class ColorSchemePickerDialog extends HookConsumerWidget {
).key);
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: Text("Pick ${schemeType.name} color scheme"),
primaryActions: [
PlatformFilledButton(

View File

@ -41,7 +41,7 @@ class AdaptiveListTile extends HookWidget {
builder: (context) {
return StatefulBuilder(builder: (context, update) {
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: title != null
? Row(
crossAxisAlignment: CrossAxisAlignment.center,

View File

@ -9,7 +9,7 @@ class DownloadConfirmationDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: Padding(
padding: const EdgeInsets.all(15),
child: Row(

View File

@ -16,7 +16,7 @@ class ReplaceDownloadedFileDialog extends ConsumerWidget {
final groupValue = ref.watch(replaceDownloadedFileState);
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: Text("Track ${track.name} Already Exists"),
content: Column(
mainAxisSize: MainAxisSize.min,

View File

@ -96,7 +96,7 @@ class TrackTile extends HookConsumerWidget {
return HookBuilder(builder: (context) {
final playlistsCheck = useState(<String, bool>{});
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: PlatformText(
"Add `${track.value.name}` to following Playlists",
style: const TextStyle(

View File

@ -57,7 +57,7 @@ void useUpdateChecker(WidgetRef ref) {
const url =
"https://spotube.netlify.app/other-downloads/stable-downloads";
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: const PlatformText("Spotube has an update"),
primaryActions: [
PlatformFilledButton(