From 90fa0e06cea0c5630bd26c11ff2dc2e6bc6d2952 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 18 Sep 2022 13:59:26 -0400 Subject: [PATCH] Fixed App webpage scrolling issue --- lib/pages/app.dart | 108 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/lib/pages/app.dart b/lib/pages/app.dart index 8fefe9d..4e02b4a 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -26,64 +26,60 @@ class _AppPageState extends State { appsProvider.getUpdate(app!.app.id); } return Scaffold( + appBar: settingsProvider.showAppWebpage ? AppBar() : null, backgroundColor: Theme.of(context).colorScheme.surface, - body: CustomScrollView(slivers: [ - CustomAppBar(title: '${app?.app.name}'), - SliverFillRemaining( - child: settingsProvider.showAppWebpage - ? WebView( - initialUrl: app?.app.url, - javascriptMode: JavascriptMode.unrestricted, - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - app?.app.name ?? 'App', - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.displayLarge, - ), - Text( - 'By ${app?.app.author ?? 'Unknown'}', - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineMedium, - ), - const SizedBox( - height: 32, - ), - GestureDetector( - onTap: () { - if (app?.app.url != null) { - launchUrlString(app?.app.url ?? '', - mode: LaunchMode.externalApplication); - } - }, - child: Text( - app?.app.url ?? '', - textAlign: TextAlign.center, - style: const TextStyle( - decoration: TextDecoration.underline, - fontStyle: FontStyle.italic, - fontSize: 12), - )), - const SizedBox( - height: 32, - ), - Text( - 'Latest Version: ${app?.app.latestVersion ?? 'Unknown'}', - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyLarge, - ), - Text( - 'Installed Version: ${app?.app.installedVersion ?? 'None'}', - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyLarge, - ), - ], + body: settingsProvider.showAppWebpage + ? WebView( + initialUrl: app?.app.url, + javascriptMode: JavascriptMode.unrestricted, + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + app?.app.name ?? 'App', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.displayLarge, ), - ), - ]), + Text( + 'By ${app?.app.author ?? 'Unknown'}', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.headlineMedium, + ), + const SizedBox( + height: 32, + ), + GestureDetector( + onTap: () { + if (app?.app.url != null) { + launchUrlString(app?.app.url ?? '', + mode: LaunchMode.externalApplication); + } + }, + child: Text( + app?.app.url ?? '', + textAlign: TextAlign.center, + style: const TextStyle( + decoration: TextDecoration.underline, + fontStyle: FontStyle.italic, + fontSize: 12), + )), + const SizedBox( + height: 32, + ), + Text( + 'Latest Version: ${app?.app.latestVersion ?? 'Unknown'}', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyLarge, + ), + Text( + 'Installed Version: ${app?.app.installedVersion ?? 'None'}', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyLarge, + ), + ], + ), bottomSheet: Padding( padding: EdgeInsets.fromLTRB( 0, 0, 0, MediaQuery.of(context).padding.bottom),