fix:按照shadcn_ui对着demo_shadcn对齐
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../data/models/models.dart';
|
||||
import '../theme/app_icons.dart';
|
||||
import '../theme/yanting_text.dart';
|
||||
import '../theme/yanting_tokens.dart';
|
||||
import '../theme/wise_tokens.dart';
|
||||
import 'app_buttons.dart';
|
||||
import 'app_card.dart';
|
||||
|
||||
class PlayerStateModel {
|
||||
@@ -126,14 +128,12 @@ class MiniPlayer extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
ShadIconButton.ghost(
|
||||
onPressed: onToggle,
|
||||
icon: Icon(
|
||||
player.playing ? AppIcons.pause : AppIcons.playCircle,
|
||||
size: player.playing ? 24 : 28,
|
||||
),
|
||||
color: YantingColors.foreground,
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -184,13 +184,7 @@ class PlayerCard extends StatelessWidget {
|
||||
style: YantingText.meta.copyWith(fontSize: 12.5),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
LinearProgressIndicator(
|
||||
value: ratio.clamp(0, 1),
|
||||
minHeight: 4,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.pill),
|
||||
backgroundColor: YantingColors.border,
|
||||
color: YantingColors.primary,
|
||||
),
|
||||
ShadProgress(value: ratio.clamp(0, 1)),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -216,18 +210,15 @@ class PlayerCard extends StatelessWidget {
|
||||
children: [
|
||||
_SkipButton(label: '-15', onPressed: () => onSeek(-15)),
|
||||
const SizedBox(width: 26),
|
||||
IconButton.filled(
|
||||
onPressed: active ? onToggle : onStart,
|
||||
icon: Icon(
|
||||
active && player.playing
|
||||
SizedBox(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: AppIconButton(
|
||||
kind: AppButtonKind.primary,
|
||||
onPressed: active ? onToggle : onStart,
|
||||
icon: active && player.playing
|
||||
? AppIcons.pause
|
||||
: AppIcons.play,
|
||||
size: 28,
|
||||
),
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: YantingColors.primary,
|
||||
foregroundColor: YantingColors.primaryForeground,
|
||||
fixedSize: const Size(56, 56),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 26),
|
||||
@@ -236,22 +227,10 @@ class PlayerCard extends StatelessWidget {
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: TextButton(
|
||||
child: ShadButton.outline(
|
||||
size: ShadButtonSize.sm,
|
||||
onPressed: onSpeed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: YantingColors.background,
|
||||
foregroundColor: YantingColors.foreground,
|
||||
side: const BorderSide(color: YantingColors.border),
|
||||
shape: const StadiumBorder(),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
),
|
||||
child: Text(
|
||||
'${player.speed.toStringAsFixed(1)}x',
|
||||
style: YantingText.meta.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
child: Text('${player.speed.toStringAsFixed(1)}x'),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user