-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make view selector only allow music views
* Disables non-music list options * If there are no music views, show an error message
- Loading branch information
Showing
3 changed files
with
97 additions
and
49 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
lib/components/ViewSelector/no_music_libraries_message.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
class NoMusicLibrariesMessage extends StatelessWidget { | ||
const NoMusicLibrariesMessage({ | ||
super.key, | ||
this.onRefresh, | ||
}); | ||
|
||
final VoidCallback? onRefresh; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: Scrollbar( | ||
child: SingleChildScrollView( | ||
child: Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Column( | ||
children: [ | ||
Text( | ||
AppLocalizations.of(context)!.noMusicLibrariesTitle, | ||
style: Theme.of(context).textTheme.titleLarge, | ||
textAlign: TextAlign.center, | ||
), | ||
Text( | ||
AppLocalizations.of(context)!.noMusicLibrariesBody, | ||
textAlign: TextAlign.center, | ||
), | ||
ElevatedButton( | ||
onPressed: onRefresh, | ||
child: Text(AppLocalizations.of(context)!.refresh)) | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters