diff --git a/lib/view/launch/album-list/sheet.dart b/lib/view/launch/album-list/sheet.dart index 47f1576..f5d62af 100644 --- a/lib/view/launch/album-list/sheet.dart +++ b/lib/view/launch/album-list/sheet.dart @@ -181,9 +181,7 @@ class _SheetFilterState extends State<_SheetFilter> { if (filter.character.length > 6) const TextSpan(text: '...') ], ), - style: Theme.of(context).textTheme.subtitle1!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleMedium, ), ), Card( @@ -206,7 +204,7 @@ class _SheetFilterState extends State<_SheetFilter> { margin: const EdgeInsets.all(2), child: Text( name, - style: Theme.of(context).textTheme.bodyText1!.copyWith( + style: Theme.of(context).textTheme.labelMedium!.copyWith( color: (filter.character.isNotEmpty) ? (hasCharList(name)) ? Theme.of(context).highlightColor @@ -249,9 +247,7 @@ class _SheetFilterState extends State<_SheetFilter> { if (filter.language.length > 7) const TextSpan(text: '...') ], ), - style: Theme.of(context).textTheme.subtitle1!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleMedium, ), ), Card( @@ -287,7 +283,6 @@ class _SheetFilterState extends State<_SheetFilter> { : null, label: lang.name.toTitleCase(), labelPadding: const EdgeInsets.fromLTRB(15, 0, 0, 0), - labelStyle: Theme.of(context).textTheme.bodyText1, softWrap: true, maxLines: 3, ), @@ -322,9 +317,7 @@ class _SheetFilterState extends State<_SheetFilter> { if (filter.genre.length > 1) const TextSpan(text: '...') ], ), - style: Theme.of(context).textTheme.subtitle1!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleMedium, ), ), Card( @@ -360,7 +353,6 @@ class _SheetFilterState extends State<_SheetFilter> { : null, label: genre.name, labelPadding: const EdgeInsets.fromLTRB(15, 0, 0, 0), - labelStyle: Theme.of(context).textTheme.bodyText1, softWrap: true, maxLines: 3, ), @@ -421,16 +413,9 @@ class _SheetFilterState extends State<_SheetFilter> { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - RichText( - strutStyle: const StrutStyle( - // height: 1, - fontFamily: 'Lato', - ), - text: TextSpan( + Text.rich( + TextSpan( text: 'Albums', - // style: TextStyle(color: Theme.of(context).textTheme.bodyText1!.color), - style: Theme.of(context).textTheme.headline5, - // style: Theme.of(context).textTheme.headline3!.copyWith(height: 1.4), children: [ // const TextSpan(text: ' ('), // TextSpan( diff --git a/lib/view/launch/artist-list/sheet.dart b/lib/view/launch/artist-list/sheet.dart index 42b15c9..98537cb 100644 --- a/lib/view/launch/artist-list/sheet.dart +++ b/lib/view/launch/artist-list/sheet.dart @@ -187,9 +187,7 @@ class _SheetFilterState extends State<_SheetFilter> { if (filter.character.length > 6) const TextSpan(text: '...') ], ), - style: Theme.of(context).textTheme.subtitle1!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleMedium, ), ), Card( @@ -212,7 +210,7 @@ class _SheetFilterState extends State<_SheetFilter> { margin: const EdgeInsets.all(2), child: Text( name, - style: Theme.of(context).textTheme.bodyText1!.copyWith( + style: Theme.of(context).textTheme.labelMedium!.copyWith( color: (filter.character.isNotEmpty) ? (hasCharList(name)) ? Theme.of(context).highlightColor @@ -255,9 +253,7 @@ class _SheetFilterState extends State<_SheetFilter> { if (filter.language.length > 7) const TextSpan(text: '...') ], ), - style: Theme.of(context).textTheme.subtitle1!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleMedium, ), ), Card( @@ -296,7 +292,6 @@ class _SheetFilterState extends State<_SheetFilter> { iconColor: active ? null : Theme.of(context).focusColor, label: lang.name.toTitleCase(), labelPadding: const EdgeInsets.fromLTRB(15, 0, 0, 0), - labelStyle: Theme.of(context).textTheme.bodyText1, softWrap: true, maxLines: 3, ), @@ -336,9 +331,7 @@ class _SheetFilterState extends State<_SheetFilter> { if (filter.gender.length > 1) const TextSpan(text: '...') ], ), - style: Theme.of(context).textTheme.subtitle1!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleMedium, ), ), Card( @@ -377,7 +370,6 @@ class _SheetFilterState extends State<_SheetFilter> { iconColor: active ? null : Theme.of(context).focusColor, label: ob.name.toTitleCase(), labelPadding: const EdgeInsets.fromLTRB(15, 0, 0, 0), - labelStyle: Theme.of(context).textTheme.bodyText1, softWrap: true, maxLines: 3, ), @@ -405,16 +397,10 @@ class _SheetFilterState extends State<_SheetFilter> { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - RichText( - strutStyle: const StrutStyle( - // height: 1, - fontFamily: 'Lato', - ), - text: TextSpan( + Text.rich( + TextSpan( text: 'Artists', - // style: TextStyle(color: Theme.of(context).textTheme.bodyText1!.color), - style: Theme.of(context).textTheme.headline5, - // style: Theme.of(context).textTheme.headline3!.copyWith(height: 1.4), + style: Theme.of(context).textTheme.labelMedium, children: [ // const TextSpan(text: ' ('), // TextSpan( diff --git a/lib/view/launch/favorite_word/bar.dart b/lib/view/launch/favorite_word/bar.dart index 471d60c..8b79df5 100644 --- a/lib/view/launch/favorite_word/bar.dart +++ b/lib/view/launch/favorite_word/bar.dart @@ -26,18 +26,18 @@ mixin _Bar on _State { // child: (align == 0) // ? Hero( // tag: 'appbar-left', - // child: CupertinoButton( + // child: WidgetButton( // padding: EdgeInsets.zero, // minSize: 30, // onPressed: () => Navigator.of(context).pop(), // child: WidgetLabel( - // icon: CupertinoIcons.left_chevron, + // icon: Icons.arrow_back_ios_new_rounded, // label: translate.back, // ), // ), // ) // : WidgetLabel( - // icon: CupertinoIcons.left_chevron, + // icon: Icons.arrow_back_ios_new_rounded, // label: translate.back, // ), // ), @@ -57,21 +57,19 @@ mixin _Bar on _State { ? (align == 0) ? Hero( tag: 'appbar-left-$canPop', - child: CupertinoButton( - padding: EdgeInsets.zero, - minSize: 30, + child: WidgetButton( onPressed: () { arguments.navigator!.currentState!.maybePop(); }, child: WidgetLabel( - icon: CupertinoIcons.left_chevron, + icon: Icons.arrow_back_ios_new_rounded, label: preference.text.back, // label: AppLocalizations.of(context)!.back, ), ), ) : WidgetLabel( - icon: CupertinoIcons.left_chevron, + icon: Icons.arrow_back_ios_new_rounded, label: preference.text.back, ) : const SizedBox(), @@ -93,7 +91,7 @@ mixin _Bar on _State { preference.text.favorite(false), style: Theme.of(context) .textTheme - .headline5! + .titleLarge! .copyWith(fontSize: (30 * org.shrink).clamp(22, 30).toDouble()), maxLines: 1, softWrap: false, @@ -109,9 +107,7 @@ mixin _Bar on _State { padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 12), child: Hero( tag: 'appbar-right', - child: CupertinoButton( - padding: EdgeInsets.zero, - minSize: 30, + child: WidgetButton( child: const WidgetLabel( icon: LideaIcon.trash, ), diff --git a/lib/view/launch/library/detail.dart b/lib/view/launch/library/detail.dart index 8c423fb..6608341 100644 --- a/lib/view/launch/library/detail.dart +++ b/lib/view/launch/library/detail.dart @@ -107,7 +107,7 @@ class _DetailState extends State<_Detail> { }, ), // SliverToBoxAdapter( - // child: CupertinoButton( + // child: WidgetButton( // child: const Text('Delete'), // onPressed: () { // // box.deleteAt(index); diff --git a/lib/view/launcher.dart b/lib/view/launcher.dart index d18a5d7..cd5c7c6 100644 --- a/lib/view/launcher.dart +++ b/lib/view/launcher.dart @@ -19,11 +19,9 @@ class ScreenLauncher extends StatelessWidget { text: TextSpan( text: '"', semanticsLabel: "open quotation mark", - style: TextStyle( - color: Theme.of(context).primaryTextTheme.button!.color, - fontSize: 25, - fontWeight: FontWeight.w200, - ), + style: Theme.of(context).textTheme.labelLarge!.copyWith( + fontWeight: FontWeight.w300, + ), children: const [ TextSpan( text: 'Listen', @@ -38,7 +36,10 @@ class ScreenLauncher extends StatelessWidget { TextSpan( text: 'Zaideih\n', semanticsLabel: "Zaideih", - style: TextStyle(fontWeight: FontWeight.w300, fontSize: 47), + style: TextStyle( + fontSize: 50, + fontWeight: FontWeight.w200, + ), ), TextSpan( text: 'Music ', @@ -53,7 +54,7 @@ class ScreenLauncher extends StatelessWidget { TextSpan( text: '"', semanticsLabel: "close quotation mark", - style: TextStyle(fontSize: 25), + style: TextStyle(fontSize: 23), ), ], ), diff --git a/lib/view/player/info.dart b/lib/view/player/info.dart index 55abd96..169b2e9 100644 --- a/lib/view/player/info.dart +++ b/lib/view/player/info.dart @@ -34,16 +34,19 @@ class _PlayerInfoState extends State { AudioTrackType track = tag.trackInfo; return Padding( - padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 15), + padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 15), child: Column( children: [ + const Padding( + padding: EdgeInsets.symmetric(vertical: 15, horizontal: 25), + child: Divider(), + ), Text( track.title, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headline3, ), Padding( - padding: const EdgeInsets.symmetric(vertical: 7), + padding: const EdgeInsets.symmetric(vertical: 25), child: Wrap( alignment: WrapAlignment.center, crossAxisAlignment: WrapCrossAlignment.center, @@ -54,6 +57,7 @@ class _PlayerInfoState extends State { return WidgetButton( child: WidgetLabel( label: artist.name, + labelStyle: Theme.of(context).textTheme.labelLarge, ), onPressed: () { core.navigate(to: '/artist-info', args: artist, routePush: true); @@ -66,7 +70,7 @@ class _PlayerInfoState extends State { child: Text( tag.album, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.displaySmall, ), onPressed: () { core.navigate(to: '/album-info', args: tag.albumInfo); diff --git a/lib/view/player/seek_bar.dart b/lib/view/player/seek_bar.dart index 0235151..54eed62 100644 --- a/lib/view/player/seek_bar.dart +++ b/lib/view/player/seek_bar.dart @@ -120,17 +120,17 @@ class _PlayerSeekBarState extends State { child: Stack( children: [ Align( - alignment: const Alignment(0.90, -0.7), + alignment: const Alignment(0.90, -1), child: Text( core.collection.cacheBucket.duration(_duration.inSeconds), - style: Theme.of(context).textTheme.overline, + style: Theme.of(context).textTheme.labelSmall, ), ), Align( - alignment: const Alignment(-.90, -0.7), + alignment: const Alignment(-.90, -1), child: Text( core.collection.cacheBucket.duration(_remaining.inSeconds), - style: Theme.of(context).textTheme.overline, + style: Theme.of(context).textTheme.labelSmall, ), ), Align( @@ -211,140 +211,6 @@ class _PlayerSeekBarState extends State { }, ); } - - /* - double checkValueTmp(bool isSeek) { - final p = _position.inMilliseconds.toDouble(); - final b = _buffered.inMilliseconds.toDouble(); - double d = _duration.inMilliseconds.toDouble(); - if (d == 0.0 && audio.player.sequence != null) { - final index = audio.player.currentIndex; - final abc = audio.player.sequence!.elementAt(index!); - AudioTrackType track = abc.tag.trackInfo; - d = Duration(seconds: track.duration).inMilliseconds.toDouble(); - } - - if (isSeek) { - if (d > p) { - return d; - } - - return p; - } - - if (d > b) { - return d; - } - - return b; - } - - double checkValue(Duration vCurrent, Duration vMax) { - // _position.inMilliseconds.toDouble() - // value >= min && value <= max - final a = vCurrent.inMilliseconds.toDouble(); - final b = vMax.inMilliseconds.toDouble(); - - if (a < 0.0) { - debugPrint('??? less than $a'); - return 0.0; - } - if (a > b) { - debugPrint('??? greater $a $b'); - return b; - } - - return a; - } - - Widget buildOrg(BuildContext context) { - // print(widget.position.inMilliseconds/widget.duration.inMilliseconds); - return Stack( - children: [ - Align( - alignment: const Alignment(0.90, -1.0), - child: Opacity( - opacity: widget.opacity, - child: Text( - RegExp(r'((^0*[1-9]\d*:)?\d{2}:\d{2})\.\d+$').firstMatch("$_duration")?.group(1) ?? - '$_duration', - style: Theme.of(context).textTheme.caption!.copyWith(fontSize: 12)), - ), - ), - Opacity( - opacity: widget.opacity, - child: Align( - alignment: const Alignment(-.90, -1.0), - child: Text( - RegExp(r'((^0*[1-9]\d*:)?\d{2}:\d{2})\.\d+$').firstMatch("$_remaining")?.group(1) ?? - '$_remaining', - style: Theme.of(context).textTheme.caption!.copyWith(fontSize: 12)), - ), - ), - SliderTheme( - data: _sliderThemeData.copyWith( - thumbShape: HiddenThumbComponentShape(), - overlayShape: RoundSliderOverlayShape(overlayRadius: isCollapsed ? 0.0 : 15.0), - trackHeight: isCollapsed ? 0.2 : 3, - // thumbShape: RoundSliderThumbShape(enabledThumbRadius: 5.0), - // activeTrackColor: Colors.blue, - // inactiveTrackColor: Colors.grey, - // activeTrackColor: Colors.blue.shade100, - // inactiveTrackColor: Colors.grey.shade300, - ), - child: ExcludeSemantics( - child: Slider( - min: 0.0, - max: widget.duration.inMilliseconds.toDouble(), - value: min(widget.bufferedPosition.inMilliseconds.toDouble(), - widget.duration.inMilliseconds.toDouble()), - onChanged: (value) { - setState(() { - _dragValue = value; - }); - if (widget.onChanged != null) { - widget.onChanged!(Duration(milliseconds: value.round())); - } - }, - onChangeEnd: (value) { - if (widget.onChangeEnd != null) { - widget.onChangeEnd!(Duration(milliseconds: value.round())); - } - _dragValue = null; - }, - ), - ), - ), - SliderTheme( - data: _sliderThemeData.copyWith( - inactiveTrackColor: Colors.transparent, - thumbShape: RoundSliderThumbShape(enabledThumbRadius: isCollapsed ? 2.0 : 5.0), - ), - child: Slider( - min: 0.0, - max: widget.duration.inMilliseconds.toDouble(), - value: min(_dragValue ?? widget.position.inMilliseconds.toDouble(), - widget.duration.inMilliseconds.toDouble()), - onChanged: (value) { - setState(() { - _dragValue = value; - }); - if (widget.onChanged != null) { - widget.onChanged!(Duration(milliseconds: value.round())); - } - }, - onChangeEnd: (value) { - if (widget.onChangeEnd != null) { - widget.onChangeEnd!(Duration(milliseconds: value.round())); - } - _dragValue = null; - }, - ), - ), - ], - ); - } - */ } class HiddenThumbComponentShape extends SliderComponentShape { diff --git a/lib/view/read/bar.dart b/lib/view/read/bar.dart index 7d0f092..3e98825 100644 --- a/lib/view/read/bar.dart +++ b/lib/view/read/bar.dart @@ -22,7 +22,7 @@ mixin _Bar on _State { // alignment: const Alignment(-1, 0), child: Hero( tag: 'appbar-left-2', - child: CupertinoButton( + child: WidgetButton( padding: EdgeInsets.zero, child: WidgetLabel( icon: Icons.bookmark_add, @@ -81,17 +81,6 @@ mixin _Bar on _State { right: Radius.elliptical(20, 50), ), ), - // child: CupertinoButton( - // padding: EdgeInsets.zero, - // child: Text( - // '150', - // style: Theme.of(context) - // .textTheme - // .bodyText1! - // .copyWith(fontSize: (org.shrink * 19).clamp(15, 19)), - // ), - // onPressed: () => true, - // ), child: _barButton( label: '150', message: 'Chapter', @@ -114,7 +103,7 @@ mixin _Bar on _State { duration: const Duration(milliseconds: 0), constraints: BoxConstraints(maxWidth: width, minWidth: 30.0), padding: EdgeInsets.symmetric(vertical: snap.shrink * 12), - child: CupertinoButton( + child: WidgetButton( padding: const EdgeInsets.symmetric(horizontal: 3), child: WidgetLabel( icon: LideaIcon.textSize, @@ -141,9 +130,8 @@ mixin _Bar on _State { required void Function()? onPressed}) { return Tooltip( message: message, - child: CupertinoButton( + child: WidgetButton( key: key, - minSize: 33, padding: const EdgeInsets.symmetric(horizontal: 7), child: Text( label, @@ -153,7 +141,7 @@ mixin _Bar on _State { textAlign: TextAlign.center, style: Theme.of(context) .textTheme - .bodyText1! + .labelMedium! .copyWith(fontSize: (shrink * 19).clamp(15, 19)), ), onPressed: onPressed, diff --git a/lib/view/read/optionlist.dart b/lib/view/read/optionlist.dart index 977a26f..d553919 100644 --- a/lib/view/read/optionlist.dart +++ b/lib/view/read/optionlist.dart @@ -79,16 +79,14 @@ class _PopOptionListState extends State with TickerProviderStateM List fontSizeOptions() { return [ - CupertinoButton( + WidgetButton( color: Theme.of(context).primaryColor, borderRadius: const BorderRadius.all(Radius.circular(3)), - // padding: EdgeInsets.zero, padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 30), - minSize: 40, child: Text( 'A', // style: TextStyle(fontSize: 14), - style: Theme.of(context).textTheme.bodyText1!.copyWith( + style: Theme.of(context).textTheme.labelMedium!.copyWith( fontSize: 14, ), ), @@ -109,16 +107,15 @@ class _PopOptionListState extends State with TickerProviderStateM // ], // ), // ), - CupertinoButton( + WidgetButton( color: Theme.of(context).primaryColor, borderRadius: const BorderRadius.all(Radius.circular(3)), padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 30), - minSize: 40, // ignore: prefer_const_constructors child: Text( 'A', // style: TextStyle(fontSize: 25), - style: Theme.of(context).textTheme.bodyText1!, + style: Theme.of(context).textTheme.labelMedium, ), // onPressed: ()=> setFontSize(true) onPressed: () => widget.setFontSize(true)), diff --git a/lib/widget/album_item.dart b/lib/widget/album_item.dart index c98abf7..ffb00e3 100644 --- a/lib/widget/album_item.dart +++ b/lib/widget/album_item.dart @@ -154,12 +154,6 @@ class AlbumListItem extends StatelessWidget { message: name, child: TextButton( style: TextButton.styleFrom( - // textStyle: const TextStyle(fontSize: 15), - // textStyle: Theme.of(context).textTheme.bodyText1!.copyWith( - // // fontSize: 16, - // fontFamily: 'Lato', - // fontWeight: FontWeight.normal, - // ), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), ), child: Column( @@ -202,19 +196,20 @@ class AlbumListItemHolder extends StatelessWidget { Container( width: double.infinity, clipBehavior: Clip.hardEdge, - decoration: const BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(5)), + decoration: BoxDecoration( + // color: Color(0xFFe6e7e8), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(5)), ), child: Stack( alignment: const Alignment(0, 0), - children: const [ + children: [ Align( - alignment: Alignment(0, 0), + alignment: const Alignment(0, 0), child: Icon( LideaIcon.cd, size: 75, - color: Color(0xFFd9dadb), + color: Theme.of(context).shadowColor, ), ), ], @@ -240,28 +235,22 @@ class AlbumListItemHolder extends StatelessWidget { return Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - // const DecoratedBox( - // decoration: const BoxDecoration( - // color: const Color(0xFFe6e7e8), - // borderRadius: const BorderRadius.all(Radius.circular(100)), - // ), - // // child: buttonArt(context) - // child: Text('') - // ), Container( width: double.infinity, - height: 21, - decoration: const BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(100)), + height: 25, + decoration: BoxDecoration( + // color: Color(0xFFe6e7e8), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(100)), ), ), Container( width: double.infinity, - height: 18, - decoration: const BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(100)), + height: 15, + decoration: BoxDecoration( + // color: Color(0xFFe6e7e8), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(100)), ), ) ], @@ -308,7 +297,6 @@ class AlbumPickItem extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 3), child: SizedBox( width: 170, - // height: 170, child: DecoratedBox( decoration: BoxDecoration( color: Theme.of(context).shadowColor, @@ -332,37 +320,28 @@ class AlbumPickItem extends StatelessWidget { alignment: const Alignment(0, -.27), child: SizedBox( child: Icon( - // LideaIcon.play, Icons.play_arrow_rounded, size: 60, color: Theme.of(context).shadowColor, ), ), ), - // Align( - // alignment: Alignment(0, 1.0), - // child: Text('?'), - // ), Container( height: 125, - // width: double.infinity, alignment: Alignment.topCenter, child: buttonArt(context), ), Align( - // alignment: Alignment(0, 1.0), alignment: Alignment.bottomCenter, child: SizedBox( - // TODO ??? height: 56.0, - // width: double.infinity, + width: double.infinity, child: DecoratedBox( - decoration: const BoxDecoration( + decoration: BoxDecoration( border: Border( top: BorderSide( width: 3.0, - // color: Theme.of(context).scaffoldBackgroundColor, - color: Color(0XFFfff0de), + color: Theme.of(context).backgroundColor, ), ), ), @@ -382,13 +361,6 @@ class AlbumPickItem extends StatelessWidget { child: Stack( alignment: Alignment.topCenter, children: [ - // Align( - // alignment: const Alignment(0, -1), - // child: Text( - // genre, - // textAlign: TextAlign.center, - // ), - // ), Align( alignment: const Alignment(0, -0.9), child: Text( @@ -425,9 +397,10 @@ class AlbumPickItem extends StatelessWidget { Widget buttonTitle(BuildContext context) { return WidgetButton( child: WidgetLabel( - label: name, message: name, - labelPadding: const EdgeInsets.symmetric(horizontal: 25, vertical: 2), + label: name, + labelStyle: Theme.of(context).textTheme.labelLarge, + labelPadding: const EdgeInsets.symmetric(horizontal: 15, vertical: 2), ), onPressed: navigate, ); @@ -443,7 +416,6 @@ class AlbumPickItemHolder extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 3), child: SizedBox( width: 170, - // height: 170, child: DecoratedBox( decoration: BoxDecoration( color: Theme.of(context).shadowColor, @@ -452,49 +424,41 @@ class AlbumPickItemHolder extends StatelessWidget { child: Stack( alignment: Alignment.topCenter, // fit: StackFit.loose, - children: const [ + children: [ Align( - alignment: Alignment(0, -.38), + alignment: const Alignment(0, -.40), child: SizedBox( child: Icon( LideaIcon.cd, size: 100, - color: Color(0xFFd9dadb), + color: Theme.of(context).backgroundColor, ), ), ), Align( - alignment: Alignment(0, -.25), + alignment: const Alignment(0, -.27), child: SizedBox( child: Icon( - // LideaIcon.play, Icons.play_arrow_rounded, - size: 55, - color: Color(0xFFe6e7e8), + size: 60, + color: Theme.of(context).shadowColor, ), ), ), - // Align( - // alignment: Alignment(0, 1.0), - // child: Text('?'), - // ), Align( - // alignment: Alignment(0, 1.0), alignment: Alignment.bottomCenter, child: SizedBox( - height: 40.0, + height: 56, width: double.infinity, child: DecoratedBox( decoration: BoxDecoration( border: Border( top: BorderSide( width: 3.0, - // color: Theme.of(context).scaffoldBackgroundColor, - color: Color(0XFFfff0de), + color: Theme.of(context).backgroundColor, ), ), ), - // child: Text(''), ), ), ), @@ -503,15 +467,5 @@ class AlbumPickItemHolder extends StatelessWidget { ), ), ); - // return Container( - // // clipBehavior:Clip.hardEdge, - // margin: const EdgeInsets.all(3), - // width: 170, - // decoration: const BoxDecoration( - // color: Color(0xFFe6e7e8), - // borderRadius: BorderRadius.all(Radius.circular(5)), - // ), - // child: - // ); } } diff --git a/lib/widget/artist_item.dart b/lib/widget/artist_item.dart index 84d4f91..54da7c4 100644 --- a/lib/widget/artist_item.dart +++ b/lib/widget/artist_item.dart @@ -23,38 +23,24 @@ class ArtistListItem extends StatelessWidget { leading: DecoratedBox( decoration: BoxDecoration( color: Theme.of(context).backgroundColor, - // color: Theme.of(context).backgroundColor, - // borderRadius: BorderRadius.circular(3), borderRadius: BorderRadius.circular(8), - // borderRadius: BorderRadius.all(Radius.circular(8)), ), child: const Padding( padding: EdgeInsets.all(7.0), child: Icon( - // playing?LideaIcon.pause:LideaIcon.play, LideaIcon.artist, - // color: queued?Theme.of(context).highlightColor:null, - // color: Theme.of(context).primaryColor, size: 25, ), ), ), - // title: Text('meta.title', - // strutStyle: const StrutStyle( - // height: 1.0 - // ), - // ), - title: RichText( - // textAlign: TextAlign.center, - strutStyle: const StrutStyle(height: 1.0), - text: TextSpan( + title: Text.rich( + TextSpan( text: name, - style: Theme.of(context).textTheme.subtitle1!.copyWith(height: 1.3), children: [ if (aka.isNotEmpty) TextSpan( text: ' ($aka)', - style: Theme.of(context).textTheme.subtitle2!.copyWith(height: 1.3), + style: Theme.of(context).textTheme.labelMedium, ), ], ), @@ -73,11 +59,7 @@ class ArtistListItem extends StatelessWidget { trailing: Text( intl.NumberFormat.compact().format(plays), // strutStyle: const StrutStyle(height: 1.5), - style: Theme.of(context).textTheme.bodyText1!.copyWith( - // fontSize: 13, - fontFamily: 'Lato', - // fontWeight: FontWeight.normal, - ), + style: Theme.of(context).textTheme.labelSmall, ), onTap: () => core.navigate(to: '/artist-info', args: meta, routePush: false), ); @@ -88,37 +70,29 @@ class ArtistListItem extends StatelessWidget { IconData icon, String label, ) { - // return Chip( - // padding: EdgeInsets.zero, - // // labelPadding: EdgeInsets.zero, - // // avatar: CircleAvatar( - // // backgroundColor: Colors.grey.shade800, - // // child: const Text('AB'), - // // ), - // avatar: Icon(icon,size: 14,), - // label: Text(label.toString()), - // ); - return Row( - children: [ - Icon( - icon, - size: 15, - // color: Theme.of(context).textTheme.caption!.color!.withOpacity(0.5), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 3), - child: Text( - label, - // strutStyle: const StrutStyle(height: 1.2), - style: Theme.of(context).textTheme.bodyText2!.copyWith( - fontSize: 13, - fontFamily: 'Lato', - fontWeight: FontWeight.normal, - ), - ), - ), - ], + return WidgetLabel( + icon: icon, + iconColor: Theme.of(context).focusColor, + iconSize: 15, + label: label, + labelStyle: Theme.of(context).textTheme.bodySmall, ); + // return Row( + // children: [ + // Icon( + // icon, + // size: 15, + // ), + // Padding( + // padding: const EdgeInsets.symmetric(horizontal: 3), + // child: Text( + // label, + // // strutStyle: const StrutStyle(height: 1.2), + // style: Theme.of(context).textTheme.bodySmall, + // ), + // ), + // ], + // ); } } @@ -127,14 +101,15 @@ class ArtistListItemHolder extends StatelessWidget { @override Widget build(BuildContext context) { - return const ListTile( + return ListTile( minVerticalPadding: 0, leading: DecoratedBox( decoration: BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(8)), + // color: Color(0xFFe6e7e8), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(8)), ), - child: Padding( + child: const Padding( padding: EdgeInsets.all(7.0), child: Icon( LideaIcon.artist, @@ -143,20 +118,20 @@ class ArtistListItemHolder extends StatelessWidget { ), ), title: SizedBox( - height: 18.0, + height: 19.0, child: DecoratedBox( decoration: BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(100)), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(100)), ), ), ), subtitle: SizedBox( - height: 10.0, + height: 12.0, child: DecoratedBox( decoration: BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(100)), + color: Theme.of(context).backgroundColor.withOpacity(0.7), + borderRadius: const BorderRadius.all(Radius.circular(100)), ), ), ), @@ -181,9 +156,6 @@ class ArtistWrapItem extends StatelessWidget { key: key, child: WidgetLabel( label: artist.name, - // labelStyle: Theme.of(context).textTheme.subtitle2!.copyWith( - // fontSize: 15, - // ), message: '* (??)' .replaceFirst('*', artist.name) .replaceFirst('??', artist.aka) @@ -219,7 +191,6 @@ class ArtistWrapMore extends StatelessWidget { key: key, child: WidgetLabel( label: more.replaceFirst('*', count.toString()).replaceFirst('?', total.toString()), - // labelStyle: Theme.of(context).textTheme.bodyText1, ), color: Theme.of(context).shadowColor, borderRadius: const BorderRadius.all(Radius.circular(100.0)), @@ -227,20 +198,5 @@ class ArtistWrapMore extends StatelessWidget { // minSize: 35, onPressed: onPressed, ); - /* - return CupertinoButton( - key: key, - child: Text( - more.replaceFirst('*', count.toString()).replaceFirst('?', total.toString()), - style: Theme.of(context).textTheme.subtitle2!.copyWith(fontSize: 15, height: 1), - strutStyle: const StrutStyle(height: 1.3), - ), - color: Theme.of(context).shadowColor, - borderRadius: const BorderRadius.all(Radius.circular(100.0)), - padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 17), - minSize: 35, - onPressed: onPressed, - ); - */ } } diff --git a/lib/widget/attribute.dart b/lib/widget/attribute.dart index 028e203..c908abd 100644 --- a/lib/widget/attribute.dart +++ b/lib/widget/attribute.dart @@ -26,30 +26,13 @@ class ButtonWithLabelAttribute extends StatelessWidget { @override Widget build(BuildContext context) { - return CupertinoButton( - key: key, - // color: Theme.of(context).chipTheme.selectedColor, - // color: Theme.of(context).primaryColor, - // padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 7), - padding: EdgeInsets.zero, - alignment: Alignment.center, - minSize: 40, - child: RichText( - maxLines: 1, + return WidgetButton( + child: WidgetLabel( + icon: icon, + iconSize: 22, + label: label, overflow: TextOverflow.fade, - // strutStyle: const StrutStyle(height: 1.3), - text: TextSpan( - style: Theme.of(context).textTheme.subtitle1!.copyWith(height: 1.0, fontSize: 19), - // style: TextStyle(height: 1.0, fontSize: 19), - children: [ - WidgetSpan( - child: Icon(icon, size: 22), - ), - TextSpan( - text: label, - ), - ], - ), + maxLines: 1, ), onPressed: onPressed, ); @@ -82,7 +65,7 @@ class LabelAttribute extends StatelessWidget { textAlign: TextAlign.center, strutStyle: const StrutStyle(height: 1.5), text: TextSpan( - style: Theme.of(context).textTheme.subtitle1!.copyWith(height: 1.25, fontSize: 19), + style: Theme.of(context).textTheme.labelMedium, // style: TextStyle(height: 1.0, fontSize: 19), children: [ if (icon != null && iconLeft == true) @@ -117,15 +100,12 @@ class ButtonAttribute extends StatelessWidget { @override Widget build(BuildContext context) { - return CupertinoButton( - key: key, - // color: Theme.of(context).chipTheme.selectedColor, - // color: Theme.of(context).primaryColor, - // padding: EdgeInsets.symmetric(vertical: 5, horizontal: 15), - padding: EdgeInsets.zero, - alignment: alignment, - minSize: 40, - child: Icon(icon, size: 22), + return WidgetButton( + child: WidgetLabel( + icon: icon, + iconSize: 22, + alignment: alignment, + ), onPressed: onPressed, ); } @@ -148,7 +128,7 @@ class PageAttribute extends StatelessWidget { maxLines: 1, softWrap: false, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1!.copyWith(height: 1.3, fontSize: fontSize), + style: Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: fontSize), ), ); } @@ -174,7 +154,7 @@ class TitleAttribute extends StatelessWidget { children: [ Text( text, - style: Theme.of(context).textTheme.headline1, + style: Theme.of(context).textTheme.displayLarge, textAlign: TextAlign.center, ), if (aka != null && aka!.isNotEmpty) @@ -184,45 +164,16 @@ class TitleAttribute extends StatelessWidget { children: [ TextSpan( text: '($aka)', - style: Theme.of(context).textTheme.bodyText1!.copyWith( + style: Theme.of(context).textTheme.labelMedium!.copyWith( fontWeight: FontWeight.w300, ), ), ], ), - style: Theme.of(context).textTheme.headline6!.copyWith( - fontWeight: FontWeight.w300, - ), + style: Theme.of(context).textTheme.titleLarge, ) ], ), - /* - child: RichText( - textAlign: TextAlign.center, - // strutStyle: const StrutStyle(height: 1.9), - text: TextSpan( - text: text, - style: Theme.of(context).textTheme.headline1, - children: [ - if (aka != null && aka!.isNotEmpty) - TextSpan( - text: '\n($aka)', - style: Theme.of(context).textTheme.subtitle2!.copyWith( - // height: 1.3, - // fontSize: 25, - shadows: [ - Shadow( - blurRadius: 1.0, - color: Theme.of(context).shadowColor, - offset: const Offset(1.0, 0.0), - ), - ], - ), - ), - ], - ), - ), - */ ); } } @@ -248,10 +199,7 @@ class YearWrap extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 4), child: Text( e, - style: Theme.of(context).textTheme.headline6!.copyWith( - fontFamily: 'Lato', - fontSize: 15, - ), + style: Theme.of(context).textTheme.labelSmall, ), ), ) @@ -269,21 +217,16 @@ class YearAttribute extends StatelessWidget { @override Widget build(BuildContext context) { - // return Text(text,key: key,style: Theme.of(context).textTheme.bodyText1); return Container( key: key, - padding: const EdgeInsets.symmetric(vertical: 7, horizontal: 14), - decoration: BoxDecoration( - color: Theme.of(context).splashColor, - borderRadius: BorderRadius.circular(3), - ), + // padding: const EdgeInsets.symmetric(vertical: 7, horizontal: 14), + // decoration: BoxDecoration( + // color: Theme.of(context).splashColor, + // borderRadius: BorderRadius.circular(3), + // ), child: Text( text, - // style: Theme.of(context).textTheme.caption!.copyWith( - // height: 1.0 - // ), style: const TextStyle(fontSize: 14), - strutStyle: const StrutStyle(height: 1.0), ), ); } @@ -327,7 +270,7 @@ class GenreAttribute extends StatelessWidget { @override Widget build(BuildContext context) { - return Text(text, key: key, style: Theme.of(context).textTheme.bodyText1); + return Text(text, key: key, style: Theme.of(context).textTheme.labelMedium); } } @@ -357,7 +300,6 @@ class StaticBadgeAttribute extends StatelessWidget { padding: const EdgeInsets.only(top: 12), child: Text( label, - // style: Theme.of(context).textTheme.caption!.copyWith(fontWeight: FontWeight.w600), style: Theme.of(context).textTheme.labelSmall, ), ), @@ -376,19 +318,6 @@ class PlayAllAttribute extends StatelessWidget { @override Widget build(BuildContext context) { - // return Padding( - // key: key, - // padding: const EdgeInsets.symmetric(vertical: 20), - // child: CupertinoButton( - // child: Text( - // label, - // style: Theme.of(context).textTheme.bodyText1, - // ), - // borderRadius: const BorderRadius.all(Radius.circular(100)), - // // color: Theme.of(context).buttonColor, - // onPressed: onPressed, - // ), - // ); return WidgetButton( // elevation: 1, margin: const EdgeInsets.symmetric(vertical: 20), @@ -402,8 +331,7 @@ class PlayAllAttribute extends StatelessWidget { // textStyle: TextStyle( // color: Theme.of(context).primaryColor, // ), - textStyle: Theme.of(context).textTheme.bodyText1!.copyWith( - fontSize: 25, + textStyle: Theme.of(context).textTheme.labelLarge!.copyWith( color: Theme.of(context).primaryColor, ), child: Text( diff --git a/lib/widget/common.dart b/lib/widget/common.dart index 7c44fdd..6a3b40b 100644 --- a/lib/widget/common.dart +++ b/lib/widget/common.dart @@ -38,42 +38,6 @@ class WidgetBlockMore extends StatelessWidget { onPressed: onPressed, ), ); - // return Padding( - // padding: padding, - // child: Row( - // // mainAxisAlignment: mainAxisAlignment, - // mainAxisAlignment: MainAxisAlignment.center, - // // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // WidgetButton( - // // decoration: BoxDecoration( - // // color: Theme.of(context).shadowColor, - // // borderRadius: const BorderRadius.all(Radius.circular(100)), - // // ), - // color: Theme.of(context).shadowColor, - // borderRadius: const BorderRadius.all(Radius.circular(100)), - // elevation: 2, - // // clipBehavior: Clip.antiAlias, - // padding: const EdgeInsets.symmetric(horizontal: 15), - // child: WidgetLabel( - // // alignment: Alignment.center, - // label: more.replaceFirst('*', count.toString()).replaceFirst('?', total.toString()), - // labelStyle: Theme.of(context).textTheme.bodyText1, - // ), - // onPressed: onPressed, - // ) - // // WidgetLabel( - // // alignment: Alignment.centerLeft, - // // label: label, - // // ), - // // if (more != null) - // // WidgetButton( - // // child: more!, - // // onPressed: onPressed, - // // ) - // ], - // ), - // ); } } diff --git a/lib/widget/playlists_editor.dart b/lib/widget/playlists_editor.dart index 84b02f5..c937463 100644 --- a/lib/widget/playlists_editor.dart +++ b/lib/widget/playlists_editor.dart @@ -86,15 +86,11 @@ class _PlayListsEditorState extends State { // buttonPadding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), // actionsAlignment: MainAxisAlignment.spaceBetween, actions: [ - // CupertinoButton - - // const Divider(), WidgetButton( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 7), child: Text( preference.text.cancel, // style: DefaultTextStyle.of(context).style, - // style: Theme.of(context).textTheme.button, ), onPressed: () => Navigator.of(context).pop(false), ), @@ -145,7 +141,7 @@ class _PlayListsEditorState extends State { }, decoration: InputDecoration( labelText: preference.text.title(false), - floatingLabelStyle: Theme.of(context).textTheme.subtitle1, + floatingLabelStyle: Theme.of(context).textTheme.titleSmall, floatingLabelBehavior: FloatingLabelBehavior.always, prefixIcon: const Icon(Icons.gesture), prefixIconConstraints: BoxConstraints.tight(const Size(25, 25)), diff --git a/lib/widget/track_item.dart b/lib/widget/track_item.dart index df4f7ab..466a1b0 100644 --- a/lib/widget/track_item.dart +++ b/lib/widget/track_item.dart @@ -107,32 +107,7 @@ class TrackListItem extends StatelessWidget { }) { return ListTile( key: key, - // contentPadding: EdgeInsets.zero, minVerticalPadding: 0, - // style: ListTileStyle.drawer, - /* - leading: DecoratedBox( - decoration: BoxDecoration( - color: queued ? Theme.of(context).highlightColor : Theme.of(context).backgroundColor, - // color: Theme.of(context).backgroundColor, - borderRadius: BorderRadius.circular(5), - ), - child: Padding( - padding: const EdgeInsets.all(7.0), - child: Icon( - // playing?ZaideihIcon.pause:ZaideihIcon.play, - playing - ? LideaIcon.pause - : queued - ? LideaIcon.play - : Icons.playlist_add, - // color: queued?Theme.of(context).highlightColor:null, - // color: Theme.of(context).primaryColor, - size: 25, - ), - ), - ), - */ leading: WidgetButton( padding: const EdgeInsets.all(10.0), decoration: BoxDecoration( @@ -148,8 +123,6 @@ class TrackListItem extends StatelessWidget { ? Icons.play_arrow_rounded : Icons.playlist_add_rounded, // color: queued?Theme.of(context).highlightColor:null, - // color: Theme.of(context).primaryColor, - // size: 25, ), onPressed: onPress, ), @@ -157,7 +130,6 @@ class TrackListItem extends StatelessWidget { track.title, maxLines: 1, overflow: TextOverflow.ellipsis, - // style: Theme.of(context).textTheme.bodyText1, ), subtitle: Text( track.artist, @@ -166,11 +138,6 @@ class TrackListItem extends StatelessWidget { trailing: Text( cache.duration(track.trackInfo.duration), style: Theme.of(context).textTheme.labelSmall, - // style: Theme.of(context).textTheme.headline6!.copyWith( - // fontSize: 14, - // fontFamily: 'Lato', - // fontWeight: FontWeight.normal, - // ), ), onTap: onPress, onLongPress: () => showPlaylistEditor(context), @@ -183,36 +150,35 @@ class TrackListItemHolder extends StatelessWidget { @override Widget build(BuildContext context) { - return const ListTile( + return ListTile( minVerticalPadding: 0, leading: DecoratedBox( decoration: BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(5)), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(5)), ), - child: Padding( + child: const Padding( padding: EdgeInsets.all(7.0), child: Icon( Icons.playlist_add, - size: 25, ), ), ), title: SizedBox( - height: 18.0, + height: 19.0, child: DecoratedBox( decoration: BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(100)), + color: Theme.of(context).backgroundColor, + borderRadius: const BorderRadius.all(Radius.circular(100)), ), ), ), subtitle: SizedBox( - height: 18.0, + height: 12.0, child: DecoratedBox( decoration: BoxDecoration( - color: Color(0xFFe6e7e8), - borderRadius: BorderRadius.all(Radius.circular(100)), + color: Theme.of(context).backgroundColor.withOpacity(0.7), + borderRadius: const BorderRadius.all(Radius.circular(100)), ), ), ), diff --git a/lib/widget/track_option.dart b/lib/widget/track_option.dart index eaac3f1..cb1fd15 100644 --- a/lib/widget/track_option.dart +++ b/lib/widget/track_option.dart @@ -64,40 +64,6 @@ class _TrackOptionState extends State { // collapsedHeight: kToolbarHeight, // expandedHeight: 90, title: Text(preference.text.track(false)), - /* - flexibleSpace: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - var top = constraints.biggest.height; - return FlexibleSpaceBar( - // centerTitle: true, - collapseMode: CollapseMode.none, - title: Column( - mainAxisSize: MainAxisSize.min, - // mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - track.title, - // track.title + track.title + track.title + track.title, - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: Theme.of(context).textTheme.bodyText1, - ), - if (top > 64) - Text( - track.artist, - overflow: TextOverflow.ellipsis, - // maxLines: top > 71 && top < 91 ? 3 : 1, - maxLines: 1, - - style: Theme.of(context).textTheme.bodyText1!.copyWith(fontSize: 12), - ), - ], - ), - ); - }, - ), - */ ); }, ), @@ -193,7 +159,7 @@ class _TrackOptionState extends State { const TextSpan(text: '"'), TextSpan( text: track.album, - style: Theme.of(context).textTheme.headline3!.copyWith(fontSize: 20), + style: const TextStyle(fontSize: 20), recognizer: TapGestureRecognizer() ..onTap = () { Navigator.of(context).pop; @@ -206,38 +172,29 @@ class _TrackOptionState extends State { const TextSpan(text: '", '), TextSpan( text: 'duration: ', - style: Theme.of(context).textTheme.bodyText1!.copyWith( - color: Theme.of(context).primaryColorDark, - ), + style: TextStyle( + color: Theme.of(context).primaryColorDark, + ), children: [ TextSpan( text: cache.duration(track.trackInfo.duration), - // style: const TextStyle(fontFamily: 'Lato'), - style: Theme.of(context).textTheme.bodyText1!.copyWith( - fontFamily: 'Lato', - ), ), ], ), TextSpan( text: ' plays: ', - style: Theme.of(context).textTheme.bodyText1!.copyWith( - color: Theme.of(context).primaryColorDark, - ), + style: TextStyle( + color: Theme.of(context).primaryColorDark, + ), children: [ TextSpan( text: track.trackInfo.plays.toString(), - style: Theme.of(context).textTheme.bodyText1!.copyWith( - fontFamily: 'Lato', - ), ), ], ), ], ), - style: Theme.of(context).textTheme.bodyText1!.copyWith( - fontFamily: 'Lato', - ), + style: Theme.of(context).textTheme.labelMedium, ), onTap: () { if (hasLike) { @@ -310,15 +267,9 @@ class _TrackOptionState extends State { ), title: Text( item.name, - style: Theme.of(context).textTheme.bodyText1, ), trailing: Text( item.list.length.toString(), - style: Theme.of(context).textTheme.headline6!.copyWith( - fontSize: 15, - fontFamily: 'Lato', - fontWeight: FontWeight.normal, - ), ), onTap: () { if (hasAdded) {