Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/ui/contact_list/new_chat_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ class _NewChatBottomSheetState extends ConsumerState<NewChatBottomSheet> {

return ListView.builder(
controller: _scrollController,
padding: EdgeInsets.zero,
itemCount: totalItems,
itemBuilder: (context, index) {
int currentIndex = 0;
Expand Down Expand Up @@ -517,23 +518,22 @@ class NewChatTile extends StatelessWidget {
WnImage(
iconPath,
color: context.colors.primary,
size: 16.w,
size: 20.w,
),
Gap(10.w),
Gap(12.w),
Text(
title,
style: TextStyle(
color: context.colors.primary,
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontSize: 16.sp,
),
),
Gap(8.w),
Gap(12.w),
WnImage(
AssetsPaths.icChevronRight,
color: context.colors.primary,
width: 5.7.w,
height: 10.w,
width: 6.w,
height: 12.w,
),
],
),
Expand Down
5 changes: 1 addition & 4 deletions lib/ui/contact_list/new_group_chat_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ class _NewGroupChatSheetState extends ConsumerState<NewGroupChatSheet> {
}

return ListView.builder(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
vertical: 8.h,
),
padding: EdgeInsets.zero,
itemCount: filteredContacts.length,
itemBuilder: (context, index) {
final contact = filteredContacts[index];
Expand Down
265 changes: 135 additions & 130 deletions lib/ui/settings/developer/developer_settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:whitenoise/config/extensions/toast_extension.dart';
import 'package:whitenoise/config/providers/active_pubkey_provider.dart';
import 'package:whitenoise/src/rust/api/accounts.dart' as accounts_api;
import 'package:whitenoise/ui/core/themes/assets.dart';
import 'package:whitenoise/ui/core/themes/src/extensions.dart';
import 'package:whitenoise/ui/core/ui/wn_app_bar.dart';
import 'package:whitenoise/ui/core/ui/wn_button.dart';
import 'package:whitenoise/ui/core/ui/wn_dialog.dart';
import 'package:whitenoise/ui/core/ui/wn_image.dart';
Expand Down Expand Up @@ -232,153 +234,156 @@ class _DeveloperSettingsScreenState extends ConsumerState<DeveloperSettingsScree
),
child: Scaffold(
backgroundColor: context.colors.neutral,
appBar: WnAppBar(
automaticallyImplyLeading: false,
leading: RepaintBoundary(
child: IconButton(
onPressed: () => context.pop(),
icon: WnImage(
AssetsPaths.icChevronLeft,
width: 24.w,
height: 24.w,
color: context.colors.solidPrimary,
),
),
),
title: RepaintBoundary(
child: Text(
'Developer Settings',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w600,
color: context.colors.solidPrimary,
),
),
),
),
body: SafeArea(
bottom: false,
child: Column(
children: [
Gap(24.h),
RepaintBoundary(
child: Row(
children: [
IconButton(
onPressed: () => Navigator.of(context).pop(),
icon: WnImage(
AssetsPaths.icChevronLeft,
width: 24.w,
height: 24.w,
color: context.colors.primary,
),
),
Text(
'Developer Settings',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w600,
color: context.colors.mutedForeground,
),
),
],
),
),
Gap(29.h),
Expanded(
child: Padding(
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
bottom: 24.w,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RepaintBoundary(
child: ColoredBox(
color: context.colors.neutral,
child: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 24.h),
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Key Package Management
Text(
'Key Package Management',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
color: context.colors.primary,
),
),
Gap(10.h),
WnFilledButton(
label: 'Publish new key package',
onPressed: _isLoading ? null : _publishKeyPackage,
loading: _isLoading,
),
Gap(8.h),
WnFilledButton(
label: 'Inspect relay key packages',
onPressed: _isLoading ? null : _fetchKeyPackages,
loading: _isLoading && !_showKeyPackages,
),
Gap(8.h),
WnFilledButton(
label: 'Delete all key packages from relays',
visualState: WnButtonVisualState.destructive,
onPressed: _isLoading ? null : _deleteAllKeyPackages,
loading: _isLoading && _showKeyPackages,
labelTextStyle: WnButtonSize.large.textStyle().copyWith(
color: context.colors.solidNeutralWhite,
),
),
],
),
),
if (_showKeyPackages) ...[
Gap(24.h),
Text(
'Key Packages (${_keyPackages.length})',
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w600,
color: context.colors.primary,
),
),
Gap(12.h),
if (_keyPackages.isEmpty)
RepaintBoundary(
child: Container(
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(
color: context.colors.avatarSurface,

borderRadius: BorderRadius.circular(8.r),
border: Border.all(
color: context.colors.border.withValues(alpha: 0.3),
width: 0.5,
),
),
child: Row(
RepaintBoundary(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
WnImage(
AssetsPaths.icInformation,
size: 20.w,
color: context.colors.mutedForeground,
),
SizedBox(width: 12.w),
// Key Package Management
Text(
'No key packages found',
'Key Package Management',
style: TextStyle(
fontSize: 14.sp,
color: context.colors.mutedForeground,
fontWeight: FontWeight.w600,
color: context.colors.primary,
),
),
Gap(10.h),
WnFilledButton(
label: 'Publish new key package',
onPressed: _isLoading ? null : _publishKeyPackage,
loading: _isLoading,
),
Gap(8.h),
WnFilledButton(
label: 'Inspect relay key packages',
onPressed: _isLoading ? null : _fetchKeyPackages,
loading: _isLoading && !_showKeyPackages,
),
Gap(8.h),
WnFilledButton(
label: 'Delete all key packages from relays',
visualState: WnButtonVisualState.destructive,
onPressed: _isLoading ? null : _deleteAllKeyPackages,
loading: _isLoading && _showKeyPackages,
labelTextStyle: WnButtonSize.large.textStyle().copyWith(
color: context.colors.solidNeutralWhite,
),
),
],
),
),
)
else
Expanded(
child: RepaintBoundary(
child: ListView.separated(
itemCount: _keyPackages.length,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
itemBuilder: (context, index) {
final keyPackage = _keyPackages[index];
return RepaintBoundary(
child: _KeyPackageItem(
keyPackage: keyPackage,
index: index,
isLoading: _isLoading,
onDelete: () => _deleteKeyPackage(keyPackage.id, index),
),
);
},
if (_showKeyPackages) ...[
Gap(24.h),
Text(
'Key Packages (${_keyPackages.length})',
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w600,
color: context.colors.primary,
),
),
),
),
],
Gap(MediaQuery.of(context).padding.bottom),
],
Gap(12.h),
if (_keyPackages.isEmpty)
RepaintBoundary(
child: Container(
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(
color: context.colors.avatarSurface,

borderRadius: BorderRadius.circular(8.r),
border: Border.all(
color: context.colors.border.withValues(alpha: 0.3),
width: 0.5,
),
),
child: Row(
children: [
WnImage(
AssetsPaths.icInformation,
size: 20.w,
color: context.colors.mutedForeground,
),
SizedBox(width: 12.w),
Text(
'No key packages found',
style: TextStyle(
fontSize: 14.sp,
color: context.colors.mutedForeground,
),
),
],
),
),
)
else
Expanded(
child: RepaintBoundary(
child: ListView.separated(
itemCount: _keyPackages.length,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
itemBuilder: (context, index) {
final keyPackage = _keyPackages[index];
return RepaintBoundary(
child: _KeyPackageItem(
keyPackage: keyPackage,
index: index,
isLoading: _isLoading,
onDelete: () => _deleteKeyPackage(keyPackage.id, index),
),
);
},
),
),
),
Comment on lines +358 to +376
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Expanded inside SingleChildScrollView will throw (unbounded height)

Expanded under a Column that’s inside a SingleChildScrollView causes “RenderFlex children have non‑zero flex but incoming height constraints are unbounded.” Remove Expanded and make the inner ListView non‑scrollable + shrinkWrap, or switch the whole body to a CustomScrollView with Slivers.

Apply this fix:

-                                Expanded(
-                                  child: RepaintBoundary(
-                                    child: ListView.separated(
+                                RepaintBoundary(
+                                  child: ListView.separated(
+                                    shrinkWrap: true,
+                                    physics: const NeverScrollableScrollPhysics(),
                                       itemCount: _keyPackages.length,
                                       separatorBuilder: (context, index) => SizedBox(height: 8.h),
                                       itemBuilder: (context, index) {
                                         final keyPackage = _keyPackages[index];
-                                        return RepaintBoundary(
-                                          child: _KeyPackageItem(
+                                        return RepaintBoundary(
+                                          child: _KeyPackageItem(
                                             keyPackage: keyPackage,
                                             index: index,
                                             isLoading: _isLoading,
                                             onDelete: () => _deleteKeyPackage(keyPackage.id, index),
                                           ),
                                         );
                                       },
                                     ),
-                                  ),
-                                ),
+                                  ),
+                                ),
🤖 Prompt for AI Agents
In lib/ui/settings/developer/developer_settings_screen.dart around lines 358 to
376, the Expanded wrapping the ListView is inside a Column that’s wrapped by a
SingleChildScrollView which causes unbounded height errors; remove the Expanded
and make the inner ListView non-scrollable by setting shrinkWrap: true and
physics: NeverScrollableScrollPhysics (or alternatively constrain the height
with a SizedBox); keep the RepaintBoundary and existing itemBuilder but ensure
the ListView is non-scrolling so it can lay out inside the SingleChildScrollView
without flex errors.

],
Gap(MediaQuery.of(context).padding.bottom),
],
),
),
),
),
),
),
],
],
),
),
),
),
Expand Down