2020-03-14 04:14:24 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
2020-03-31 18:36:20 +02:00
|
|
|
import 'package:provider/provider.dart';
|
2020-03-14 04:14:24 +01:00
|
|
|
import 'package:app_settings/app_settings.dart';
|
|
|
|
import 'package:tsacdop/settings/downloads_manage.dart';
|
2020-03-31 18:36:20 +02:00
|
|
|
import 'package:tsacdop/class/settingstate.dart';
|
2020-03-14 04:14:24 +01:00
|
|
|
|
|
|
|
class StorageSetting extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-03-31 18:36:20 +02:00
|
|
|
var settings = Provider.of<SettingState>(context, listen: false);
|
2020-03-14 04:14:24 +01:00
|
|
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
|
|
|
value: SystemUiOverlayStyle(
|
2020-03-19 20:58:30 +01:00
|
|
|
statusBarIconBrightness: Theme.of(context).accentColorBrightness,
|
|
|
|
systemNavigationBarColor: Theme.of(context).primaryColor,
|
|
|
|
systemNavigationBarIconBrightness:
|
|
|
|
Theme.of(context).accentColorBrightness,
|
|
|
|
),
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('Storage'),
|
|
|
|
elevation: 0,
|
|
|
|
backgroundColor: Theme.of(context).primaryColor,
|
|
|
|
),
|
|
|
|
body: SafeArea(
|
|
|
|
child: Column(
|
2020-03-14 04:14:24 +01:00
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
2020-03-31 18:36:20 +02:00
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 30.0,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 80),
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text('Network',
|
|
|
|
style: Theme.of(context)
|
|
|
|
.textTheme
|
|
|
|
.bodyText1
|
|
|
|
.copyWith(color: Theme.of(context).accentColor)),
|
|
|
|
),
|
|
|
|
ListView(
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
children: <Widget>[
|
|
|
|
ListTile(
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => DownloadsManage())),
|
|
|
|
contentPadding:
|
2020-04-22 20:10:57 +02:00
|
|
|
EdgeInsets.only(left: 80.0, right: 25, bottom: 10),
|
2020-03-31 18:36:20 +02:00
|
|
|
title: Text('Ask before using cellular data'),
|
|
|
|
subtitle: Text(
|
2020-04-02 11:52:26 +02:00
|
|
|
'Ask to confirm when using cellular data to download episodes.'),
|
2020-03-31 18:36:20 +02:00
|
|
|
trailing: Selector<SettingState, bool>(
|
|
|
|
selector: (_, settings) =>
|
|
|
|
settings.downloadUsingData,
|
|
|
|
builder: (_, data, __) {
|
|
|
|
return Switch(
|
|
|
|
value: data,
|
|
|
|
onChanged: (value) =>
|
|
|
|
settings.downloadUsingData = value,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(height: 2),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
]),
|
2020-03-14 04:14:24 +01:00
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 30.0,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 80),
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text('Storage',
|
|
|
|
style: Theme.of(context)
|
|
|
|
.textTheme
|
|
|
|
.bodyText1
|
|
|
|
.copyWith(color: Theme.of(context).accentColor)),
|
|
|
|
),
|
|
|
|
ListView(
|
2020-03-21 17:14:10 +01:00
|
|
|
physics: const BouncingScrollPhysics(),
|
2020-03-14 04:14:24 +01:00
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
children: <Widget>[
|
|
|
|
ListTile(
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => DownloadsManage())),
|
|
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 80.0),
|
|
|
|
title: Text('Downloads'),
|
|
|
|
subtitle: Text('Manage doanloaded audio files'),
|
|
|
|
),
|
|
|
|
Divider(height: 2),
|
|
|
|
ListTile(
|
|
|
|
onTap: () => AppSettings.openAppSettings(),
|
|
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 80.0),
|
|
|
|
// leading: Icon(Icons.colorize),
|
|
|
|
title: Text('Cache'),
|
|
|
|
subtitle: Text('Audio cache'),
|
|
|
|
),
|
|
|
|
Divider(height: 2),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|