Skip to content

Commit

Permalink
feat: use platform checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 3, 2022
1 parent fb9c0e4 commit 2211505
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/components/Playlist/PlaylistCreateDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
],
Expand Down
8 changes: 3 additions & 5 deletions lib/components/Shared/TrackTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -181,7 +179,7 @@ class TrackTile extends HookConsumerWidget {
child: Row(
children: [
if (showCheck)
Checkbox(
PlatformCheckbox(
value: isChecked,
onChanged: (s) => onCheckChange?.call(s),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Shared/TracksTableView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class SpotubeState extends ConsumerState<Spotube> with WidgetsBindingObserver {
};
}, []);

platform = TargetPlatform.macOS;
platform = TargetPlatform.android;

return PlatformApp.router(
routeInformationParser: router.routeInformationParser,
Expand Down

0 comments on commit 2211505

Please sign in to comment.