fix: remove unused null check
This commit is contained in:
parent
bb6f57a6a3
commit
731d50935b
|
@ -116,12 +116,12 @@ class PlayerWidget extends StatelessWidget {
|
|||
const TextStyle(color: Color(0xFFFF0000)))
|
||||
: data.item1
|
||||
? Text(
|
||||
s!.buffering,
|
||||
s.buffering,
|
||||
style:
|
||||
TextStyle(color: context.accentColor),
|
||||
)
|
||||
: Text(
|
||||
s!.timeLeft((data.item2).toInt().toTime),
|
||||
s.timeLeft((data.item2).toInt().toTime),
|
||||
maxLines: 2,
|
||||
),
|
||||
);
|
||||
|
@ -282,26 +282,27 @@ class LastPosition extends StatelessWidget {
|
|||
children: [
|
||||
Selector<AudioPlayerNotifier, bool?>(
|
||||
selector: (_, audio) => audio.skipSilence,
|
||||
builder: (_, data, __) => FlatButton(
|
||||
builder: (_, data, __) => TextButton(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.flash_on, size: 18),
|
||||
SizedBox(width: 5),
|
||||
Text(s!.skipSilence),
|
||||
Text(s.skipSilence),
|
||||
],
|
||||
),
|
||||
color: data! ? context.accentColor : Colors.transparent,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
side: BorderSide(
|
||||
color: data
|
||||
? context.accentColor
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withOpacity(0.12))),
|
||||
textColor: data ? Colors.white : null,
|
||||
style: TextButton.styleFrom(
|
||||
primary:
|
||||
data! ? context.accentColor : Colors.transparent,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
side: BorderSide(
|
||||
color: data
|
||||
? context.accentColor
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withOpacity(0.12))),
|
||||
),
|
||||
onPressed: () =>
|
||||
audio.setSkipSilence(skipSilence: !data))),
|
||||
SizedBox(width: 10),
|
||||
|
@ -312,7 +313,7 @@ class LastPosition extends StatelessWidget {
|
|||
children: [
|
||||
Icon(Icons.volume_up, size: 18),
|
||||
SizedBox(width: 5),
|
||||
Text(s!.boostVolume),
|
||||
Text(s.boostVolume),
|
||||
],
|
||||
),
|
||||
color: data! ? context.accentColor : Colors.transparent,
|
||||
|
@ -757,7 +758,7 @@ class SleepModeState extends State<SleepMode>
|
|||
width: 120,
|
||||
child: Center(
|
||||
child: Text(
|
||||
s!.endOfEpisode,
|
||||
s.endOfEpisode,
|
||||
style: TextStyle(
|
||||
color: (move > 0
|
||||
? Colors.white
|
||||
|
|
|
@ -661,56 +661,57 @@ class _RecentUpdateState extends State<_RecentUpdate>
|
|||
// final audio = context.read<AudioPlayerNotifier>();
|
||||
final s = context.s;
|
||||
return FutureBuilder<int>(
|
||||
future: _getUpdateCounts(_group!),
|
||||
initialData: 0,
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.data != 0
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
tooltip: s!.removeNewMark,
|
||||
icon: SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CustomPaint(
|
||||
painter: RemoveNewFlagPainter(
|
||||
context.textTheme.bodyText1!.color,
|
||||
Colors.red))),
|
||||
onPressed: () async {
|
||||
_removeNewMark(_group!);
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}),
|
||||
// IconButton(
|
||||
// tooltip: s.addNewEpisodeTooltip,
|
||||
// icon: SizedBox(
|
||||
// height: 15,
|
||||
// width: 20,
|
||||
// child: CustomPaint(
|
||||
// painter: AddToPlaylistPainter(
|
||||
// context.textTheme.bodyText1.color,
|
||||
// Colors.red))),
|
||||
// onPressed: () async {
|
||||
// await audio.addNewEpisode(_group);
|
||||
// if (mounted) {
|
||||
// setState(() {});
|
||||
// }
|
||||
// Fluttertoast.showToast(
|
||||
// msg: _groupName == 'All'
|
||||
// ? s.addNewEpisodeAll(snapshot.data)
|
||||
// : s.addEpisodeGroup(
|
||||
// _groupName, snapshot.data),
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// );
|
||||
// }),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Center();
|
||||
});
|
||||
future: _getUpdateCounts(_group!),
|
||||
initialData: 0,
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.data != 0
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
tooltip: s.removeNewMark,
|
||||
icon: SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CustomPaint(
|
||||
painter: RemoveNewFlagPainter(
|
||||
context.textTheme.bodyText1!.color,
|
||||
Colors.red))),
|
||||
onPressed: () async {
|
||||
_removeNewMark(_group!);
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}),
|
||||
// IconButton(
|
||||
// tooltip: s.addNewEpisodeTooltip,
|
||||
// icon: SizedBox(
|
||||
// height: 15,
|
||||
// width: 20,
|
||||
// child: CustomPaint(
|
||||
// painter: AddToPlaylistPainter(
|
||||
// context.textTheme.bodyText1.color,
|
||||
// Colors.red))),
|
||||
// onPressed: () async {
|
||||
// await audio.addNewEpisode(_group);
|
||||
// if (mounted) {
|
||||
// setState(() {});
|
||||
// }
|
||||
// Fluttertoast.showToast(
|
||||
// msg: _groupName == 'All'
|
||||
// ? s.addNewEpisodeAll(snapshot.data)
|
||||
// : s.addEpisodeGroup(
|
||||
// _groupName, snapshot.data),
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// );
|
||||
// }),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Center();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -736,7 +737,7 @@ class _RecentUpdateState extends State<_RecentUpdate>
|
|||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10)),
|
||||
Text(
|
||||
s!.noEpisodeRecent,
|
||||
s.noEpisodeRecent,
|
||||
style: TextStyle(color: Colors.grey[500]),
|
||||
)
|
||||
],
|
||||
|
@ -820,7 +821,7 @@ class _RecentUpdateState extends State<_RecentUpdate>
|
|||
onPressed: () {
|
||||
_updateRssItem();
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.refreshStarted,
|
||||
msg: s.refreshStarted,
|
||||
gravity:
|
||||
ToastGravity.BOTTOM,
|
||||
);
|
||||
|
@ -830,7 +831,7 @@ class _RecentUpdateState extends State<_RecentUpdate>
|
|||
Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
tooltip: s!.hideListenedSetting,
|
||||
tooltip: s.hideListenedSetting,
|
||||
icon: SizedBox(
|
||||
width: 30,
|
||||
height: 15,
|
||||
|
@ -980,7 +981,7 @@ class _MyFavoriteState extends State<_MyFavorite>
|
|||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10)),
|
||||
Text(
|
||||
s!.noEpisodeFavorite,
|
||||
s.noEpisodeFavorite,
|
||||
style: TextStyle(color: Colors.grey[500]),
|
||||
)
|
||||
],
|
||||
|
@ -1049,7 +1050,7 @@ class _MyFavoriteState extends State<_MyFavorite>
|
|||
BorderRadius.all(
|
||||
Radius.circular(10))),
|
||||
elevation: 1,
|
||||
tooltip: s!.homeSubMenuSortBy,
|
||||
tooltip: s.homeSubMenuSortBy,
|
||||
child: Container(
|
||||
height: 50,
|
||||
padding: EdgeInsets.symmetric(
|
||||
|
@ -1235,7 +1236,7 @@ class _MyDownloadState extends State<_MyDownload>
|
|||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(s!.downloaded)),
|
||||
child: Text(s.downloaded)),
|
||||
Spacer(),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
|
|
|
@ -14,28 +14,29 @@ class Import extends StatelessWidget {
|
|||
return Container(
|
||||
color: context.primaryColorDark,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
SizedBox(height: 2.0, child: LinearProgressIndicator()),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
height: 20.0,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(text),
|
||||
),
|
||||
]),
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
SizedBox(height: 2.0, child: LinearProgressIndicator()),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
height: 20.0,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(text),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_autoDownloadNew(BuildContext context) async {
|
||||
final dbHelper = DBHelper();
|
||||
var downloader = Provider.of<DownloadState>(context, listen: false);
|
||||
var result = await Connectivity().checkConnectivity();
|
||||
var autoDownloadStorage = KeyValueStorage(autoDownloadNetworkKey);
|
||||
var autoDownloadNetwork = await autoDownloadStorage.getInt();
|
||||
final downloader = Provider.of<DownloadState>(context, listen: false);
|
||||
final result = await Connectivity().checkConnectivity();
|
||||
final autoDownloadStorage = KeyValueStorage(autoDownloadNetworkKey);
|
||||
final autoDownloadNetwork = await autoDownloadStorage.getInt();
|
||||
if (autoDownloadNetwork == 1) {
|
||||
var episodes = await dbHelper.getNewEpisodes('all');
|
||||
final episodes = await dbHelper.getNewEpisodes('all');
|
||||
// For safety
|
||||
if (episodes.length < 100 && episodes.length > 0) {
|
||||
for (var episode in episodes) {
|
||||
|
@ -56,26 +57,27 @@ class Import extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final s = context.s;
|
||||
var groupList = Provider.of<GroupList>(context, listen: false);
|
||||
final groupList = Provider.of<GroupList>(context, listen: false);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Consumer<GroupList>(
|
||||
builder: (_, subscribeWorker, __) {
|
||||
var item = subscribeWorker.currentSubscribeItem;
|
||||
final item = subscribeWorker.currentSubscribeItem;
|
||||
switch (item.subscribeState) {
|
||||
case SubscribeState.start:
|
||||
return importColumn(
|
||||
s!.notificationSubscribe(item.title!), context);
|
||||
s.notificationSubscribe(item.title!), context);
|
||||
case SubscribeState.subscribe:
|
||||
return importColumn(s!.notificaitonFatch(item.title!), context);
|
||||
return importColumn(s.notificaitonFatch(item.title!), context);
|
||||
case SubscribeState.fetch:
|
||||
return importColumn(s!.notificationSuccess(item.title!), context);
|
||||
return importColumn(
|
||||
s.notificationSuccess(item.title!), context);
|
||||
case SubscribeState.exist:
|
||||
return importColumn(
|
||||
s!.notificationSubscribeExisted(item.title!), context);
|
||||
s.notificationSubscribeExisted(item.title!), context);
|
||||
case SubscribeState.error:
|
||||
return importColumn(
|
||||
s!.notificationNetworkError(item.title!), context);
|
||||
s.notificationNetworkError(item.title!), context);
|
||||
default:
|
||||
return Center();
|
||||
}
|
||||
|
@ -83,17 +85,17 @@ class Import extends StatelessWidget {
|
|||
),
|
||||
Consumer<RefreshWorker>(
|
||||
builder: (context, refreshWorker, child) {
|
||||
var item = refreshWorker.currentRefreshItem;
|
||||
final item = refreshWorker.currentRefreshItem;
|
||||
if (refreshWorker.complete) {
|
||||
groupList.updateGroups();
|
||||
_autoDownloadNew(context);
|
||||
}
|
||||
switch (item.refreshState) {
|
||||
case RefreshState.fetch:
|
||||
return importColumn(s!.notificationUpdate(item.title), context);
|
||||
return importColumn(s.notificationUpdate(item.title), context);
|
||||
case RefreshState.error:
|
||||
return importColumn(
|
||||
s!.notificationUpdateError(item.title), context);
|
||||
s.notificationUpdateError(item.title), context);
|
||||
default:
|
||||
return Center();
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ class DiscoveryPageState extends State<DiscoveryPage> {
|
|||
borderRadius: BorderRadius.circular(10),
|
||||
color: context.primaryColor,
|
||||
border:
|
||||
Border.all(color: context.textColor!.withOpacity(0.1), width: 1)),
|
||||
Border.all(color: context.textColor.withOpacity(0.1), width: 1)),
|
||||
width: 120,
|
||||
margin: EdgeInsets.fromLTRB(10, 10, 0, 10),
|
||||
child: Material(
|
||||
|
|
|
@ -1188,7 +1188,7 @@ class _SearchResultDetailState extends State<SearchResultDetail>
|
|||
indicatorWeight: 3,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
tabs: [
|
||||
Text(s!.homeToprightMenuAbout),
|
||||
Text(s.homeToprightMenuAbout),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
@ -1273,7 +1273,7 @@ class SubscribeButton extends StatelessWidget {
|
|||
side: BorderSide(color: context.accentColor)),
|
||||
onSurface: context.accentColor.withOpacity(0.5),
|
||||
),
|
||||
child: Text(s!.subscribe,
|
||||
child: Text(s.subscribe,
|
||||
style: TextStyle(color: context.accentColor)),
|
||||
onPressed: () {
|
||||
Fluttertoast.showToast(
|
||||
|
@ -1298,7 +1298,7 @@ class SubscribeButton extends StatelessWidget {
|
|||
// disabledTextColor: Colors.grey[500],
|
||||
// disabledBorderColor: Colors.grey[500],
|
||||
),
|
||||
child: Text(s!.subscribe),
|
||||
child: Text(s.subscribe),
|
||||
onPressed: () {}),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -43,10 +43,7 @@ Future main() async {
|
|||
child: MyApp(),
|
||||
),
|
||||
);
|
||||
var systemUiOverlayStyle = SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
systemNavigationBarColor: Colors.transparent);
|
||||
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
await SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
|
||||
}
|
||||
|
@ -80,7 +77,6 @@ class MyApp extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
//child: FeatureDiscovery(child: Home()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -845,7 +845,7 @@ class __PlaylistsState extends State<_Playlists> {
|
|||
color: context.primaryColorDark,
|
||||
child: Center(child: Icon(Icons.add)),
|
||||
),
|
||||
title: Text(s!.createNewPlaylist),
|
||||
title: Text(s.createNewPlaylist),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
|
|
@ -327,7 +327,7 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
|||
children: [
|
||||
Icon(Icons.clear_all_outlined, size: 18),
|
||||
SizedBox(width: 20),
|
||||
Text(s!.clearAll, style: textStyle),
|
||||
Text(s.clearAll, style: textStyle),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -342,8 +342,8 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
|||
onPressed: () => setState(() {
|
||||
_clearConfirm = false;
|
||||
}),
|
||||
child: Text(s!.cancel,
|
||||
style: TextStyle(color: Colors.grey[600])),
|
||||
child:
|
||||
Text(s.cancel, style: TextStyle(color: Colors.grey[600])),
|
||||
),
|
||||
FlatButton(
|
||||
splashColor: Colors.red.withAlpha(70),
|
||||
|
@ -368,7 +368,7 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
|||
children: [
|
||||
Icon(Icons.delete, color: Colors.red, size: 18),
|
||||
SizedBox(width: 20),
|
||||
Text(s!.remove,
|
||||
Text(s.remove,
|
||||
style: textStyle!.copyWith(
|
||||
color: Colors.red, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
|
@ -385,8 +385,8 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
|||
onPressed: () => setState(() {
|
||||
_removeConfirm = false;
|
||||
}),
|
||||
child: Text(s!.cancel,
|
||||
style: TextStyle(color: Colors.grey[600])),
|
||||
child:
|
||||
Text(s.cancel, style: TextStyle(color: Colors.grey[600])),
|
||||
),
|
||||
FlatButton(
|
||||
splashColor: Colors.red.withAlpha(70),
|
||||
|
@ -408,7 +408,7 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
|||
children: [
|
||||
Icon(Icons.info_outline,
|
||||
size: 16, color: context.textColor!.withAlpha(90)),
|
||||
Text(s!.defaultQueueReminder,
|
||||
Text(s.defaultQueueReminder,
|
||||
style: TextStyle(color: context.textColor!.withAlpha(90))),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -174,7 +174,7 @@ class _PlayedHistoryState extends State<PlayedHistory>
|
|||
labelStyle: context.textTheme.headline6,
|
||||
tabs: <Widget>[
|
||||
Tab(
|
||||
child: Text(s!.listen),
|
||||
child: Text(s.listen),
|
||||
),
|
||||
Tab(
|
||||
child: Text(s.subscribe),
|
||||
|
@ -343,7 +343,7 @@ class _PlayedHistoryState extends State<PlayedHistory>
|
|||
],
|
||||
),
|
||||
subtitle: _status
|
||||
? Text(s!.daysAgo(DateTime.now()
|
||||
? Text(s.daysAgo(DateTime.now()
|
||||
.difference(
|
||||
snapshot.data![index].subDate)
|
||||
.inDays))
|
||||
|
|
|
@ -171,7 +171,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||
topLeft: Radius.circular(5)),
|
||||
),
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(s!.from(data.item1!.toTime)),
|
||||
child: Text(s.from(data.item1!.toTime)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -134,7 +134,7 @@ class _PopupMenuSettingState extends State<PopupMenuSetting> {
|
|||
height: 30.0,
|
||||
padding: EdgeInsets.symmetric(horizontal: 80),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(s!.settingsPopupMenu,
|
||||
child: Text(s.settingsPopupMenu,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1!
|
||||
|
|
|
@ -602,7 +602,7 @@ class SettingState extends ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<void> _saveShowNotesFonts() async {
|
||||
await _showNotesFontStorage.saveInt(_showNotesFontIndex!);
|
||||
await _showNotesFontStorage.saveInt(_showNotesFontIndex);
|
||||
}
|
||||
|
||||
Future<SettingsBackup> backup() async {
|
||||
|
|
|
@ -9,7 +9,7 @@ part of 'index_episode.dart';
|
|||
IndexEpisodeResult<P> _$IndexEpisodeResultFromJson<P>(
|
||||
Map<String, dynamic> json) {
|
||||
return IndexEpisodeResult<P>(
|
||||
items: (json['items'] as List?)?.map(_ConvertP<P>().fromJson)?.toList(),
|
||||
items: (json['items'] as List?)?.map(_ConvertP<P>().fromJson).toList(),
|
||||
status: json['status'] as String?,
|
||||
count: json['count'] as int?,
|
||||
);
|
||||
|
@ -18,7 +18,7 @@ IndexEpisodeResult<P> _$IndexEpisodeResultFromJson<P>(
|
|||
Map<String, dynamic> _$IndexEpisodeResultToJson<P>(
|
||||
IndexEpisodeResult<P> instance) =>
|
||||
<String, dynamic>{
|
||||
'items': instance.items?.map(_ConvertP<P>().toJson)?.toList(),
|
||||
'items': instance.items?.map(_ConvertP<P>().toJson).toList(),
|
||||
'status': instance.status,
|
||||
'count': instance.count,
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ part of 'index_podcast.dart';
|
|||
PodcastIndexSearchResult<P> _$PodcastIndexSearchResultFromJson<P>(
|
||||
Map<String, dynamic> json) {
|
||||
return PodcastIndexSearchResult<P>(
|
||||
feeds: (json['feeds'] as List?)?.map(_ConvertP<P>().fromJson)?.toList(),
|
||||
feeds: (json['feeds'] as List?)?.map(_ConvertP<P>().fromJson).toList(),
|
||||
status: json['status'] as String?,
|
||||
count: json['count'] as int?,
|
||||
);
|
||||
|
@ -18,7 +18,7 @@ PodcastIndexSearchResult<P> _$PodcastIndexSearchResultFromJson<P>(
|
|||
Map<String, dynamic> _$PodcastIndexSearchResultToJson<P>(
|
||||
PodcastIndexSearchResult<P> instance) =>
|
||||
<String, dynamic>{
|
||||
'feeds': instance.feeds?.map(_ConvertP<P>().toJson)?.toList(),
|
||||
'feeds': instance.feeds?.map(_ConvertP<P>().toJson).toList(),
|
||||
'status': instance.status,
|
||||
'count': instance.count,
|
||||
};
|
||||
|
|
|
@ -10,14 +10,14 @@ ItunesSearchResult<P> _$ItunesSearchResultFromJson<P>(
|
|||
Map<String, dynamic> json) {
|
||||
return ItunesSearchResult<P>(
|
||||
resultCount: json['resultCount'] as int?,
|
||||
results: (json['results'] as List?)?.map(_ConvertP<P>().fromJson)?.toList(),
|
||||
results: (json['results'] as List?)?.map(_ConvertP<P>().fromJson).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$ItunesSearchResultToJson<P>(
|
||||
ItunesSearchResult<P> instance) =>
|
||||
<String, dynamic>{
|
||||
'results': instance.results?.map(_ConvertP<P>().toJson)?.toList(),
|
||||
'results': instance.results?.map(_ConvertP<P>().toJson).toList(),
|
||||
'resultCount': instance.resultCount,
|
||||
};
|
||||
|
||||
|
|
|
@ -258,7 +258,6 @@ class _OpenContainerRoute extends ModalRoute<void> {
|
|||
],
|
||||
);
|
||||
}
|
||||
return null; // unreachable
|
||||
}
|
||||
|
||||
static _FlippableTweenSequence<double>? _getClosedOpacityTween(
|
||||
|
@ -273,7 +272,6 @@ class _OpenContainerRoute extends ModalRoute<void> {
|
|||
),
|
||||
],
|
||||
);
|
||||
break;
|
||||
case ContainerTransitionType.fadeThrough:
|
||||
return _FlippableTweenSequence<double>(
|
||||
<TweenSequenceItem<double>>[
|
||||
|
@ -287,9 +285,7 @@ class _OpenContainerRoute extends ModalRoute<void> {
|
|||
),
|
||||
],
|
||||
);
|
||||
break;
|
||||
}
|
||||
return null; // unreachable
|
||||
}
|
||||
|
||||
static _FlippableTweenSequence<double>? _getOpenOpacityTween(
|
||||
|
@ -421,7 +417,7 @@ class _OpenContainerRoute extends ModalRoute<void> {
|
|||
}
|
||||
|
||||
if (delayForSourceRoute) {
|
||||
SchedulerBinding.instance!
|
||||
SchedulerBinding.instance
|
||||
.addPostFrameCallback(takeMeasurementsInSourceRoute);
|
||||
} else {
|
||||
takeMeasurementsInSourceRoute();
|
||||
|
@ -460,6 +456,8 @@ class _OpenContainerRoute extends ModalRoute<void> {
|
|||
case AnimationStatus.reverse:
|
||||
isInProgress = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
switch (_lastAnimationStatus) {
|
||||
case AnimationStatus.completed:
|
||||
|
@ -470,6 +468,8 @@ class _OpenContainerRoute extends ModalRoute<void> {
|
|||
case AnimationStatus.reverse:
|
||||
wasInProgress = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return wasInProgress && isInProgress;
|
||||
}
|
||||
|
|
|
@ -1126,16 +1126,16 @@ class _MyDropdownButtonState<T> extends State<MyDropdownButton<T>>
|
|||
// ActivateAction.key: _createAction,
|
||||
// };
|
||||
focusNode!.addListener(_handleFocusChanged);
|
||||
final focusManager = WidgetsBinding.instance!.focusManager;
|
||||
final focusManager = WidgetsBinding.instance.focusManager;
|
||||
_focusHighlightMode = focusManager.highlightMode;
|
||||
focusManager.addHighlightModeListener(_handleFocusHighlightModeChange);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance!.removeObserver(this);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_removeDropdownRoute();
|
||||
WidgetsBinding.instance!.focusManager
|
||||
WidgetsBinding.instance.focusManager
|
||||
.removeHighlightModeListener(_handleFocusHighlightModeChange);
|
||||
focusNode!.removeListener(_handleFocusChanged);
|
||||
_internalNode?.dispose();
|
||||
|
|
|
@ -224,7 +224,8 @@ class _HourMinuteControl extends StatelessWidget {
|
|||
final backgroundColor = timePickerTheme.hourMinuteColor ??
|
||||
MaterialStateColor.resolveWith((states) {
|
||||
return states.contains(MaterialState.selected)
|
||||
? themeData.colorScheme.secondary.withOpacity(isDark ? 0.24 : 0.12)
|
||||
? themeData.colorScheme.secondary
|
||||
.withOpacity(isDark ? 0.24 : 0.12)
|
||||
: themeData.colorScheme.onSurface.withOpacity(0.12);
|
||||
});
|
||||
final style =
|
||||
|
@ -743,6 +744,8 @@ class _RenderInputPadding extends RenderShiftedBox {
|
|||
newPosition += const Offset(-1.0, 0.0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result.addWithRawTransform(
|
||||
|
@ -783,7 +786,7 @@ class _DialPainter extends CustomPainter {
|
|||
required this.theta,
|
||||
required this.textDirection,
|
||||
required this.selectedValue,
|
||||
}) : super(repaint: PaintingBinding.instance!.systemFonts);
|
||||
}) : super(repaint: PaintingBinding.instance.systemFonts);
|
||||
|
||||
final List<_TappableLabel>? primaryLabels;
|
||||
final List<_TappableLabel>? secondaryLabels;
|
||||
|
@ -1734,6 +1737,8 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
|
|||
_formKey.currentState!.save();
|
||||
_entryMode = TimePickerEntryMode.dial;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1837,6 +1842,8 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
|
|||
timePickerWidth = _kTimePickerWidthPortrait;
|
||||
timePickerHeight = _kTimePickerHeightInput;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Size(timePickerWidth, timePickerHeight * textScaleFactor);
|
||||
}
|
||||
|
@ -1980,6 +1987,8 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
|
|||
),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
final dialogSize = _dialogSize(context);
|
||||
|
|
|
@ -88,7 +88,7 @@ class _DismissibleContainerState extends State<DismissibleContainer> {
|
|||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
behavior: SnackBarBehavior.floating,
|
||||
backgroundColor: Colors.grey[800],
|
||||
content: Text(s!.toastRemovePlaylist,
|
||||
content: Text(s.toastRemovePlaylist,
|
||||
style: TextStyle(color: Colors.white)),
|
||||
action: SnackBarAction(
|
||||
textColor: context.accentColor,
|
||||
|
@ -194,7 +194,7 @@ class EpisodeCard extends StatelessWidget {
|
|||
episodeTag(
|
||||
episode.duration == 0
|
||||
? ''
|
||||
: s!.minsCount(episode.duration! ~/ 60),
|
||||
: s.minsCount(episode.duration! ~/ 60),
|
||||
Colors.cyan[300]),
|
||||
if (episode.enclosureLength != null)
|
||||
episodeTag(
|
||||
|
|
|
@ -161,7 +161,7 @@ class EpisodeGrid extends StatelessWidget {
|
|||
title: Text(s.cellularConfirm),
|
||||
content: Text(s.cellularConfirmDes),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
|
@ -170,7 +170,7 @@ class EpisodeGrid extends StatelessWidget {
|
|||
style: TextStyle(color: Colors.grey[600]),
|
||||
),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ifUseData = true;
|
||||
Navigator.of(context).pop();
|
||||
|
@ -673,11 +673,11 @@ class EpisodeGrid extends StatelessWidget {
|
|||
title: Text(
|
||||
data.item1 != episodes![index] ||
|
||||
!data.item4
|
||||
? s!.play
|
||||
: s!.playing),
|
||||
? s.play
|
||||
: s.playing),
|
||||
trailingIcon: Icon(
|
||||
LineIcons.playCircle,
|
||||
color: Theme.of(context).accentColor,
|
||||
color: context.accentColor,
|
||||
),
|
||||
onPressed: () {
|
||||
if (data.item1 != episodes![index] ||
|
||||
|
@ -756,7 +756,7 @@ class EpisodeGrid extends StatelessWidget {
|
|||
title: isListened > 0
|
||||
? Text(s.markNotListened,
|
||||
style: TextStyle(
|
||||
color: context.textColor!
|
||||
color: context.textColor
|
||||
.withOpacity(0.5)))
|
||||
: Text(
|
||||
s.markListened,
|
||||
|
@ -799,7 +799,7 @@ class EpisodeGrid extends StatelessWidget {
|
|||
title: isDownloaded
|
||||
? Text(s.downloaded,
|
||||
style: TextStyle(
|
||||
color: context.textColor!
|
||||
color: context.textColor
|
||||
.withOpacity(0.5)))
|
||||
: Text(s.download),
|
||||
trailingIcon: Icon(LineIcons.download,
|
||||
|
|
|
@ -413,13 +413,13 @@ class _MultiSelectMenuBarState extends State<MultiSelectMenuBar> {
|
|||
if (!_liked) {
|
||||
await _saveLiked();
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.liked,
|
||||
msg: s.liked,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
} else {
|
||||
await _setUnliked();
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.unliked,
|
||||
msg: s.unliked,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ class _MultiSelectMenuBarState extends State<MultiSelectMenuBar> {
|
|||
for (var episode in widget.selectedList!) {
|
||||
audio.addToPlaylist(episode);
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.toastAddPlaylist,
|
||||
msg: s.toastAddPlaylist,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ class _MultiSelectMenuBarState extends State<MultiSelectMenuBar> {
|
|||
for (var episode in widget.selectedList!) {
|
||||
audio.delFromPlaylist(episode);
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.toastRemovePlaylist,
|
||||
msg: s.toastRemovePlaylist,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
|
@ -511,13 +511,13 @@ class _MultiSelectMenuBarState extends State<MultiSelectMenuBar> {
|
|||
if (!_marked) {
|
||||
await _markListened();
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.markListened,
|
||||
msg: s.markListened,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
} else {
|
||||
await _markNotListened();
|
||||
Fluttertoast.showToast(
|
||||
msg: s!.markNotListened,
|
||||
msg: s.markNotListened,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue