From 26662ef6cbd06febb237dcf22f05cfe4390c3828 Mon Sep 17 00:00:00 2001 From: Khen Solomon Lethil Date: Wed, 16 Feb 2022 11:59:13 +0100 Subject: [PATCH] remove cupertino --- lib/view/launch/album-list/main.dart | 2 +- lib/view/launch/article/main.dart | 2 +- lib/view/launch/artist-info/main.dart | 2 +- lib/view/launch/artist-list/main.dart | 2 +- lib/view/launch/blog/main.dart | 10 +++---- lib/view/launch/home/main.dart | 35 +++--------------------- lib/view/launch/library/main.dart | 38 ++++++++++++++++++--------- lib/view/launch/note/main.dart | 2 +- lib/view/launch/recent_play/main.dart | 2 +- lib/view/launch/reorderable/main.dart | 2 +- lib/view/launch/store/main.dart | 5 ++-- lib/view/player/main.dart | 12 +++++---- lib/view/read/main.dart | 6 ++--- lib/view/search/suggest/main.dart | 17 +++++------- lib/view/setting/main.dart | 2 +- lib/view/user/main.dart | 15 +++-------- 16 files changed, 64 insertions(+), 90 deletions(-) diff --git a/lib/view/launch/album-list/main.dart b/lib/view/launch/album-list/main.dart index 609b2e4..a68f5b6 100644 --- a/lib/view/launch/album-list/main.dart +++ b/lib/view/launch/album-list/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; import 'package:lidea/icon.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; diff --git a/lib/view/launch/article/main.dart b/lib/view/launch/article/main.dart index 04b36be..653becb 100644 --- a/lib/view/launch/article/main.dart +++ b/lib/view/launch/article/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; // import 'package:flutter/services.dart'; diff --git a/lib/view/launch/artist-info/main.dart b/lib/view/launch/artist-info/main.dart index c2ce35f..aa758b7 100644 --- a/lib/view/launch/artist-info/main.dart +++ b/lib/view/launch/artist-info/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; // import 'package:flutter/services.dart'; diff --git a/lib/view/launch/artist-list/main.dart b/lib/view/launch/artist-list/main.dart index 139f788..04cb9df 100644 --- a/lib/view/launch/artist-list/main.dart +++ b/lib/view/launch/artist-list/main.dart @@ -1,7 +1,7 @@ // ignore_for_file: prefer_is_empty import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; // import 'package:flutter/services.dart'; diff --git a/lib/view/launch/blog/main.dart b/lib/view/launch/blog/main.dart index bd1eb58..999dd50 100644 --- a/lib/view/launch/blog/main.dart +++ b/lib/view/launch/blog/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; // import 'package:flutter/services.dart'; @@ -94,21 +94,21 @@ class _View extends _State with _Bar { SliverList( delegate: SliverChildListDelegate( [ - CupertinoButton( + WidgetButton( child: const Chip( - avatar: Icon(CupertinoIcons.back), + avatar: Icon(Icons.arrow_back_ios_new_rounded), labelPadding: EdgeInsets.zero, label: Text('Back'), ), onPressed: () => Navigator.of(context).pop(), ), - CupertinoButton( + WidgetButton( child: const Chip( label: Text('Continue to article'), ), onPressed: () => core.navigate(to: '/article'), ), - CupertinoButton( + WidgetButton( child: const Chip( label: Text('Navigate to search'), ), diff --git a/lib/view/launch/home/main.dart b/lib/view/launch/home/main.dart index 5888945..e387fd9 100644 --- a/lib/view/launch/home/main.dart +++ b/lib/view/launch/home/main.dart @@ -213,12 +213,12 @@ class _View extends _State with _Bar, _Refresh { // ), SliverPadding( - padding: const EdgeInsets.symmetric(vertical: 16), + padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15), sliver: SliverToBoxAdapter( child: Text( core.collection.language('Personalized experience'), textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1, + style: Theme.of(context).textTheme.titleMedium, ), ), ), @@ -389,7 +389,7 @@ class _View extends _State with _Bar, _Refresh { child: Text( core.collection.language('Discover music'), textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1, + style: Theme.of(context).textTheme.titleMedium, ), ), ), @@ -520,10 +520,9 @@ class _View extends _State with _Bar, _Refresh { textDirection: TextDirection.ltr, children: items.take(3).map( (e) { - return CupertinoButton( + return WidgetButton( child: Text( e.value.word, - style: Theme.of(context).textTheme.bodyText1, ), onPressed: () => onSearch(e.value.word), ); @@ -535,31 +534,6 @@ class _View extends _State with _Bar, _Refresh { } Widget researchWrap(List> items) { - // return Selector>>( - // selector: (_, e) => e.collection.recentSearches.toList(), - // builder: (BuildContext _, List> items, Widget? __) { - // items.sort((a, b) => b.value.date!.compareTo(a.value.date!)); - // if (items.isEmpty) { - // return const Icon(LideaIcon.dotHoriz); - // } - // return Wrap( - // alignment: WrapAlignment.center, - // crossAxisAlignment: WrapCrossAlignment.center, - // textDirection: TextDirection.ltr, - // children: items.take(3).map( - // (e) { - // return CupertinoButton( - // child: Text( - // e.value.word, - // style: Theme.of(context).textTheme.bodyText1, - // ), - // onPressed: () => onSearch(e.value.word), - // ); - // }, - // ).toList(), - // ); - // }, - // ); return Wrap( alignment: WrapAlignment.center, crossAxisAlignment: WrapCrossAlignment.center, @@ -570,7 +544,6 @@ class _View extends _State with _Bar, _Refresh { margin: const EdgeInsets.symmetric(horizontal: 10), child: WidgetLabel( label: e.value.word, - labelStyle: Theme.of(context).textTheme.bodyText1, ), onPressed: () => onSearch(e.value.word), ); diff --git a/lib/view/launch/library/main.dart b/lib/view/launch/library/main.dart index f294dd7..497f6a2 100644 --- a/lib/view/launch/library/main.dart +++ b/lib/view/launch/library/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:hive_flutter/hive_flutter.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; @@ -171,10 +171,13 @@ class _View extends _State with _Bar { children: [ Text( likes.list.length.toString(), - style: Theme.of(context).textTheme.bodyText1, + style: TextStyle( + color: likes.list.isEmpty ? Theme.of(context).focusColor : null, + ), ), - const Icon( - Icons.navigate_next, + Icon( + Icons.navigate_next_rounded, + color: likes.list.isEmpty ? Theme.of(context).focusColor : null, ), ], ), @@ -189,7 +192,7 @@ class _View extends _State with _Bar { ), ListTile( leading: const Icon( - Icons.play_arrow, + Icons.queue_music_rounded, size: 30, ), title: Text( @@ -199,9 +202,14 @@ class _View extends _State with _Bar { children: [ Text( queues.list.length.toString(), - style: Theme.of(context).textTheme.bodyText1, + style: TextStyle( + color: queues.list.isEmpty ? Theme.of(context).focusColor : null, + ), + ), + Icon( + Icons.navigate_next_rounded, + color: queues.list.isEmpty ? Theme.of(context).focusColor : null, ), - const Icon(Icons.navigate_next), ], ), onTap: () { @@ -284,26 +292,32 @@ class _View extends _State with _Bar { itemBuilder: (_, index) { final item = playlists.elementAt(index); + final noTrack = item.list.isEmpty; + return ListTile( contentPadding: const EdgeInsets.symmetric(horizontal: 15, vertical: 0), leading: const WidgetLabel( // icon: Icons.queue_music_rounded, - // icon: Icons.playlist_add, + icon: Icons.playlist_play_rounded, // icon: Icons.playlist_add_check, - icon: Icons.queue_music_rounded, + // icon: Icons.queue_music_rounded, iconSize: 35, ), title: Text( item.name, - style: Theme.of(context).textTheme.bodyText1, ), trailing: Wrap( children: [ Text( item.list.length.toString(), - style: Theme.of(context).textTheme.bodyText1, + style: TextStyle( + color: noTrack ? Theme.of(context).focusColor : null, + ), + ), + Icon( + Icons.navigate_next_rounded, + color: noTrack ? Theme.of(context).focusColor : null, ), - const Icon(Icons.navigate_next), ], ), onTap: () => showDetail(item.key), diff --git a/lib/view/launch/note/main.dart b/lib/view/launch/note/main.dart index 6502708..d7a37f5 100644 --- a/lib/view/launch/note/main.dart +++ b/lib/view/launch/note/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; // import 'package:flutter/services.dart'; diff --git a/lib/view/launch/recent_play/main.dart b/lib/view/launch/recent_play/main.dart index 58eeba8..de9cc5c 100644 --- a/lib/view/launch/recent_play/main.dart +++ b/lib/view/launch/recent_play/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:hive_flutter/hive_flutter.dart'; import 'package:lidea/provider.dart'; diff --git a/lib/view/launch/reorderable/main.dart b/lib/view/launch/reorderable/main.dart index 2dcfd18..7108dcc 100644 --- a/lib/view/launch/reorderable/main.dart +++ b/lib/view/launch/reorderable/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; // import 'package:flutter/gestures.dart'; // import 'package:flutter/services.dart'; diff --git a/lib/view/launch/store/main.dart b/lib/view/launch/store/main.dart index 55b96b9..49b57b6 100644 --- a/lib/view/launch/store/main.dart +++ b/lib/view/launch/store/main.dart @@ -287,7 +287,7 @@ class _View extends _State with _Bar { : null, title: Text( title.replaceAll(RegExp(r'\(.+?\)$'), ""), - style: Theme.of(context).textTheme.headline4!.copyWith(fontSize: 25), + style: Theme.of(context).textTheme.headlineMedium, ), ), Builder( @@ -295,7 +295,7 @@ class _View extends _State with _Bar { if (hasPurchased) { return const SizedBox(); } - return CupertinoButton( + return WidgetButton( padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 20), // minSize: 25, color: Theme.of(context).highlightColor, @@ -342,7 +342,6 @@ class _View extends _State with _Bar { semanticsLabel: description, // textScaleFactor:0.9, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyText2, ), ), ], diff --git a/lib/view/player/main.dart b/lib/view/player/main.dart index 2d00001..0ebeb2b 100644 --- a/lib/view/player/main.dart +++ b/lib/view/player/main.dart @@ -194,7 +194,6 @@ class _PlayerState extends State with TickerProviderStateMixin { content: WidgetLabel( // icon: Icons.warning_rounded, label: preference.language(msg), - labelStyle: Theme.of(context).textTheme.bodyText1, ), ), ) @@ -360,9 +359,11 @@ class _PlayerState extends State with TickerProviderStateMixin { child: StreamBuilder( stream: player.sequenceStateStream, builder: (_, snapshot) => WidgetButton( - child: const WidgetLabel( + child: WidgetLabel( icon: Icons.skip_previous, - message: "Previous", + // message: "Previous", + message: preference.text.previousTo(preference.text.track(false)), + iconSize: 40, ), onPressed: player.hasPrevious ? player.seekToPrevious : null, ), @@ -388,10 +389,11 @@ class _PlayerState extends State with TickerProviderStateMixin { child: StreamBuilder( stream: player.sequenceStateStream, builder: (_, snapshot) => WidgetButton( - child: const WidgetLabel( + child: WidgetLabel( icon: Icons.skip_next, iconSize: 40, - message: "Next", + // message: "Next", + message: preference.text.nextTo(preference.text.track(false)), ), onPressed: player.hasNext ? player.seekToNext : null, ), diff --git a/lib/view/read/main.dart b/lib/view/read/main.dart index f634b02..13e74bf 100644 --- a/lib/view/read/main.dart +++ b/lib/view/read/main.dart @@ -187,9 +187,9 @@ class _View extends _State with _Bar { // key: Key('${verse.keys.first}'), key: verse.keys.first, scrollPhysics: const NeverScrollableScrollPhysics(), - style: Theme.of(context).textTheme.bodyText2!.copyWith( - fontSize: core.collection.fontSize, - ), + style: TextStyle( + fontSize: core.collection.fontSize, + ), ), ), ); diff --git a/lib/view/search/suggest/main.dart b/lib/view/search/suggest/main.dart index c5d258a..9d33194 100644 --- a/lib/view/search/suggest/main.dart +++ b/lib/view/search/suggest/main.dart @@ -389,7 +389,6 @@ class _View extends _State with _Bar { leading: const Icon(CupertinoIcons.arrow_turn_down_right), title: Text( word, - style: Theme.of(context).textTheme.bodyText1, ), // onTap: () => onSearch(word), onTap: () { @@ -487,25 +486,21 @@ class _View extends _State with _Bar { Widget _recentItem(String word) { int hightlight = suggestQuery.length < word.length ? suggestQuery.length : word.length; - return RichText( - // strutStyle: StrutStyle(height: 1.0), - text: TextSpan( + return Text.rich( + TextSpan( text: word.substring(0, hightlight), semanticsLabel: word, style: TextStyle( fontSize: 22, // color: Theme.of(context).highlightColor, color: Theme.of(context).primaryColorDark, - // color: Theme.of(context).textTheme.caption!.color, - // color: Theme.of(context).primaryTextTheme.button!.color, fontWeight: FontWeight.w300, ), children: [ TextSpan( text: word.substring(hightlight), style: TextStyle( - // color: Theme.of(context).primaryTextTheme.button!.color, - color: Theme.of(context).primaryTextTheme.bodyText1!.color, + color: Theme.of(context).highlightColor, ), ) ], @@ -526,9 +521,9 @@ class _View extends _State with _Bar { child: Text( preference.text.delete, textAlign: TextAlign.right, - style: Theme.of(context).textTheme.bodyText1!.copyWith( - color: Theme.of(context).primaryColor, - ), + style: TextStyle( + color: Theme.of(context).primaryColor, + ), ), ), ], diff --git a/lib/view/setting/main.dart b/lib/view/setting/main.dart index ed01389..0ba3573 100644 --- a/lib/view/setting/main.dart +++ b/lib/view/setting/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:lidea/hive.dart'; // import 'package:flutter/rendering.dart'; diff --git a/lib/view/user/main.dart b/lib/view/user/main.dart index cda7199..1b8e7b2 100644 --- a/lib/view/user/main.dart +++ b/lib/view/user/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:flutter/cupertino.dart'; // import 'package:flutter/rendering.dart'; import 'package:lidea/provider.dart'; @@ -221,7 +221,6 @@ class _View extends _State with _Bar { title: WidgetLabel( // alignment: Alignment.centerLeft, label: preference.text.wouldYouLiketoSignIn, - labelStyle: Theme.of(context).textTheme.bodyText1, ), ), Padding( @@ -252,18 +251,10 @@ class _View extends _State with _Bar { return SliverList( delegate: SliverChildListDelegate( [ - // Padding( - // padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 25), - // child: WidgetLabel( - // // label: authenticate.user!.displayName!, - // label: 'Khen Solomon Lethil', - // labelStyle: Theme.of(context).textTheme.headline5, - // ), - // ), WidgetBlockTile( title: WidgetLabel( label: authenticate.user!.displayName!, - labelStyle: Theme.of(context).textTheme.headline5, + labelStyle: Theme.of(context).textTheme.titleLarge, ), ), Padding( @@ -273,7 +264,7 @@ class _View extends _State with _Bar { WidgetLabel( label: authenticate.user!.email!, // label: 'khensolomon@gmail.com', - labelStyle: Theme.of(context).textTheme.overline, + labelStyle: Theme.of(context).textTheme.labelSmall, ), // Text( // authenticate.id,