Change search cursor color

This commit is contained in:
stonegate 2020-05-26 15:21:14 +08:00
parent e7c175fef2
commit 8ec1793843
3 changed files with 46 additions and 42 deletions

View File

@ -19,15 +19,17 @@ import '../.env.dart';
class MyHomePageDelegate extends SearchDelegate<int> {
final String searchFieldLabel;
MyHomePageDelegate({this.searchFieldLabel})
: super(searchFieldLabel: searchFieldLabel);
: super(
searchFieldLabel: searchFieldLabel,
);
static Future<List> getList(String searchText) async {
String apiKey = environment['apiKey'];
String url =
"https://listennotes.p.rapidapi.com/api/v1/search?only_in=title%2Cdescription&q=" +
"$searchText&sort_by_date=0&type=podcast";
"$searchText&type=podcast";
Response response = await Dio().get(url,
options: Options(headers: {
'X-Mashape-Key': "$apiKey",
'X-RapidAPI-Key': "$apiKey",
'Accept': "application/json"
}));
Map searchResultMap = jsonDecode(response.toString());

View File

@ -33,8 +33,9 @@ class Home extends StatefulWidget {
}
class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
final MyHomePageDelegate _delegate =
MyHomePageDelegate(searchFieldLabel: 'Search podcast');
final MyHomePageDelegate _delegate = MyHomePageDelegate(
searchFieldLabel: 'Search podcast',
);
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
TabController _controller;
@ -456,9 +457,10 @@ class _RecentUpdateState extends State<_RecentUpdate>
if (snapshot.hasError) print(snapshot.error);
return (snapshot.hasData)
? snapshot.data.length == 0
? Center(
? Padding(
padding: EdgeInsets.only(top: 150),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(LineIcons.cloud_download_alt_solid,
size: 80, color: Colors.grey[500]),
@ -748,9 +750,10 @@ class _MyFavoriteState extends State<_MyFavorite>
if (snapshot.hasError) print(snapshot.error);
return (snapshot.hasData)
? snapshot.data.length == 0
? Center(
? Padding(
padding: EdgeInsets.only(top: 150),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(LineIcons.heartbeat_solid,
size: 80, color: Colors.grey[500]),
@ -971,31 +974,29 @@ class _MyDownloadState extends State<_MyDownload>
.toList()
.reversed
.toList();
return
//episodes.length == 0
// ? SliverToBoxAdapter(
// child: Padding(
// padding: EdgeInsets.only(top: 100),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Icon(LineIcons.download_solid,
// size: 80, color: Colors.grey[500]),
// Padding(padding: EdgeInsets.symmetric(vertical: 10)),
// Text(
// 'No episode collected yet',
// style: TextStyle(color: Colors.grey[500]),
// )
// ],
// ),
// ),
// )
// :
EpisodeGrid(
episodes: episodes,
layout: _layout,
initNum: 0,
);
return episodes.length == 0
? SliverToBoxAdapter(
child: Padding(
padding: EdgeInsets.only(top: 110),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(LineIcons.download_solid,
size: 80, color: Colors.grey[500]),
Padding(padding: EdgeInsets.symmetric(vertical: 10)),
Text(
'No episode downloaded yet',
style: TextStyle(color: Colors.grey[500]),
)
],
),
),
)
: EpisodeGrid(
episodes: episodes,
layout: _layout,
initNum: 0,
);
},
),
],

View File

@ -55,16 +55,17 @@ class MyApp extends StatelessWidget {
title: 'Tsacdop',
theme: lightTheme.copyWith(
accentColor: setting.accentSetColor,
cursorColor: setting.accentSetColor,
toggleableActiveColor: setting.accentSetColor),
darkTheme: ThemeData.dark().copyWith(
accentColor: setting.accentSetColor,
primaryColorDark: Colors.grey[800],
scaffoldBackgroundColor: setting.realDark ? Colors.black87 : null,
primaryColor: setting.realDark ? Colors.black : null,
popupMenuTheme: PopupMenuThemeData()
.copyWith(color: setting.realDark ? Colors.black87 : null),
appBarTheme: AppBarTheme(elevation: 0),
),
accentColor: setting.accentSetColor,
primaryColorDark: Colors.grey[800],
scaffoldBackgroundColor: setting.realDark ? Colors.black87 : null,
primaryColor: setting.realDark ? Colors.black : null,
popupMenuTheme: PopupMenuThemeData()
.copyWith(color: setting.realDark ? Colors.black87 : null),
appBarTheme: AppBarTheme(elevation: 0),
cursorColor: setting.accentSetColor),
localizationsDelegates: [
S.delegate,
GlobalMaterialLocalizations.delegate,