fix:按照shadcn_ui对着demo_shadcn对齐

This commit is contained in:
jingyun
2026-06-05 15:04:39 +08:00
parent 9727b906c6
commit c5288f397d
29 changed files with 1425 additions and 642 deletions
+28 -2
View File
@@ -1,17 +1,18 @@
import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import '../data/providers.dart';
import '../features/detail/report_detail_page.dart';
import '../features/feed/feed_page.dart';
import '../features/home/home_page.dart';
import '../features/institutions/institution_detail_page.dart';
import '../features/institutions/institutions_page.dart';
import '../features/listen/listen_page.dart';
import '../features/profile/profile_page.dart';
import '../features/reports/reports_page.dart';
import '../features/shell_page.dart';
import '../theme/wise_tokens.dart';
import 'app_routes.dart';
final routerProvider = Provider<GoRouter>((ref) {
@@ -46,6 +47,28 @@ final routerProvider = Provider<GoRouter>((ref) {
),
),
),
GoRoute(
path: AppRoutes.homeFeed,
builder: (context, state) => _TabSurface(
child: Consumer(
builder: (context, ref, _) {
final player = ref.watch(audioPlayerControllerProvider);
final controller = ref.read(
audioPlayerControllerProvider.notifier,
);
return HomePage(
dataSource: dataSource,
onPlay: controller.startFromItem,
player: player,
onStartModuleAudio: controller.startModuleAudio,
onToggleAudio: controller.toggleAudio,
onSeekAudio: controller.seekAudio,
onSpeed: controller.cycleSpeed,
);
},
),
),
),
GoRoute(
path: AppRoutes.reports,
builder: (context, state) => _TabSurface(
@@ -142,6 +165,9 @@ class _TabSurface extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ColoredBox(color: WiseColors.canvas, child: child);
return ColoredBox(
color: ShadTheme.of(context).colorScheme.background,
child: child,
);
}
}
+2 -6
View File
@@ -7,6 +7,7 @@ import '../widgets/mini_player.dart';
abstract final class AppRoutes {
static const home = '/';
static const homeFeed = '/feed';
static const reports = '/reports';
static const institutions = '/institutions';
static const listen = '/listen';
@@ -53,12 +54,7 @@ void openReportDetail(
ReportDataSource dataSource,
ReportCardModel report, {
PlayerStateModel player = const PlayerStateModel(),
void Function(
String audioId,
String reportId,
String title,
int durationSec,
)?
void Function(String audioId, String reportId, String title, int durationSec)?
onStartAudio,
VoidCallback? onToggleAudio,
void Function(int delta)? onSeekAudio,