mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-12 11:12:19 -04:00
native device orientation work
This commit is contained in:
parent
debb475bdc
commit
0d888363ff
3 changed files with 141 additions and 118 deletions
|
@ -318,7 +318,7 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
scale.subtleBorder,
|
||||
]);
|
||||
|
||||
return DecoratedBox(
|
||||
Widget menu = DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
shadows: themedShadow(scaleConfig, scale),
|
||||
gradient: scaleConfig.useVisualIndicators ? null : gradient,
|
||||
|
@ -393,6 +393,12 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
),
|
||||
])
|
||||
]).paddingAll(16),
|
||||
).paddingLTRB(0, 2, 2, 2);
|
||||
);
|
||||
|
||||
if (scaleConfig.preferBorders || scaleConfig.useVisualIndicators) {
|
||||
menu = menu.paddingLTRB(0, 2, 2, 2);
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ 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';
|
||||
|
@ -208,36 +209,42 @@ class HomeScreenState extends State<HomeScreen>
|
|||
.indexWhere((x) => x.superIdentity.recordKey == activeLocalAccount);
|
||||
final canClose = activeIndex != -1;
|
||||
|
||||
return SafeArea(
|
||||
child: DefaultTextStyle(
|
||||
style: theme.textTheme.bodySmall!,
|
||||
child: ZoomDrawer(
|
||||
controller: _zoomDrawerController,
|
||||
menuScreen: Builder(builder: (context) {
|
||||
final zoomDrawer = ZoomDrawer.of(context);
|
||||
zoomDrawer!.stateNotifier.addListener(() {
|
||||
if (zoomDrawer.isOpen()) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
}
|
||||
});
|
||||
return const DrawerMenu();
|
||||
}),
|
||||
mainScreen: Provider<ZoomDrawerController>.value(
|
||||
value: _zoomDrawerController,
|
||||
child: Builder(builder: _buildAccountPageView)),
|
||||
borderRadius: 0,
|
||||
angle: 0,
|
||||
//mainScreenOverlayColor: theme.shadowColor.withAlpha(0x2F),
|
||||
openCurve: Curves.fastEaseInToSlowEaseOut,
|
||||
closeCurve: Curves.fastEaseInToSlowEaseOut,
|
||||
// duration: const Duration(milliseconds: 250),
|
||||
// reverseDuration: const Duration(milliseconds: 250),
|
||||
menuScreenTapClose: canClose,
|
||||
mainScreenTapClose: canClose,
|
||||
disableDragGesture: !canClose,
|
||||
mainScreenScale: .25,
|
||||
slideWidth: min(360, MediaQuery.of(context).size.width * 0.9),
|
||||
)));
|
||||
Widget homeWidget = DefaultTextStyle(
|
||||
style: theme.textTheme.bodySmall!,
|
||||
child: ZoomDrawer(
|
||||
controller: _zoomDrawerController,
|
||||
menuScreen: Builder(builder: (context) {
|
||||
final zoomDrawer = ZoomDrawer.of(context);
|
||||
zoomDrawer!.stateNotifier.addListener(() {
|
||||
if (zoomDrawer.isOpen()) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
}
|
||||
});
|
||||
return const DrawerMenu();
|
||||
}),
|
||||
mainScreen: Provider<ZoomDrawerController>.value(
|
||||
value: _zoomDrawerController,
|
||||
child: Builder(builder: _buildAccountPageView)),
|
||||
borderRadius: 0,
|
||||
angle: 0,
|
||||
//mainScreenOverlayColor: theme.shadowColor.withAlpha(0x2F),
|
||||
openCurve: Curves.fastEaseInToSlowEaseOut,
|
||||
closeCurve: Curves.fastEaseInToSlowEaseOut,
|
||||
// duration: const Duration(milliseconds: 250),
|
||||
// reverseDuration: const Duration(milliseconds: 250),
|
||||
menuScreenTapClose: canClose,
|
||||
mainScreenTapClose: canClose,
|
||||
disableDragGesture: !canClose,
|
||||
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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue