opt: color scheme

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-14 13:38:24 +08:00
parent bc0914e146
commit 4e7cf0a1bd
5 changed files with 90 additions and 104 deletions

View File

@@ -42,8 +42,8 @@ class PBadge extends StatelessWidget {
color = Colors.white; color = Colors.white;
} }
if (type == 'color') { if (type == 'color') {
bgColor = t.primaryContainer.withOpacity(0.5); bgColor = t.secondaryContainer.withOpacity(0.5);
color = t.primary; color = t.onSecondaryContainer;
} }
if (type == 'line') { if (type == 'line') {
bgColor = Colors.transparent; bgColor = Colors.transparent;

View File

@@ -221,11 +221,7 @@ class MyApp extends StatelessWidget {
titleTextStyle: TextStyle(fontSize: 16, color: colorScheme.onSurface), titleTextStyle: TextStyle(fontSize: 16, color: colorScheme.onSurface),
), ),
navigationBarTheme: NavigationBarThemeData( navigationBarTheme: NavigationBarThemeData(
surfaceTintColor: isDynamic surfaceTintColor: isDynamic ? colorScheme.onSurfaceVariant : null,
? colorScheme.surfaceTint
: isDark
? colorScheme.surfaceTint
: null,
), ),
snackBarTheme: SnackBarThemeData( snackBarTheme: SnackBarThemeData(
actionTextColor: colorScheme.primary, actionTextColor: colorScheme.primary,
@@ -242,27 +238,16 @@ class MyApp extends StatelessWidget {
}, },
), ),
popupMenuTheme: PopupMenuThemeData( popupMenuTheme: PopupMenuThemeData(
surfaceTintColor: surfaceTintColor: isDynamic ? colorScheme.onSurfaceVariant : null,
isDynamic || variant == FlexSchemeVariant.material3Legacy
? isDark
? colorScheme.surfaceTint
: null
: null,
), ),
cardTheme: CardTheme( cardTheme: CardTheme(
elevation: 1, elevation: 1,
surfaceTintColor: isDynamic surfaceTintColor: isDark ? colorScheme.onSurfaceVariant : null,
? colorScheme.surfaceTint
: variant == FlexSchemeVariant.material3Legacy
? isDark
? colorScheme.surfaceTint
: null
: null,
shadowColor: Colors.transparent, shadowColor: Colors.transparent,
), ),
dialogTheme: DialogTheme( // dialogTheme: DialogTheme(
surfaceTintColor: isDark ? colorScheme.surfaceTint : null, // surfaceTintColor: isDark ? colorScheme.onSurfaceVariant : null,
), // ),
progressIndicatorTheme: ProgressIndicatorThemeData( progressIndicatorTheme: ProgressIndicatorThemeData(
refreshBackgroundColor: colorScheme.onSecondary, refreshBackgroundColor: colorScheme.onSecondary,
), ),

View File

@@ -101,10 +101,8 @@ class UserInfoCard extends StatelessWidget {
_buildLeft(BuildContext context) => [ _buildLeft(BuildContext context) => [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Wrap( child: FittedBox(
spacing: 5, child: Row(
runSpacing: 8,
crossAxisAlignment: WrapCrossAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () => Utils.copyText(card.name ?? ''), onTap: () => Utils.copyText(card.name ?? ''),
@@ -121,21 +119,26 @@ class UserInfoCard extends StatelessWidget {
), ),
), ),
), ),
const SizedBox(width: 8),
Image.asset( Image.asset(
'assets/images/lv/lv${card.levelInfo?.currentLevel}.png', 'assets/images/lv/lv${card.levelInfo?.currentLevel}.png',
height: 11, height: 11,
semanticLabel: '等级${card.levelInfo?.currentLevel}', semanticLabel: '等级${card.levelInfo?.currentLevel}',
), ),
if (card.vip?.vipStatus == 1) if (card.vip?.vipStatus == 1) ...[
const SizedBox(width: 8),
CachedNetworkImage( CachedNetworkImage(
imageUrl: card.vip!.label!.image!, imageUrl: card.vip!.label!.image!,
height: 20, height: 20,
), ),
// if (card.nameplate?.image?.isNotEmpty == true) ],
// CachedNetworkImage( if (card.nameplate?.image?.isNotEmpty == true) ...[
// imageUrl: card.nameplate!.image!, const SizedBox(width: 8),
// height: 20, CachedNetworkImage(
// ), imageUrl: card.nameplate!.image!,
height: 20,
),
],
// GestureDetector( // GestureDetector(
// onTap: () { // onTap: () {
// Utils.copyText(card.mid.toString()); // Utils.copyText(card.mid.toString());
@@ -166,6 +169,7 @@ class UserInfoCard extends StatelessWidget {
], ],
), ),
), ),
),
if (card.officialVerify?.desc?.isNotEmpty == true) if (card.officialVerify?.desc?.isNotEmpty == true)
Padding( Padding(
padding: const EdgeInsets.only(left: 20, top: 8, right: 20), padding: const EdgeInsets.only(left: 20, top: 8, right: 20),
@@ -275,9 +279,7 @@ class UserInfoCard extends StatelessWidget {
children: List.generate( children: List.generate(
5, 5,
(index) => index % 2 == 0 (index) => index % 2 == 0
? Padding( ? _countWidget(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: _countWidget(
title: ['粉丝', '关注', '获赞'][index ~/ 2], title: ['粉丝', '关注', '获赞'][index ~/ 2],
count: index == 0 count: index == 0
? card.fans ? card.fans
@@ -286,14 +288,12 @@ class UserInfoCard extends StatelessWidget {
: card.likes?.likeNum ?? 0, : card.likes?.likeNum ?? 0,
onTap: () { onTap: () {
if (index == 0) { if (index == 0) {
Get.toNamed( Get.toNamed('/fan?mid=${card.mid}&name=${card.name}');
'/fan?mid=${card.mid}&name=${card.name}');
} else if (index == 2) { } else if (index == 2) {
Get.toNamed( Get.toNamed(
'/follow?mid=${card.mid}&name=${card.name}'); '/follow?mid=${card.mid}&name=${card.name}');
} }
}, },
),
) )
: SizedBox( : SizedBox(
height: 15, height: 15,
@@ -462,6 +462,7 @@ class UserInfoCard extends StatelessWidget {
child: _buildBadge(context), child: _buildBadge(context),
), ),
Positioned( Positioned(
left: 120,
top: 140, top: 140,
right: 20, right: 20,
child: _buildRight(context), child: _buildRight(context),

View File

@@ -686,7 +686,7 @@ class ReplyItem extends StatelessWidget {
TextSpan( TextSpan(
text: matchStr, text: matchStr,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary.withOpacity(0.8),
), ),
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
..onTap = () { ..onTap = () {

View File

@@ -709,7 +709,7 @@ class ReplyItemGrpc extends StatelessWidget {
TextSpan( TextSpan(
text: matchStr, text: matchStr,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary.withOpacity(0.8),
), ),
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
..onTap = () { ..onTap = () {