Fixed App webpage scrolling issue

This commit is contained in:
Imran Remtulla
2022-09-18 13:59:26 -04:00
parent 6c1ad94b4f
commit 90fa0e06ce

View File

@@ -26,64 +26,60 @@ class _AppPageState extends State<AppPage> {
appsProvider.getUpdate(app!.app.id); appsProvider.getUpdate(app!.app.id);
} }
return Scaffold( return Scaffold(
appBar: settingsProvider.showAppWebpage ? AppBar() : null,
backgroundColor: Theme.of(context).colorScheme.surface, backgroundColor: Theme.of(context).colorScheme.surface,
body: CustomScrollView(slivers: <Widget>[ body: settingsProvider.showAppWebpage
CustomAppBar(title: '${app?.app.name}'), ? WebView(
SliverFillRemaining( initialUrl: app?.app.url,
child: settingsProvider.showAppWebpage javascriptMode: JavascriptMode.unrestricted,
? WebView( )
initialUrl: app?.app.url, : Column(
javascriptMode: JavascriptMode.unrestricted, mainAxisAlignment: MainAxisAlignment.center,
) crossAxisAlignment: CrossAxisAlignment.stretch,
: Column( children: [
mainAxisAlignment: MainAxisAlignment.center, Text(
crossAxisAlignment: CrossAxisAlignment.stretch, app?.app.name ?? 'App',
children: [ textAlign: TextAlign.center,
Text( style: Theme.of(context).textTheme.displayLarge,
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,
),
],
), ),
), 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( bottomSheet: Padding(
padding: EdgeInsets.fromLTRB( padding: EdgeInsets.fromLTRB(
0, 0, 0, MediaQuery.of(context).padding.bottom), 0, 0, 0, MediaQuery.of(context).padding.bottom),