mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
Settings: Add music library path setting
This commit is contained in:
parent
f0644e4058
commit
cbbc5bc7c6
1 changed files with 21 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../backend.dart';
|
import '../backend.dart';
|
||||||
|
import '../selectors/files.dart';
|
||||||
|
|
||||||
class SettingsScreen extends StatelessWidget {
|
class SettingsScreen extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
|
|
@ -13,6 +14,26 @@ class SettingsScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.library_music),
|
||||||
|
title: Text('Music library path'),
|
||||||
|
subtitle: Text(backend.musicLibraryPath),
|
||||||
|
onTap: () async {
|
||||||
|
final path = await Navigator.push<String>(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => FilesSelector(
|
||||||
|
mode: FilesSelectorMode.directory,
|
||||||
|
),
|
||||||
|
fullscreenDialog: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (path != null) {
|
||||||
|
backend.setMusicLibraryPath(path);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue