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; double.tryParse(controller.text.replaceAll("ms", "")) ?? 0;
return PlatformAlertDialog( return PlatformAlertDialog(
icon: Sidebar.brandLogo(), macosAppIcon: Sidebar.brandLogo(),
title: const Center(child: Text("Adjust Lyrics Delay")), title: const Center(child: Text("Adjust Lyrics Delay")),
secondaryActions: [ secondaryActions: [
PlatformFilledButton( PlatformFilledButton(
@ -41,36 +41,39 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
}, },
) )
], ],
content: Row( content: SizedBox(
mainAxisSize: MainAxisSize.min, height: 100,
children: [ child: Row(
PlatformIconButton( mainAxisSize: MainAxisSize.min,
icon: const Icon(Icons.remove_rounded), children: [
onPressed: () { PlatformIconButton(
controller.text = "${getValue() - 25}ms"; 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(),
),
);
}, },
), ),
), Flexible(
PlatformIconButton( child: PlatformTextField(
icon: const Icon(Icons.add_rounded), keyboardType: TextInputType.number,
onPressed: () { controller: controller,
controller.text = "${getValue() + 25}ms"; 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( Positioned.fill(
child: Align( child: Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: PlatformIconButton( child: Padding(
tooltip: "Lyrics Delay", padding: const EdgeInsets.all(8.0),
icon: const Icon(Icons.av_timer_rounded), child: PlatformFilledButton(
onPressed: () async { child: const Icon(
final delay = await showPlatformAlertDialog( Icons.av_timer_rounded,
context, size: 16,
builder: (context) => const LyricDelayAdjustDialog(), ),
); onPressed: () async {
if (delay != null) { final delay = await showPlatformAlertDialog(
ref.read(lyricDelayState.notifier).state = delay; 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); final collaborative = useState(false);
return PlatformAlertDialog( return PlatformAlertDialog(
icon: Sidebar.brandLogo(), macosAppIcon: Sidebar.brandLogo(),
title: const Text("Create a Playlist"), title: const Text("Create a Playlist"),
primaryActions: [ primaryActions: [
PlatformFilledButton( PlatformFilledButton(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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