From 38088d2f6a458e1cc38653f69a8af8b0fc01374f Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Mon, 12 Sep 2022 11:14:54 +0100 Subject: [PATCH] fix: Installer buttons should be fixed to bottom --- lib/ui/views/installer/installer_view.dart | 107 +++++++++++---------- 1 file changed, 55 insertions(+), 52 deletions(-) diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index fbeec134..32933723 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -66,7 +66,7 @@ class InstallerView extends StatelessWidget { ), ), SliverPadding( - padding: const EdgeInsets.all(20.0), + padding: const EdgeInsets.all(20.0).copyWith(bottom: 20.0), sliver: SliverList( delegate: SliverChildListDelegate.fixed( [ @@ -79,61 +79,64 @@ class InstallerView extends StatelessWidget { ), ), ), - Padding( - padding: const EdgeInsets.symmetric( - vertical: 16, - horizontal: 0, - ), - child: Visibility( - visible: !model.isPatching, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Visibility( - visible: model.isInstalled, - child: CustomMaterialButton( - label: I18nText('installerView.openButton'), - isExpanded: true, - onPressed: () { - model.openApp(); - model.cleanPatcher(); - Navigator.of(context).pop(); - }, - ), - ), - Visibility( - visible: !model.isInstalled, - child: CustomMaterialButton( - isFilled: false, - label: I18nText( - 'installerView.installRootButton'), - isExpanded: true, - onPressed: () => model.installResult(true), - ), - ), - Visibility( - visible: !model.isInstalled, - child: const SizedBox( - width: 16, - ), - ), - Visibility( - visible: !model.isInstalled, - child: CustomMaterialButton( - label: - I18nText('installerView.installButton'), - isExpanded: true, - onPressed: () => model.installResult(false), - ), - ), - ], - ), - ), - ), ], ), ), ), + SliverFillRemaining( + hasScrollBody: false, + child: Align( + alignment: Alignment.bottomCenter, + child: Visibility( + visible: !model.isPatching, + child: Padding( + padding: const EdgeInsets.all(20.0).copyWith(top: 0.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Visibility( + visible: model.isInstalled, + child: CustomMaterialButton( + label: I18nText('installerView.openButton'), + isExpanded: true, + onPressed: () { + model.openApp(); + model.cleanPatcher(); + Navigator.of(context).pop(); + }, + ), + ), + Visibility( + visible: !model.isInstalled, + child: CustomMaterialButton( + isFilled: false, + label: + I18nText('installerView.installRootButton'), + isExpanded: true, + onPressed: () => model.installResult(true), + ), + ), + Visibility( + visible: !model.isInstalled, + child: const SizedBox( + width: 16, + ), + ), + Visibility( + visible: !model.isInstalled, + child: CustomMaterialButton( + label: I18nText('installerView.installButton'), + isExpanded: true, + onPressed: () => model.installResult(false), + ), + ), + ], + ), + ), + ), + ), + ), ], ), ),