Use the storage access framework

Everything related to file system access has been rewritten to make use
of the storage access framework. This means that the
WRITE_EXTERNAL_STORAGE is no longer needed. Because of that, the
dependency on permission_handler could be dropped and all code related
to permission handling has been removed. To be able to open a whole
document tree, the minSdkVersion was bumped to 21. Finally the file
selector was rewritten using custom platform dependent code.
This commit is contained in:
Elias Projahn 2020-04-11 21:59:23 +02:00
parent febcf29cf1
commit e9f0bd03e7
9 changed files with 204 additions and 281 deletions

View file

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import '../backend.dart';
import '../selectors/files.dart';
class SettingsScreen extends StatelessWidget {
@override
@ -17,21 +16,9 @@ class SettingsScreen extends StatelessWidget {
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);
}
subtitle: Text(backend.musicLibraryUri),
onTap: () {
backend.chooseMusicLibraryUri();
},
),
],