🐛 Fix bugs in the new changes
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/pods/chat/chat_room.dart';
|
import 'package:island/pods/chat/chat_room.dart';
|
||||||
import 'package:island/pods/event_calendar.dart';
|
import 'package:island/pods/event_calendar.dart';
|
||||||
|
import 'package:island/pods/userinfo.dart';
|
||||||
import 'package:island/screens/chat/chat.dart';
|
import 'package:island/screens/chat/chat.dart';
|
||||||
import 'package:island/services/event_bus.dart';
|
import 'package:island/services/event_bus.dart';
|
||||||
import 'package:island/services/responsive.dart';
|
import 'package:island/services/responsive.dart';
|
||||||
@@ -41,6 +42,8 @@ class DashboardGrid extends HookConsumerWidget {
|
|||||||
final isWide = isWideScreen(context);
|
final isWide = isWideScreen(context);
|
||||||
final devicePadding = MediaQuery.paddingOf(context);
|
final devicePadding = MediaQuery.paddingOf(context);
|
||||||
|
|
||||||
|
final userInfo = ref.watch(userInfoProvider);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxHeight: isWide
|
maxHeight: isWide
|
||||||
@@ -52,6 +55,7 @@ class DashboardGrid extends HookConsumerWidget {
|
|||||||
: EdgeInsets.only(top: 24 + devicePadding.top),
|
: EdgeInsets.only(top: 24 + devicePadding.top),
|
||||||
child: Column(
|
child: Column(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// Clock card spans full width
|
// Clock card spans full width
|
||||||
ClockCard().padding(horizontal: isWide ? 24 : 16),
|
ClockCard().padding(horizontal: isWide ? 24 : 16),
|
||||||
@@ -68,23 +72,26 @@ class DashboardGrid extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
if (userInfo.value != null)
|
||||||
child:
|
Expanded(
|
||||||
SingleChildScrollView(
|
child:
|
||||||
padding: isWide
|
SingleChildScrollView(
|
||||||
? const EdgeInsets.symmetric(horizontal: 24)
|
padding: isWide
|
||||||
: const EdgeInsets.only(bottom: 64),
|
? const EdgeInsets.symmetric(horizontal: 24)
|
||||||
scrollDirection: isWide ? Axis.horizontal : Axis.vertical,
|
: const EdgeInsets.only(bottom: 64),
|
||||||
child: isWide
|
scrollDirection: isWide
|
||||||
? _DashboardGridWide()
|
? Axis.horizontal
|
||||||
: _DashboardGridNarrow(),
|
: Axis.vertical,
|
||||||
)
|
child: isWide
|
||||||
.clipRRect(
|
? _DashboardGridWide()
|
||||||
topLeft: isWide ? 0 : 12,
|
: _DashboardGridNarrow(),
|
||||||
topRight: isWide ? 0 : 12,
|
)
|
||||||
)
|
.clipRRect(
|
||||||
.padding(horizontal: isWide ? 0 : 16),
|
topLeft: isWide ? 0 : 12,
|
||||||
),
|
topRight: isWide ? 0 : 12,
|
||||||
|
)
|
||||||
|
.padding(horizontal: isWide ? 0 : 16),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -365,9 +372,7 @@ class NotificationsCard extends HookConsumerWidget {
|
|||||||
final notifications = ref.watch(notificationListProvider);
|
final notifications = ref.watch(notificationListProvider);
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 4,
|
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
),
|
),
|
||||||
@@ -454,9 +459,7 @@ class ChatListCard extends HookConsumerWidget {
|
|||||||
final chatRooms = ref.watch(chatRoomJoinedProvider);
|
final chatRooms = ref.watch(chatRoomJoinedProvider);
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 4,
|
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
),
|
),
|
||||||
@@ -490,11 +493,8 @@ class ChatListCard extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
// Take only the first 5 rooms
|
// Take only the first 5 rooms
|
||||||
final recentRooms = rooms.take(5).toList();
|
final recentRooms = rooms.take(5).toList();
|
||||||
return ListView.builder(
|
return Column(
|
||||||
shrinkWrap: true,
|
children: recentRooms.map((room) {
|
||||||
itemCount: recentRooms.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final room = recentRooms[index];
|
|
||||||
return ChatRoomListTile(
|
return ChatRoomListTile(
|
||||||
room: room,
|
room: room,
|
||||||
isDirect: room.type == 1,
|
isDirect: room.type == 1,
|
||||||
@@ -505,7 +505,7 @@ class ChatListCard extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
}).toList(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -556,9 +556,7 @@ class FortuneCard extends HookWidget {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 4,
|
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -388,61 +388,66 @@ class CommandPattleWidget extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Material(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
children: [
|
borderRadius: BorderRadius.circular(24),
|
||||||
SearchBar(
|
child: Column(
|
||||||
controller: textController,
|
mainAxisSize: MainAxisSize.min,
|
||||||
focusNode: focusNode,
|
children: [
|
||||||
hintText: 'Search chats and pages...',
|
SearchBar(
|
||||||
leading: CircleAvatar(
|
controller: textController,
|
||||||
child: const Icon(Symbols.keyboard_command_key),
|
focusNode: focusNode,
|
||||||
).padding(horizontal: 8),
|
hintText: 'Search chats and pages...',
|
||||||
),
|
leading: CircleAvatar(
|
||||||
AnimatedSize(
|
child: const Icon(Symbols.keyboard_command_key),
|
||||||
duration: const Duration(milliseconds: 200),
|
).padding(horizontal: 8),
|
||||||
curve: Curves.easeOut,
|
),
|
||||||
child: allResults.isNotEmpty
|
AnimatedSize(
|
||||||
? ConstrainedBox(
|
duration: const Duration(milliseconds: 200),
|
||||||
constraints: const BoxConstraints(
|
curve: Curves.easeOut,
|
||||||
maxHeight: 300,
|
child: allResults.isNotEmpty
|
||||||
),
|
? ConstrainedBox(
|
||||||
child: ListView.builder(
|
constraints: const BoxConstraints(
|
||||||
controller: scrollController,
|
maxHeight: 300,
|
||||||
shrinkWrap: true,
|
),
|
||||||
itemCount: allResults.length,
|
child: ListView.builder(
|
||||||
itemBuilder: (context, index) {
|
padding: EdgeInsets.zero,
|
||||||
final item = allResults[index];
|
controller: scrollController,
|
||||||
if (item is SnChatRoom) {
|
shrinkWrap: true,
|
||||||
return _ChatRoomSearchResult(
|
itemCount: allResults.length,
|
||||||
room: item,
|
itemBuilder: (context, index) {
|
||||||
isFocused:
|
final item = allResults[index];
|
||||||
index == focusedIndex.value,
|
if (item is SnChatRoom) {
|
||||||
onTap: () => _navigateToChat(
|
return _ChatRoomSearchResult(
|
||||||
context,
|
room: item,
|
||||||
ref,
|
isFocused:
|
||||||
item,
|
index == focusedIndex.value,
|
||||||
),
|
onTap: () => _navigateToChat(
|
||||||
);
|
context,
|
||||||
} else if (item is RouteItem) {
|
ref,
|
||||||
return _RouteSearchResult(
|
item,
|
||||||
route: item,
|
),
|
||||||
isFocused:
|
);
|
||||||
index == focusedIndex.value,
|
} else if (item is RouteItem) {
|
||||||
onTap: () => _navigateToRoute(
|
return _RouteSearchResult(
|
||||||
context,
|
route: item,
|
||||||
ref,
|
isFocused:
|
||||||
item,
|
index == focusedIndex.value,
|
||||||
),
|
onTap: () => _navigateToRoute(
|
||||||
);
|
context,
|
||||||
}
|
ref,
|
||||||
return const SizedBox.shrink();
|
item,
|
||||||
},
|
),
|
||||||
),
|
);
|
||||||
)
|
}
|
||||||
: const SizedBox.shrink(),
|
return const SizedBox.shrink();
|
||||||
),
|
},
|
||||||
],
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class SliverRealmList extends HookConsumerWidget {
|
|||||||
itemBuilder: (context, index, realm) {
|
itemBuilder: (context, index, realm) {
|
||||||
return ConstrainedBox(
|
return ConstrainedBox(
|
||||||
constraints: const BoxConstraints(maxWidth: 540),
|
constraints: const BoxConstraints(maxWidth: 540),
|
||||||
child: RealmListTile(realm: realm),
|
child: RealmListTile(realm: realm).padding(horizontal: 8),
|
||||||
).center();
|
).center();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 3.5.0+152
|
version: 3.5.0+153
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.8.0
|
sdk: ^3.8.0
|
||||||
|
|||||||
Reference in New Issue
Block a user