add more js api & improve ui

This commit is contained in:
nyne
2024-10-15 20:45:12 +08:00
parent c0a0dc59e1
commit fc86b8bbc6
22 changed files with 609 additions and 140 deletions

View File

@@ -317,6 +317,14 @@ class _ComicImageState extends State<ComicImage> with WidgetsBindingObserver {
height = constrains.maxHeight;
width = height * cacheSize.width / cacheSize.height;
}
} else {
if(width == double.infinity) {
width = constrains.maxWidth;
height = 300;
} else if(height == double.infinity) {
height = constrains.maxHeight;
width = 300;
}
}
if(_imageInfo != null){
@@ -371,6 +379,7 @@ class _ComicImageState extends State<ComicImage> with WidgetsBindingObserver {
height: 24,
child: CircularProgressIndicator(
strokeWidth: 3,
backgroundColor: context.colorScheme.surfaceContainerLow,
value: (_loadingProgress != null &&
_loadingProgress!.expectedTotalBytes!=null &&
_loadingProgress!.expectedTotalBytes! != 0)