🐛 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:island/pods/chat/chat_room.dart';
|
||||
import 'package:island/pods/event_calendar.dart';
|
||||
import 'package:island/pods/userinfo.dart';
|
||||
import 'package:island/screens/chat/chat.dart';
|
||||
import 'package:island/services/event_bus.dart';
|
||||
import 'package:island/services/responsive.dart';
|
||||
@@ -41,6 +42,8 @@ class DashboardGrid extends HookConsumerWidget {
|
||||
final isWide = isWideScreen(context);
|
||||
final devicePadding = MediaQuery.paddingOf(context);
|
||||
|
||||
final userInfo = ref.watch(userInfoProvider);
|
||||
|
||||
return Container(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: isWide
|
||||
@@ -52,6 +55,7 @@ class DashboardGrid extends HookConsumerWidget {
|
||||
: EdgeInsets.only(top: 24 + devicePadding.top),
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// Clock card spans full width
|
||||
ClockCard().padding(horizontal: isWide ? 24 : 16),
|
||||
@@ -68,13 +72,16 @@ class DashboardGrid extends HookConsumerWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
if (userInfo.value != null)
|
||||
Expanded(
|
||||
child:
|
||||
SingleChildScrollView(
|
||||
padding: isWide
|
||||
? const EdgeInsets.symmetric(horizontal: 24)
|
||||
: const EdgeInsets.only(bottom: 64),
|
||||
scrollDirection: isWide ? Axis.horizontal : Axis.vertical,
|
||||
scrollDirection: isWide
|
||||
? Axis.horizontal
|
||||
: Axis.vertical,
|
||||
child: isWide
|
||||
? _DashboardGridWide()
|
||||
: _DashboardGridNarrow(),
|
||||
@@ -365,9 +372,7 @@ class NotificationsCard extends HookConsumerWidget {
|
||||
final notifications = ref.watch(notificationListProvider);
|
||||
|
||||
return Card(
|
||||
elevation: 4,
|
||||
margin: EdgeInsets.zero,
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
@@ -454,9 +459,7 @@ class ChatListCard extends HookConsumerWidget {
|
||||
final chatRooms = ref.watch(chatRoomJoinedProvider);
|
||||
|
||||
return Card(
|
||||
elevation: 4,
|
||||
margin: EdgeInsets.zero,
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
@@ -490,11 +493,8 @@ class ChatListCard extends HookConsumerWidget {
|
||||
}
|
||||
// Take only the first 5 rooms
|
||||
final recentRooms = rooms.take(5).toList();
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: recentRooms.length,
|
||||
itemBuilder: (context, index) {
|
||||
final room = recentRooms[index];
|
||||
return Column(
|
||||
children: recentRooms.map((room) {
|
||||
return ChatRoomListTile(
|
||||
room: room,
|
||||
isDirect: room.type == 1,
|
||||
@@ -505,7 +505,7 @@ class ChatListCard extends HookConsumerWidget {
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
}).toList(),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -556,9 +556,7 @@ class FortuneCard extends HookWidget {
|
||||
});
|
||||
|
||||
return Card(
|
||||
elevation: 4,
|
||||
margin: EdgeInsets.zero,
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
|
||||
@@ -388,6 +388,9 @@ class CommandPattleWidget extends HookConsumerWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Material(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -408,6 +411,7 @@ class CommandPattleWidget extends HookConsumerWidget {
|
||||
maxHeight: 300,
|
||||
),
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
controller: scrollController,
|
||||
shrinkWrap: true,
|
||||
itemCount: allResults.length,
|
||||
@@ -451,6 +455,7 @@ class CommandPattleWidget extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class SliverRealmList extends HookConsumerWidget {
|
||||
itemBuilder: (context, index, realm) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 540),
|
||||
child: RealmListTile(realm: realm),
|
||||
child: RealmListTile(realm: realm).padding(horizontal: 8),
|
||||
).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
|
||||
# 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.
|
||||
version: 3.5.0+152
|
||||
version: 3.5.0+153
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.0
|
||||
|
||||
Reference in New Issue
Block a user