feat: use platform checkbox

This commit is contained in:
Kingkor Roy Tirtho 2022-11-03 20:11:20 +06:00
parent fb9c0e44be
commit 2211505d71
4 changed files with 9 additions and 11 deletions

View File

@ -75,15 +75,15 @@ class PlaylistCreateDialog extends HookConsumerWidget {
maxLines: 5,
),
const SizedBox(height: 10),
CheckboxListTile(
PlatformCheckbox(
value: public.value,
title: const PlatformText("Public"),
label: const PlatformText("Public"),
onChanged: (val) => public.value = val ?? false,
),
const SizedBox(height: 10),
CheckboxListTile(
PlatformCheckbox(
value: collaborative.value,
title: const PlatformText("Collaborative"),
label: const PlatformText("Collaborative"),
onChanged: (val) => collaborative.value = val ?? false,
),
],

View File

@ -137,10 +137,8 @@ class TrackTile extends HookConsumerWidget {
itemCount: snapshot.data!.length,
itemBuilder: (context, index) {
final playlist = snapshot.data!.elementAt(index);
return CheckboxListTile(
title: PlatformText(playlist.name!),
controlAffinity:
ListTileControlAffinity.leading,
return PlatformCheckbox(
label: PlatformText(playlist.name!),
value:
playlistsCheck.value[playlist.id] ?? false,
onChanged: (val) {
@ -181,7 +179,7 @@ class TrackTile extends HookConsumerWidget {
child: Row(
children: [
if (showCheck)
Checkbox(
PlatformCheckbox(
value: isChecked,
onChanged: (s) => onCheckChange?.call(s),
)

View File

@ -68,7 +68,7 @@ class TracksTableView extends HookConsumerWidget {
if (heading != null) heading!,
Row(
children: [
Checkbox(
PlatformCheckbox(
value: selected.value.length == sortedTracks.length,
onChanged: (checked) {
if (!showCheck.value) showCheck.value = true;

View File

@ -199,7 +199,7 @@ class SpotubeState extends ConsumerState<Spotube> with WidgetsBindingObserver {
};
}, []);
platform = TargetPlatform.macOS;
platform = TargetPlatform.android;
return PlatformApp.router(
routeInformationParser: router.routeInformationParser,