Skip to content

Commit

Permalink
Fixed the spacing between images
Browse files Browse the repository at this point in the history
  • Loading branch information
MockAirplane700 committed Jan 31, 2025
1 parent e608783 commit 5a19850
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 12 deletions.
12 changes: 12 additions & 0 deletions .idea/caches/deviceStreaming.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 4.0.7
- Fixed text length with ellipses in truncation
- Added multiple varied sizes in the title

## 4.0.6

- Added a fitted box to adjust title size according the text length
Expand Down
2 changes: 1 addition & 1 deletion example/flutter_ex/.flutter-plugins-dependencies

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/flutter_ex/lib/example_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class _ExampleReaderState extends State<ExampleReader> {

// SET UP VIEW MANAGER
manager = EpubViewManager(
ebookUri: 'https://zfzqwolxrejrzidhmsai.supabase.co/storage/v1/object/public/pages/books/clu4el3dz000111hpw1qxkfoz.epub',
ebookUri: '',
title: 'Testing Epub Reader - Comic Book Reader',
appBarTheme: AppBarTheme(),
isLightMode: true,
Expand Down
7 changes: 4 additions & 3 deletions lib/src/utils/orientation_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ class OrientationUtils {
'}'
'.horizontal-container img {'
' max-height: 100%;'
' margin: 0 10px;'
' margin: 0 0px;'
' object-fit: contain;'
' padding: 0px;'
'}'
'</style>'
'</head>'
Expand All @@ -44,11 +45,11 @@ class OrientationUtils {
' overflow-x: hidden;' // Disable horizontal scrolling
' width: 100%;'
' box-sizing: border-box;'
' padding: 10px;' // Add padding for spacing
' padding: 0px;' // Add padding for spacing
'}'
'.vertical-container img {'
' max-width: 100%;' // Scale images to fit the container width
' margin-bottom: 10px;' // Add spacing between images
' margin-bottom: 0px;' // Add spacing between images
' object-fit: contain;' // Maintain image aspect ratio
'}'
'</style>'
Expand Down
16 changes: 11 additions & 5 deletions lib/src/viewers/epub_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class EpubViewManager {
String screenTitle = 'Full Screen';
String screenDescription = 'Double tap the screen to toggle between full screen';

List<String> htmlFilesInMemory = [];

// EPUB BOOK REFERENCE
EpubBookRef? epubBookRef;
String? portrait;
Expand All @@ -107,10 +109,13 @@ class EpubViewManager {

// Check if the file already exists
final file = File(filePath);

if (!await file.exists()) {
// Save the file if it doesn't exist
file.writeAsStringSync(htmlString);
// Save the file name to memory
htmlFilesInMemory.add(filePath);
}
// Save file, overwrite if exists
file.writeAsStringSync(htmlString);
// CLEAR UP MEMORY
epubBookRef!.closeBook();
// ENSURE GC INIT
Expand Down Expand Up @@ -350,8 +355,9 @@ class EpubViewManager {
'}'
'.horizontal-container img {'
' max-height: 100%;'
' margin: 0 10px;'
' margin: 0 0px;'
' object-fit: contain;'
' padding: 0px;'
'}'
'</style>'
'</head>'
Expand Down Expand Up @@ -398,11 +404,11 @@ class EpubViewManager {
' overflow-x: hidden;' // Disable horizontal scrolling
' width: 100%;'
' box-sizing: border-box;'
' padding: 10px;' // Add padding for spacing
' padding: 0px;' // Add padding for spacing
'}'
'.vertical-container img {'
' max-width: 100%;' // Scale images to fit the container width
' margin-bottom: 10px;' // Add spacing between images
' margin-bottom: 0px;' // Add spacing between images
' object-fit: contain;' // Maintain image aspect ratio
'}'
'</style>'
Expand Down
1 change: 0 additions & 1 deletion lib/src/viewers/web_view_stack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class _WebViewStackState extends State<WebViewStack> {
}).whenComplete(() {
webViewController?.loadFile(currentHtmlFile!);
});

});
}// end if - else
webViewController?.reload();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: epub_comic_reader
description: Epub package fork. Suitable for use on Mobile comic epub books
homepage: https://github.com/synthex2020/comic-reader-dart
issue_tracker: https://github.com/synthex2020/comic-reader-dart
version: 4.0.6
version: 4.0.7

environment:
sdk: ">=2.17.0 <4.0.0"
Expand Down

0 comments on commit 5a19850

Please sign in to comment.