Minot ui change.
This commit is contained in:
parent
1246057c80
commit
ea4ae2925c
|
@ -31,6 +31,7 @@ class MyHomePageDelegate extends SearchDelegate<int> {
|
|||
receiveTimeout: 10000,
|
||||
);
|
||||
var response = await Dio(options).get(url);
|
||||
print(response);
|
||||
return RssFeed.parse(response.data);
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
|
@ -330,18 +331,15 @@ class _RssResultState extends State<RssResult> {
|
|||
return Container(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
child: OutlineButton(
|
||||
highlightedBorderColor: context.accentColor,
|
||||
splashColor: context.accentColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100))),
|
||||
child: Text(context.s.loadMore),
|
||||
onPressed: () => setState(
|
||||
() => _loadItems += 10,
|
||||
),
|
||||
child: OutlineButton(
|
||||
highlightedBorderColor: context.accentColor,
|
||||
splashColor: context.accentColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100))),
|
||||
child: Text(context.s.loadMore),
|
||||
onPressed: () => setState(
|
||||
() => _loadItems += 10,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -439,33 +437,30 @@ class _SearchListState extends State<SearchList> {
|
|||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
|
||||
child: SizedBox(
|
||||
height: 30,
|
||||
child: OutlineButton(
|
||||
highlightedBorderColor: context.accentColor,
|
||||
splashColor: context.accentColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100))),
|
||||
child: _loading
|
||||
? SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
))
|
||||
: Text(context.s.loadMore),
|
||||
onPressed: () => _loading
|
||||
? null
|
||||
: setState(
|
||||
() {
|
||||
_loading = true;
|
||||
_nextOffset = _offset;
|
||||
_searchFuture =
|
||||
_getList(widget.query, _nextOffset);
|
||||
},
|
||||
),
|
||||
),
|
||||
child: OutlineButton(
|
||||
highlightedBorderColor: context.accentColor,
|
||||
splashColor: context.accentColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100))),
|
||||
child: _loading
|
||||
? SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
))
|
||||
: Text(context.s.loadMore),
|
||||
onPressed: () => _loading
|
||||
? null
|
||||
: setState(
|
||||
() {
|
||||
_loading = true;
|
||||
_nextOffset = _offset;
|
||||
_searchFuture =
|
||||
_getList(widget.query, _nextOffset);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -489,6 +484,7 @@ class _SearchListState extends State<SearchList> {
|
|||
builder: (context, constrants) => SearchResultDetail(
|
||||
_selectedPodcast,
|
||||
maxHeight: constrants.maxHeight,
|
||||
isSubscribed: _subscribed.contains(_selectedPodcast),
|
||||
onClose: (option) {
|
||||
setState(() => _selectedPodcast = null);
|
||||
},
|
||||
|
@ -613,6 +609,7 @@ class SearchResultDetail extends StatefulWidget {
|
|||
this.maxHeight,
|
||||
this.onSubscribe,
|
||||
this.episodeList,
|
||||
this.isSubscribed,
|
||||
Key key})
|
||||
: super(key: key);
|
||||
final OnlinePodcast onlinePodcast;
|
||||
|
@ -620,6 +617,7 @@ class SearchResultDetail extends StatefulWidget {
|
|||
final ValueChanged<OnlinePodcast> onSubscribe;
|
||||
final double maxHeight;
|
||||
final List<OnlineEpisode> episodeList;
|
||||
final bool isSubscribed;
|
||||
@override
|
||||
_SearchResultDetailState createState() => _SearchResultDetailState();
|
||||
}
|
||||
|
@ -654,9 +652,6 @@ class _SearchResultDetailState extends State<SearchResultDetail>
|
|||
|
||||
Future _searchFuture;
|
||||
|
||||
/// Subscribe indicator.
|
||||
bool _isSubscribed = false;
|
||||
|
||||
/// Episodes list load more.
|
||||
bool _loading = false;
|
||||
|
||||
|
@ -821,7 +816,7 @@ class _SearchResultDetailState extends State<SearchResultDetail>
|
|||
overflow: TextOverflow.fade,
|
||||
style: TextStyle(color: context.accentColor),
|
||||
),
|
||||
!_isSubscribed
|
||||
!widget.isSubscribed
|
||||
? OutlineButton(
|
||||
highlightedBorderColor:
|
||||
context.accentColor,
|
||||
|
@ -838,9 +833,6 @@ class _SearchResultDetailState extends State<SearchResultDetail>
|
|||
onPressed: () {
|
||||
subscribePodcast(
|
||||
widget.onlinePodcast);
|
||||
setState(() {
|
||||
_isSubscribed = true;
|
||||
});
|
||||
Fluttertoast.showToast(
|
||||
msg: s.podcastSubscribed,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
|
@ -971,7 +963,6 @@ class _SearchResultDetailState extends State<SearchResultDetail>
|
|||
top: 10.0, bottom: 20.0),
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
child: OutlineButton(
|
||||
highlightedBorderColor:
|
||||
context.accentColor,
|
||||
|
|
|
@ -112,7 +112,7 @@ class KeyValueStorage {
|
|||
Future<List<int>> getMenu() async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
if (prefs.getStringList(key) == null) {
|
||||
await prefs.setStringList(key, ['0', '1', '12', '13', '14']);
|
||||
await prefs.setStringList(key, ['0', '1', '2', '13', '14']);
|
||||
}
|
||||
var list = prefs.getStringList(key);
|
||||
return list.map(int.parse).toList();
|
||||
|
|
|
@ -123,7 +123,7 @@ class _LayoutSettingState extends State<LayoutSetting> {
|
|||
|
||||
Widget _setDefaultGridView(BuildContext context, {String text, String key}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: 80.0, right: 20, bottom: 10),
|
||||
padding: EdgeInsets.only(left: 70.0, right: 20, bottom: 10),
|
||||
child: context.width > 360
|
||||
? Row(
|
||||
children: [
|
||||
|
@ -186,7 +186,7 @@ class _LayoutSettingState extends State<LayoutSetting> {
|
|||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => PopupMenuSetting())),
|
||||
contentPadding: EdgeInsets.only(left: 80.0, right: 20),
|
||||
contentPadding: EdgeInsets.only(left: 70.0, right: 20),
|
||||
title: Text(s.settingsPopupMenu),
|
||||
subtitle: Text(s.settingsPopupMenuDes),
|
||||
),
|
||||
|
@ -206,7 +206,7 @@ class _LayoutSettingState extends State<LayoutSetting> {
|
|||
),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 80.0, right: 20, bottom: 10, top: 10),
|
||||
left: 70.0, right: 20, bottom: 10, top: 10),
|
||||
title: Text(s.settingsPlayerHeight),
|
||||
subtitle: Text(s.settingsPlayerHeightDes),
|
||||
trailing: Selector<AudioPlayerNotifier, PlayerHeight>(
|
||||
|
|
|
@ -281,8 +281,8 @@ class PlaySetting extends StatelessWidget {
|
|||
selector: (_, settings) => settings.autoPlay,
|
||||
builder: (_, data, __) => ListTile(
|
||||
onTap: () => settings.setAutoPlay = !data,
|
||||
contentPadding:
|
||||
EdgeInsets.only(left: 80.0, right: 20),
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 70.0, right: 20, bottom: 10),
|
||||
title: Text(s.settingsMenuAutoPlay),
|
||||
subtitle: Text(s.settingsAutoPlayDes),
|
||||
trailing: Transform.scale(
|
||||
|
@ -316,7 +316,7 @@ class PlaySetting extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 80.0, right: 20, bottom: 10, top: 10),
|
||||
left: 70.0, right: 20, bottom: 10, top: 10),
|
||||
title: Text(s.settingsFastForwardSec),
|
||||
subtitle: Text(s.settingsFastForwardSecDes),
|
||||
trailing: Selector<SettingState, int>(
|
||||
|
@ -340,7 +340,7 @@ class PlaySetting extends StatelessWidget {
|
|||
),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 80.0, right: 20, bottom: 10, top: 10),
|
||||
left: 70.0, right: 20, bottom: 10, top: 10),
|
||||
title: Text(s.settingsRewindSec),
|
||||
subtitle: Text(s.settingsRewindSecDes),
|
||||
trailing: Selector<SettingState, int>(
|
||||
|
@ -380,7 +380,7 @@ class PlaySetting extends StatelessWidget {
|
|||
scrollDirection: Axis.vertical,
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.only(left: 80.0, right: 20),
|
||||
contentPadding: EdgeInsets.only(left: 70.0, right: 20),
|
||||
title: Text(s.settingsSTDefaultTime),
|
||||
subtitle: Text(s.settingsSTDefautTimeDes),
|
||||
trailing: Selector<SettingState, int>(
|
||||
|
@ -401,13 +401,12 @@ class PlaySetting extends StatelessWidget {
|
|||
}).toList()),
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
Selector<SettingState, bool>(
|
||||
selector: (_, settings) => settings.autoSleepTimer,
|
||||
builder: (_, data, __) => ListTile(
|
||||
onTap: () => settings.setAutoSleepTimer = !data,
|
||||
contentPadding: const EdgeInsets.only(
|
||||
left: 80.0, right: 20.0, bottom: 10.0, top: 10.0),
|
||||
left: 70.0, right: 20.0, bottom: 10.0, top: 10.0),
|
||||
title: Text(s.settingsSTAuto),
|
||||
subtitle: Text(s.settingsSTAutoDes),
|
||||
trailing: Transform.scale(
|
||||
|
@ -421,7 +420,7 @@ class PlaySetting extends StatelessWidget {
|
|||
),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.only(
|
||||
left: 80.0, right: 20.0, bottom: 10.0, top: 10.0),
|
||||
left: 70.0, right: 20.0, bottom: 10.0, top: 10.0),
|
||||
title: Text(s.settingsSTMode),
|
||||
subtitle:
|
||||
context.width > 360 ? null : _modeWidget(context),
|
||||
|
@ -430,7 +429,7 @@ class PlaySetting extends StatelessWidget {
|
|||
: null),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
EdgeInsets.only(left: 80.0, right: 20),
|
||||
EdgeInsets.only(left: 70.0, right: 20),
|
||||
title: Text(s.schedule),
|
||||
subtitle: context.width > 360
|
||||
? null
|
||||
|
|
|
@ -131,7 +131,7 @@ class _StorageSettingState extends State<StorageSetting>
|
|||
return ListTile(
|
||||
onTap: () => settings.downloadUsingData = !data,
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 80.0, right: 25, bottom: 10, top: 10),
|
||||
left: 70.0, right: 25, bottom: 10, top: 10),
|
||||
title: Text(s.settingsNetworkCellular),
|
||||
subtitle: Text(s.settingsNetworkCellularDes),
|
||||
trailing: Transform.scale(
|
||||
|
@ -156,7 +156,7 @@ class _StorageSettingState extends State<StorageSetting>
|
|||
setState(() {});
|
||||
},
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 80.0, right: 25, bottom: 10, top: 10),
|
||||
left: 70.0, right: 25, bottom: 10, top: 10),
|
||||
title: Text(s.settingsNetworkCellularAuto),
|
||||
subtitle:
|
||||
Text(s.settingsNetworkCellularAutoDes),
|
||||
|
@ -203,7 +203,7 @@ class _StorageSettingState extends State<StorageSetting>
|
|||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DownloadsManage())),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 80.0),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 70.0),
|
||||
title: Text(s.download),
|
||||
subtitle: Text(s.settingsManageDownloadDes),
|
||||
),
|
||||
|
@ -214,7 +214,7 @@ class _StorageSettingState extends State<StorageSetting>
|
|||
builder: (context, snapshot) {
|
||||
return ListTile(
|
||||
contentPadding:
|
||||
EdgeInsets.only(left: 80.0, right: 20),
|
||||
EdgeInsets.only(left: 70.0, right: 20),
|
||||
title: Text(s.settingsAutoDelete),
|
||||
subtitle: Text(s.settingsAutoDeleteDes),
|
||||
trailing: MyDropdownButton(
|
||||
|
@ -240,7 +240,7 @@ class _StorageSettingState extends State<StorageSetting>
|
|||
),
|
||||
Divider(height: 2),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.only(left: 80.0, right: 25),
|
||||
contentPadding: EdgeInsets.only(left: 70.0, right: 25),
|
||||
// leading: Icon(Icons.colorize),
|
||||
title: Text(s.settingsAudioCache),
|
||||
subtitle: Text(s.settingsAudioCacheDes),
|
||||
|
@ -257,7 +257,7 @@ class _StorageSettingState extends State<StorageSetting>
|
|||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 60.0, right: 20.0, bottom: 10.0),
|
||||
left: 50.0, right: 20.0, bottom: 10.0),
|
||||
child: SliderTheme(
|
||||
data: Theme.of(context).sliderTheme.copyWith(
|
||||
showValueIndicator: ShowValueIndicator.always,
|
||||
|
|
|
@ -70,7 +70,7 @@ class SyncingSetting extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
contentPadding: const EdgeInsets.only(
|
||||
left: 80.0, right: 20, bottom: 10),
|
||||
left: 70.0, right: 20, bottom: 10),
|
||||
title: Text(s.settingsEnableSyncing),
|
||||
subtitle: Text(s.settingsEnableSyncingDes),
|
||||
trailing: Transform.scale(
|
||||
|
@ -87,10 +87,9 @@ class SyncingSetting extends StatelessWidget {
|
|||
}),
|
||||
),
|
||||
),
|
||||
Divider(height: 2),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.only(left: 80.0, right: 20),
|
||||
const EdgeInsets.only(left: 70.0, right: 20),
|
||||
title: Text(s.settingsUpdateInterval),
|
||||
subtitle: Text(s.settingsUpdateIntervalDes),
|
||||
trailing: MyDropdownButton(
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../state/setting_state.dart';
|
||||
import '../util/custom_widget.dart';
|
||||
import '../util/extension_helper.dart';
|
||||
import '../util/general_dialog.dart';
|
||||
|
||||
|
@ -131,7 +132,7 @@ class ThemeSetting extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
)),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 80.0),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 70.0),
|
||||
// leading: Icon(Icons.colorize),
|
||||
title: Text(s.settingsTheme),
|
||||
subtitle: Text(s.systemDefault),
|
||||
|
@ -141,7 +142,7 @@ class ThemeSetting extends StatelessWidget {
|
|||
builder: (_, data, __) => ListTile(
|
||||
onTap: () => settings.setRealDark = !data,
|
||||
contentPadding: const EdgeInsets.only(
|
||||
left: 80.0, right: 20, bottom: 10, top: 10),
|
||||
left: 70.0, right: 20, bottom: 10, top: 10),
|
||||
// leading: Icon(Icons.colorize),
|
||||
title: Text(
|
||||
s.settingsRealDark,
|
||||
|
@ -172,7 +173,7 @@ class ThemeSetting extends StatelessWidget {
|
|||
settings.setAccentColor = value,
|
||||
),
|
||||
),
|
||||
contentPadding: EdgeInsets.only(left: 80.0, right: 25),
|
||||
contentPadding: EdgeInsets.only(left: 70.0, right: 35),
|
||||
title: Text(s.settingsAccentColor),
|
||||
subtitle: Text(s.settingsAccentColorDes),
|
||||
trailing: Container(
|
||||
|
@ -279,66 +280,70 @@ class _ColorPickerState extends State<ColorPicker>
|
|||
key: UniqueKey(),
|
||||
controller: _controller,
|
||||
children: Colors.primaries
|
||||
.map<Widget>((color) => GridView.count(
|
||||
primary: false,
|
||||
padding: const EdgeInsets.all(10),
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
crossAxisCount: 3,
|
||||
children: <Widget>[
|
||||
_colorCircle(color.shade100),
|
||||
_colorCircle(color.shade200),
|
||||
_colorCircle(color.shade300),
|
||||
_colorCircle(color.shade400),
|
||||
_colorCircle(color.shade500),
|
||||
_colorCircle(color.shade600),
|
||||
_colorCircle(color.shade700),
|
||||
_colorCircle(color.shade800),
|
||||
_colorCircle(color.shade900),
|
||||
...color == Colors.red
|
||||
? _accentList(Colors.redAccent)
|
||||
: color == Colors.pink
|
||||
? _accentList(Colors.pinkAccent)
|
||||
: color == Colors.deepOrange
|
||||
? _accentList(Colors.deepOrangeAccent)
|
||||
: color == Colors.orange
|
||||
? _accentList(Colors.orangeAccent)
|
||||
: color == Colors.amber
|
||||
? _accentList(Colors.amberAccent)
|
||||
: color == Colors.yellow
|
||||
? _accentList(
|
||||
Colors.yellowAccent)
|
||||
: color == Colors.lime
|
||||
? _accentList(
|
||||
Colors.limeAccent)
|
||||
: color ==
|
||||
Colors.lightGreen
|
||||
? _accentList(Colors
|
||||
.lightGreenAccent)
|
||||
: color == Colors.green
|
||||
? _accentList(Colors
|
||||
.greenAccent)
|
||||
: color ==
|
||||
Colors
|
||||
.teal
|
||||
? _accentList(
|
||||
Colors
|
||||
.tealAccent)
|
||||
: color ==
|
||||
Colors
|
||||
.cyan
|
||||
? _accentList(
|
||||
Colors
|
||||
.cyanAccent)
|
||||
: color ==
|
||||
Colors
|
||||
.lightBlue
|
||||
? _accentList(Colors
|
||||
.lightBlueAccent)
|
||||
: color == Colors.blue
|
||||
? _accentList(Colors.blueAccent)
|
||||
: color == Colors.indigo ? _accentList(Colors.indigoAccent) : color == Colors.purple ? _accentList(Colors.purpleAccent) : color == Colors.deepPurple ? _accentList(Colors.deepPurpleAccent) : []
|
||||
],
|
||||
.map<Widget>((color) => ScrollConfiguration(
|
||||
behavior: NoGrowBehavior(),
|
||||
child: GridView.count(
|
||||
primary: false,
|
||||
padding: const EdgeInsets.all(10),
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
crossAxisCount: 3,
|
||||
children: <Widget>[
|
||||
_colorCircle(color.shade100),
|
||||
_colorCircle(color.shade200),
|
||||
_colorCircle(color.shade300),
|
||||
_colorCircle(color.shade400),
|
||||
_colorCircle(color.shade500),
|
||||
_colorCircle(color.shade600),
|
||||
_colorCircle(color.shade700),
|
||||
_colorCircle(color.shade800),
|
||||
_colorCircle(color.shade900),
|
||||
...color == Colors.red
|
||||
? _accentList(Colors.redAccent)
|
||||
: color == Colors.pink
|
||||
? _accentList(Colors.pinkAccent)
|
||||
: color == Colors.deepOrange
|
||||
? _accentList(Colors.deepOrangeAccent)
|
||||
: color == Colors.orange
|
||||
? _accentList(Colors.orangeAccent)
|
||||
: color == Colors.amber
|
||||
? _accentList(
|
||||
Colors.amberAccent)
|
||||
: color == Colors.yellow
|
||||
? _accentList(
|
||||
Colors.yellowAccent)
|
||||
: color == Colors.lime
|
||||
? _accentList(
|
||||
Colors.limeAccent)
|
||||
: color ==
|
||||
Colors
|
||||
.lightGreen
|
||||
? _accentList(Colors
|
||||
.lightGreenAccent)
|
||||
: color ==
|
||||
Colors.green
|
||||
? _accentList(Colors
|
||||
.greenAccent)
|
||||
: color ==
|
||||
Colors
|
||||
.teal
|
||||
? _accentList(
|
||||
Colors
|
||||
.tealAccent)
|
||||
: color ==
|
||||
Colors
|
||||
.cyan
|
||||
? _accentList(
|
||||
Colors
|
||||
.cyanAccent)
|
||||
: color == Colors.lightBlue
|
||||
? _accentList(Colors
|
||||
.lightBlueAccent)
|
||||
: color == Colors.blue
|
||||
? _accentList(Colors.blueAccent)
|
||||
: color == Colors.indigo ? _accentList(Colors.indigoAccent) : color == Colors.purple ? _accentList(Colors.purpleAccent) : color == Colors.deepPurple ? _accentList(Colors.deepPurpleAccent) : []
|
||||
],
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
|
|
@ -949,7 +949,7 @@ class DownloadPainter extends CustomPainter {
|
|||
var center = Offset(size.width / 2, size.height / 2);
|
||||
if (pauseProgress == 0) {
|
||||
canvas.drawLine(
|
||||
Offset(width / 2, 0), Offset(width / 2, height * 4 / 5), _paint);
|
||||
Offset(width / 2, 2), Offset(width / 2, height * 4 / 5), _paint);
|
||||
canvas.drawLine(Offset(width / 5, height / 2),
|
||||
Offset(width / 2, height * 4 / 5), _paint);
|
||||
canvas.drawLine(Offset(width * 4 / 5, height / 2),
|
||||
|
|
Loading…
Reference in New Issue