♻️ Turn thought into a Tab

This commit is contained in:
2025-11-15 23:08:31 +08:00
parent 6f6422c15e
commit d201182bd2
4 changed files with 24 additions and 14 deletions

View File

@@ -127,11 +127,6 @@ final routerProvider = Provider<GoRouter>((ref) {
return CallScreen(roomId: id); return CallScreen(roomId: id);
}, },
), ),
GoRoute(
name: 'thought',
path: '/thought',
builder: (context, state) => const ThoughtScreen(),
),
GoRoute( GoRoute(
name: 'logs', name: 'logs',
path: '/logs', path: '/logs',
@@ -466,6 +461,13 @@ final routerProvider = Provider<GoRouter>((ref) {
], ],
), ),
// SN-chan tab
GoRoute(
name: 'thought',
path: '/thought',
builder: (context, state) => const ThoughtScreen(),
),
// Creator hub tab // Creator hub tab
GoRoute( GoRoute(
name: 'creatorHub', name: 'creatorHub',

View File

@@ -24,6 +24,7 @@ const kTabRoutes = [
'/realms', '/realms',
'/account', '/account',
'/files', '/files',
'/thought',
'/creators', '/creators',
'/developers', '/developers',
]; ];
@@ -90,6 +91,10 @@ class TabsScreen extends HookConsumerWidget {
label: 'files'.tr(), label: 'files'.tr(),
icon: const Icon(Symbols.folder_rounded), icon: const Icon(Symbols.folder_rounded),
), ),
NavigationDestination(
label: 'aiThought'.tr(),
icon: const Icon(Symbols.bubble_chart),
),
NavigationDestination( NavigationDestination(
label: 'creatorHub'.tr(), label: 'creatorHub'.tr(),
icon: const Icon(Symbols.design_services_rounded), icon: const Icon(Symbols.design_services_rounded),

View File

@@ -51,6 +51,7 @@ class ThoughtScreen extends HookConsumerWidget {
isNoBackground: false, isNoBackground: false,
appBar: AppBar( appBar: AppBar(
title: Text(initialTopic ?? 'aiThought'.tr()), title: Text(initialTopic ?? 'aiThought'.tr()),
leading: const PageBackButton(),
actions: [ actions: [
IconButton( IconButton(
icon: const Icon(Symbols.history), icon: const Icon(Symbols.history),

View File

@@ -6,6 +6,7 @@ import 'package:go_router/go_router.dart';
import 'package:island/pods/network.dart'; import 'package:island/pods/network.dart';
import 'package:island/screens/notification.dart'; import 'package:island/screens/notification.dart';
import 'package:island/services/event_bus.dart'; import 'package:island/services/event_bus.dart';
import 'package:island/services/responsive.dart';
import 'package:island/widgets/account/account_picker.dart'; import 'package:island/widgets/account/account_picker.dart';
import 'package:island/widgets/alert.dart'; import 'package:island/widgets/alert.dart';
import 'package:island/widgets/post/compose_sheet.dart'; import 'package:island/widgets/post/compose_sheet.dart';
@@ -51,15 +52,16 @@ class FabMenu extends HookConsumerWidget {
late final Widget menuContent; late final Widget menuContent;
final commonEntires = <Widget>[ final commonEntires = <Widget>[
ListTile( if (!isWideScreen(context))
contentPadding: const EdgeInsets.symmetric(horizontal: 24), ListTile(
leading: const Icon(Symbols.bubble_chart), contentPadding: const EdgeInsets.symmetric(horizontal: 24),
title: Text('aiThoughtTitle').tr(), leading: const Icon(Symbols.bubble_chart),
onTap: () async { title: Text('aiThoughtTitle').tr(),
Navigator.of(context).pop(); onTap: () async {
context.pushNamed('thought'); Navigator.of(context).pop();
}, context.goNamed('thought');
), },
),
Consumer( Consumer(
builder: (context, ref, _) { builder: (context, ref, _) {
final notificationCount = ref.watch( final notificationCount = ref.watch(