fix safeareas

This commit is contained in:
Christien Rioux 2025-03-18 15:34:39 -04:00
parent 0d888363ff
commit 3c95c9d1a3
9 changed files with 51 additions and 194 deletions

View file

@ -93,33 +93,32 @@ class _HomeAccountReadyState extends State<HomeAccountReady> {
});
});
Widget buildUserPanel() => Builder(builder: (context) {
final profile = context.select<AccountRecordCubit, proto.Profile>(
(c) => c.state.asData!.value.profile);
final theme = Theme.of(context);
final scale = theme.extension<ScaleScheme>()!;
final scaleConfig = theme.extension<ScaleConfig>()!;
return ColoredBox(
color: scaleConfig.preferBorders
? scale.primaryScale.subtleBackground
: scale.primaryScale.subtleBorder,
child: Column(children: <Widget>[
Row(children: [
buildMenuButton().paddingLTRB(0, 0, 8, 0),
ProfileWidget(
profile: profile,
showPronouns: false,
).expanded(),
buildContactsButton().paddingLTRB(8, 0, 0, 0),
]).paddingAll(8),
const ChatListWidget().expanded()
]));
});
Widget buildLeftPane(BuildContext context) => Builder(
builder: (context) =>
Material(color: Colors.transparent, child: buildUserPanel()));
builder: (context) => Material(
color: Colors.transparent,
child: Builder(builder: (context) {
final profile = context.select<AccountRecordCubit, proto.Profile>(
(c) => c.state.asData!.value.profile);
final theme = Theme.of(context);
final scale = theme.extension<ScaleScheme>()!;
final scaleConfig = theme.extension<ScaleConfig>()!;
return ColoredBox(
color: scaleConfig.preferBorders
? scale.primaryScale.subtleBackground
: scale.primaryScale.subtleBorder,
child: Column(children: <Widget>[
Row(children: [
buildMenuButton().paddingLTRB(0, 0, 8, 0),
ProfileWidget(
profile: profile,
showPronouns: false,
).expanded(),
buildContactsButton().paddingLTRB(8, 0, 0, 0),
]).paddingAll(8),
const ChatListWidget().expanded()
]));
})));
Widget buildRightPane(BuildContext context) {
final activeChatCubit = context.watch<ActiveChatCubit>();

View file

@ -13,7 +13,6 @@ import 'package:veilid_support/veilid_support.dart';
import '../../account_manager/account_manager.dart';
import '../../settings/settings.dart';
import '../../theme/theme.dart';
import '../../tools/native_safe_area.dart';
import 'drawer_menu/drawer_menu.dart';
import 'home_account_invalid.dart';
import 'home_account_locked.dart';
@ -209,7 +208,7 @@ class HomeScreenState extends State<HomeScreen>
.indexWhere((x) => x.superIdentity.recordKey == activeLocalAccount);
final canClose = activeIndex != -1;
Widget homeWidget = DefaultTextStyle(
return DefaultTextStyle(
style: theme.textTheme.bodySmall!,
child: ZoomDrawer(
controller: _zoomDrawerController,
@ -238,13 +237,6 @@ class HomeScreenState extends State<HomeScreen>
mainScreenScale: .25,
slideWidth: min(360, MediaQuery.of(context).size.width * 0.9),
));
if (isiOS || isAndroid) {
homeWidget = NativeSafeArea(
bottom: false, left: false, right: false, child: homeWidget);
}
return homeWidget;
}
////////////////////////////////////////////////////////////////////////////