formatted

This commit is contained in:
Schnitzel5 2024-12-20 00:31:21 +01:00
parent 50eff04fe6
commit a531e87bda

View file

@ -36,13 +36,15 @@ class NovelReaderView extends ConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
chapter.manga.loadSync(); chapter.manga.loadSync();
final source = getSource(chapter.manga.value!.lang!, chapter.manga.value!.source!); final source =
final htmlContent = ref.watch(getHtmlContentProvider( getSource(chapter.manga.value!.lang!, chapter.manga.value!.source!);
source: source!, final htmlContent =
url: chapter.url! ref.watch(getHtmlContentProvider(source: source!, url: chapter.url!));
));
return NovelWebView(chapter: chapter, htmlContent: htmlContent,); return NovelWebView(
chapter: chapter,
htmlContent: htmlContent,
);
} }
} }
@ -181,23 +183,27 @@ class _NovelWebViewState extends ConsumerState<NovelWebView>
bottom: false, bottom: false,
child: Column( child: Column(
children: [ children: [
Expanded( widget.htmlContent.when(
child: widget.htmlContent.when( data: (htmlContent) => Expanded(
data: (htmlContent) => SingleChildScrollView( child: SingleChildScrollView(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
child: Html( child: Html(
data: htmlContent, data: htmlContent,
style: { style: {
"*": Style( "*": Style(
backgroundColor: Colors.white, backgroundColor: Colors.white,
margin: Margins.all(5)) margin: Margins.all(5))
}, },
shrinkWrap: true, shrinkWrap: true,
), ),
), ),
loading: () => const Center(child: CircularProgressIndicator(),), ),
error: (err, stack) => Center(child: Text(err.toString()),)), loading: () => const Center(
), child: CircularProgressIndicator(),
),
error: (err, stack) => Center(
child: Text(err.toString()),
)),
_appBar(), _appBar(),
], ],
), ),