fix:按照shadcn_ui对着demo_shadcn对齐
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user