Changed progress indicator webview

This commit is contained in:
Juan Gilsanz Polo
2024-02-24 16:08:53 +01:00
parent 93f74b1eef
commit 45da6a23e1
2 changed files with 7 additions and 9 deletions

View File

@@ -25,10 +25,6 @@ final List<RouteBase> appRoutes = [
path: RoutesPaths.onboarding,
builder: (context, state) => const Onboarding(),
),
GoRoute(
path: RoutesPaths.webview,
builder: (context, state) => WebView(bookmark: state.extra as Bookmark),
),
ShellRoute(
builder: (context, state, child) => Layout(
state: state,
@@ -61,4 +57,8 @@ final List<RouteBase> appRoutes = [
path: RoutesPaths.generalSettings,
builder: (context, state) => const GeneralSettings(),
),
GoRoute(
path: RoutesPaths.webview,
builder: (context, state) => WebViewScreen(bookmark: state.extra as Bookmark),
),
];

View File

@@ -10,10 +10,10 @@ import 'package:linkdy/i18n/strings.g.dart';
import 'package:linkdy/utils/copy_clipboard.dart';
import 'package:linkdy/utils/open_url.dart';
class WebView extends ConsumerWidget {
class WebViewScreen extends ConsumerWidget {
final Bookmark bookmark;
const WebView({
const WebViewScreen({
Key? key,
required this.bookmark,
}) : super(key: key);
@@ -43,9 +43,7 @@ class WebView extends ConsumerWidget {
bottom: PreferredSize(
preferredSize: const Size(double.maxFinite, 0),
child: ref.watch(webViewProvider).loadProgress < 100
? LinearProgressIndicator(
value: ref.watch(webViewProvider).loadProgress.toDouble(),
)
? const LinearProgressIndicator()
: const SizedBox(
height: 4,
),