Skip to content

Commit

Permalink
remove cupertino
Browse files Browse the repository at this point in the history
  • Loading branch information
Khen Solomon Lethil committed Feb 16, 2022
1 parent 956455a commit 26662ef
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 90 deletions.
2 changes: 1 addition & 1 deletion lib/view/launch/album-list/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/view/launch/article/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/view/launch/artist-info/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/view/launch/artist-list/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
10 changes: 5 additions & 5 deletions lib/view/launch/blog/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -94,21 +94,21 @@ class _View extends _State with _Bar {
SliverList(
delegate: SliverChildListDelegate(
<Widget>[
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'),
),
Expand Down
35 changes: 4 additions & 31 deletions lib/view/launch/home/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
),
Expand Down Expand Up @@ -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,
),
),
),
Expand Down Expand Up @@ -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),
);
Expand All @@ -535,31 +534,6 @@ class _View extends _State with _Bar, _Refresh {
}

Widget researchWrap(List<MapEntry<dynamic, RecentSearchType>> items) {
// return Selector<Core, List<MapEntry<dynamic, RecentSearchType>>>(
// selector: (_, e) => e.collection.recentSearches.toList(),
// builder: (BuildContext _, List<MapEntry<dynamic, RecentSearchType>> 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,
Expand All @@ -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),
);
Expand Down
38 changes: 26 additions & 12 deletions lib/view/launch/library/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
),
],
),
Expand All @@ -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(
Expand All @@ -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: () {
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/launch/note/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/view/launch/recent_play/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/view/launch/reorderable/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
5 changes: 2 additions & 3 deletions lib/view/launch/store/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,15 @@ 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(
builder: (BuildContext _) {
if (hasPurchased) {
return const SizedBox();
}
return CupertinoButton(
return WidgetButton(
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 20),
// minSize: 25,
color: Theme.of(context).highlightColor,
Expand Down Expand Up @@ -342,7 +342,6 @@ class _View extends _State with _Bar {
semanticsLabel: description,
// textScaleFactor:0.9,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyText2,
),
),
],
Expand Down
12 changes: 7 additions & 5 deletions lib/view/player/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class _PlayerState extends State<Player> with TickerProviderStateMixin {
content: WidgetLabel(
// icon: Icons.warning_rounded,
label: preference.language(msg),
labelStyle: Theme.of(context).textTheme.bodyText1,
),
),
)
Expand Down Expand Up @@ -360,9 +359,11 @@ class _PlayerState extends State<Player> with TickerProviderStateMixin {
child: StreamBuilder<SequenceState?>(
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,
),
Expand All @@ -388,10 +389,11 @@ class _PlayerState extends State<Player> with TickerProviderStateMixin {
child: StreamBuilder<SequenceState?>(
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,
),
Expand Down
6 changes: 3 additions & 3 deletions lib/view/read/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
),
);
Expand Down
17 changes: 6 additions & 11 deletions lib/view/search/suggest/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: () {
Expand Down Expand Up @@ -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>[
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,
),
)
],
Expand All @@ -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,
),
),
),
],
Expand Down
2 changes: 1 addition & 1 deletion lib/view/setting/main.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Loading

0 comments on commit 26662ef

Please sign in to comment.