From 32fabcfa3fce73e04f243d22c381eddc3c71d6fe Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Sat, 24 Sep 2022 12:53:46 +0530 Subject: [PATCH 1/2] fix: nav overlapping install buttons. --- lib/ui/views/installer/installer_view.dart | 211 +++++++++++---------- 1 file changed, 107 insertions(+), 104 deletions(-) diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 22bbdd4bdb..0d5195e953 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -18,130 +18,133 @@ class InstallerView extends StatelessWidget { onModelReady: (model) => model.initialize(context), viewModelBuilder: () => InstallerViewModel(), builder: (context, model, child) => WillPopScope( - child: Scaffold( - body: CustomScrollView( - controller: model.scrollController, - slivers: [ - CustomSliverAppBar( - title: Text( - model.headerLogs, - style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + child: SafeArea( + top: false, + child: Scaffold( + body: CustomScrollView( + controller: model.scrollController, + slivers: [ + CustomSliverAppBar( + title: Text( + model.headerLogs, + style: GoogleFonts.inter( + color: Theme.of(context).textTheme.headline6!.color, + ), ), - ), - onBackButtonPressed: () => model.onWillPop(context), - actions: [ - Visibility( - visible: !model.isPatching && !model.hasErrors, - child: CustomPopupMenu( - onSelected: (value) => model.onMenuSelection(value), - children: { - 0: I18nText( - 'installerView.shareApkMenuOption', - child: const Text( - '', - style: TextStyle( - fontWeight: FontWeight.bold, + onBackButtonPressed: () => model.onWillPop(context), + actions: [ + Visibility( + visible: !model.isPatching && !model.hasErrors, + child: CustomPopupMenu( + onSelected: (value) => model.onMenuSelection(value), + children: { + 0: I18nText( + 'installerView.shareApkMenuOption', + child: const Text( + '', + style: TextStyle( + fontWeight: FontWeight.bold, + ), ), ), - ), - 1: I18nText( - 'installerView.shareLogMenuOption', - child: const Text( - '', - style: TextStyle( - fontWeight: FontWeight.bold, + 1: I18nText( + 'installerView.shareLogMenuOption', + child: const Text( + '', + style: TextStyle( + fontWeight: FontWeight.bold, + ), ), ), - ), - }, + }, + ), ), - ), - ], - bottom: PreferredSize( - preferredSize: const Size(double.infinity, 1.0), - child: - GradientProgressIndicator(progress: model.progress!)), - ), - SliverPadding( - padding: const EdgeInsets.all(20.0), - sliver: SliverList( - delegate: SliverChildListDelegate.fixed( - [ - CustomCard( - child: Text( - model.logs, - style: GoogleFonts.jetBrainsMono( - fontSize: 13, - height: 1.5, + ], + bottom: PreferredSize( + preferredSize: const Size(double.infinity, 1.0), + child: + GradientProgressIndicator(progress: model.progress!)), + ), + SliverPadding( + padding: const EdgeInsets.all(20.0), + sliver: SliverList( + delegate: SliverChildListDelegate.fixed( + [ + CustomCard( + child: Text( + model.logs, + style: GoogleFonts.jetBrainsMono( + fontSize: 13, + height: 1.5, + ), ), ), - ), - ], + ], + ), ), ), - ), - SliverFillRemaining( - hasScrollBody: false, - child: Align( - alignment: Alignment.bottomCenter, - child: Visibility( - visible: !model.isPatching && !model.hasErrors, - 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(); - }, + SliverFillRemaining( + hasScrollBody: false, + child: Align( + alignment: Alignment.bottomCenter, + child: Visibility( + visible: !model.isPatching && !model.hasErrors, + 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 && model.isRooted, - child: CustomMaterialButton( - isFilled: false, - label: - I18nText('installerView.installRootButton'), - isExpanded: true, - onPressed: () => model.installResult( - context, - true, + Visibility( + visible: !model.isInstalled && model.isRooted, + child: CustomMaterialButton( + isFilled: false, + label: + I18nText('installerView.installRootButton'), + isExpanded: true, + onPressed: () => model.installResult( + context, + true, + ), ), ), - ), - Visibility( - visible: !model.isInstalled, - child: const SizedBox( - width: 16, + Visibility( + visible: !model.isInstalled, + child: const SizedBox( + width: 16, + ), ), - ), - Visibility( - visible: !model.isInstalled, - child: CustomMaterialButton( - label: I18nText('installerView.installButton'), - isExpanded: true, - onPressed: () => model.installResult( - context, - false, + Visibility( + visible: !model.isInstalled, + child: CustomMaterialButton( + label: I18nText('installerView.installButton'), + isExpanded: true, + onPressed: () => model.installResult( + context, + false, + ), ), ), - ), - ], + ], + ), ), ), ), ), - ), - ], + ], + ), ), ), onWillPop: () => model.onWillPop(context), From 47228806478445bee73d81addc82450eb76e3712 Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Sat, 24 Sep 2022 13:47:09 +0530 Subject: [PATCH 2/2] feat: better patch version background. --- .../widgets/patchesSelectorView/patch_item.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index 3021b0080b..a008bf11e6 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -58,13 +58,28 @@ class _PatchItemState extends State { children: [ Text( widget.simpleName, + maxLines: 2, + overflow: TextOverflow.visible, style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w600, ), ), const SizedBox(width: 4), - Text(widget.version) + Container( + padding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 2, + ), + decoration: BoxDecoration( + color: Theme.of(context) + .colorScheme + .background + .withOpacity(0.5), + borderRadius: BorderRadius.circular(6), + ), + child: Text(widget.version), + ) ], ), const SizedBox(height: 4),