diff --git a/lib/ui/screens/about_health/about_health.dart b/lib/ui/screens/about_health/about_health.dart index fff8ca20..8f033f5f 100644 --- a/lib/ui/screens/about_health/about_health.dart +++ b/lib/ui/screens/about_health/about_health.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:loono/constants.dart'; import 'package:loono/helpers/map_variables.dart'; import 'package:loono/services/webview_service.dart'; import 'package:loono/ui/widgets/feedback/feedback_button.dart'; @@ -18,6 +19,8 @@ class AboutHealthScreen extends StatelessWidget { final _showBackArrow = ValueNotifier(false); + final _loadingProgress = ValueNotifier(0); + @override Widget build(BuildContext context) { return SafeArea( @@ -33,6 +36,9 @@ class AboutHealthScreen extends StatelessWidget { onUpdateVisitedHistory: (webViewController, uri, androidIsReload) async { _showBackArrow.value = uri != initialUri; }, + onProgressChanged: (webViewController, progress) { + _loadingProgress.value = progress; + }, initialOptions: InAppWebViewGroupOptions( crossPlatform: InAppWebViewOptions( useShouldOverrideUrlLoading: true, @@ -87,7 +93,26 @@ class AboutHealthScreen extends StatelessWidget { padding: EdgeInsets.only(top: 8.0, right: 18), child: FeedbackButton(), ), - ) + ), + ValueListenableBuilder( + valueListenable: _loadingProgress, + builder: (context, value, _) { + if (value == 0 || value == 100) { + return const SizedBox.shrink(); + } + return Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: double.infinity, + child: LinearProgressIndicator( + value: value / 100, + backgroundColor: LoonoColors.beigeLight, + valueColor: const AlwaysStoppedAnimation(LoonoColors.primary), + ), + ), + ); + }, + ), ], ), ); diff --git a/pubspec.lock b/pubspec.lock index f4de0e28..46fec166 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -607,7 +607,7 @@ packages: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "5.4.2" + version: "5.4.3+7" flutter_keyboard_visibility: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 07360e85..7d49d99f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,7 +44,7 @@ dependencies: flutter_cache_manager: ^3.1.3 flutter_config: ^2.0.0 flutter_dotenv: ^5.0.0 - flutter_inappwebview: ^5.4.2 + flutter_inappwebview: ^5.4.3+7 flutter_localizations: sdk: flutter flutter_native_splash: ^2.0.5