mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-08 17:25:01 -04:00
cleanup
This commit is contained in:
parent
8c89ce91cf
commit
9dfb8c3f71
16 changed files with 305 additions and 162 deletions
|
@ -45,8 +45,20 @@ class HomeScreenState extends State<HomeScreen>
|
|||
curve: Curves.easeInOut,
|
||||
));
|
||||
|
||||
// Account animation setup
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
final localAccounts = context.read<LocalAccountsCubit>().state;
|
||||
final activeLocalAccount = context.read<ActiveLocalAccountCubit>().state;
|
||||
final activeIndex = localAccounts
|
||||
.indexWhere((x) => x.superIdentity.recordKey == activeLocalAccount);
|
||||
final canClose = activeIndex != -1;
|
||||
|
||||
await changeWindowSetup(
|
||||
TitleBarStyle.normal, OrientationCapability.normal);
|
||||
|
||||
if (!canClose) {
|
||||
await _zoomDrawerController.open!();
|
||||
}
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -152,6 +164,12 @@ class HomeScreenState extends State<HomeScreen>
|
|||
scale.tertiaryScale.appBackground,
|
||||
]);
|
||||
|
||||
final localAccounts = context.watch<LocalAccountsCubit>().state;
|
||||
final activeLocalAccount = context.watch<ActiveLocalAccountCubit>().state;
|
||||
final activeIndex = localAccounts
|
||||
.indexWhere((x) => x.superIdentity.recordKey == activeLocalAccount);
|
||||
final canClose = activeIndex != -1;
|
||||
|
||||
return SafeArea(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(gradient: gradient),
|
||||
|
@ -178,9 +196,9 @@ class HomeScreenState extends State<HomeScreen>
|
|||
openCurve: Curves.fastEaseInToSlowEaseOut,
|
||||
// duration: const Duration(milliseconds: 250),
|
||||
// reverseDuration: const Duration(milliseconds: 250),
|
||||
menuScreenTapClose: true,
|
||||
mainScreenTapClose: true,
|
||||
//disableDragGesture: false,
|
||||
menuScreenTapClose: canClose,
|
||||
mainScreenTapClose: canClose,
|
||||
disableDragGesture: !canClose,
|
||||
mainScreenScale: .25,
|
||||
slideWidth: min(360, MediaQuery.of(context).size.width * 0.9),
|
||||
)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue