2020-03-21 17:46:23 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import '../backend.dart';
|
2020-03-28 10:24:32 +01:00
|
|
|
import '../selectors/files.dart';
|
2020-03-21 17:46:23 +01:00
|
|
|
|
|
|
|
|
class SettingsScreen extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final backend = Backend.of(context);
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
title: Text('Settings'),
|
|
|
|
|
),
|
|
|
|
|
body: ListView(
|
|
|
|
|
children: <Widget>[
|
2020-03-28 10:24:32 +01:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
2020-03-21 17:46:23 +01:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|