Merge pull request #326 from NBA2K1/main

Issue #313 + Windows PathNotFoundException fix
This commit is contained in:
Moustapha Kodjo Amadou 2024-12-07 06:26:42 +01:00 committed by GitHub
commit f24b3987e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 40 additions and 13 deletions

View file

@ -139,6 +139,7 @@
"no_description": "لا يوجد وصف",
"resume": "استئناف",
"read": "قراءة",
"watch": "مشاهدة",
"popular": "شائع",
"open_in_browser": "فتح في المتصفح",
"clear_cookie": "مسح الكوكي",

View file

@ -139,6 +139,7 @@
"no_description": "Keine Beschreibung",
"resume": "Fortsetzen",
"read": "Lesen",
"watch": "Anschauen",
"popular": "Beliebt",
"open_in_browser": "Im Browser öffnen",
"clear_cookie": "Cookie löschen",

View file

@ -140,6 +140,7 @@
"no_description": "No description",
"resume": "Resume",
"read": "Read",
"watch": "Watch",
"popular": "Popular",
"open_in_browser": "Open in browser",
"clear_cookie": "Clear cookie",

View file

@ -139,6 +139,7 @@
"no_description": "Sin descripción",
"resume": "Reanudar",
"read": "Leer",
"watch": "Ver",
"popular": "Popular",
"open_in_browser": "Abrir en navegador",
"clear_cookie": "Limpiar cookie",

View file

@ -139,6 +139,7 @@
"no_description": "Sin descripción",
"resume": "Reanudar",
"read": "Leer",
"watch": "Ver",
"popular": "Popular",
"open_in_browser": "Abrir en navegador",
"clear_cookie": "Limpiar cookie",

View file

@ -138,6 +138,7 @@
"no_description": "Aucune description",
"resume": "Reprendre",
"read": "Commencer",
"watch": "Regarder",
"popular": "Populaire",
"refresh": "Actualiser",
"open_in_browser": "Ouvrir dans le navigateur",

View file

@ -139,6 +139,7 @@
"no_description": "Tidak ada deskripsi",
"resume": "Lanjutkan",
"read": "Baca",
"watch": "Tonton",
"popular": "Populer",
"open_in_browser": "Buka di peramban",
"clear_cookie": "Bersihkan cookie",

View file

@ -139,6 +139,7 @@
"no_description": "Nessuna descrizione",
"resume": "Riprendi",
"read": "Leggi",
"watch": "Guarda",
"popular": "Popolare",
"open_in_browser": "Apri nel browser",
"clear_cookie": "Cancella cookie",

View file

@ -139,6 +139,7 @@
"no_description": "Sem descrição",
"resume": "Continuar",
"read": "Ler",
"watch": "Assistir",
"popular": "Popular",
"open_in_browser": "Abrir no navegador",
"clear_cookie": "Limpar cookie",

View file

@ -139,6 +139,7 @@
"no_description": "Sem descrição",
"resume": "Continuar",
"read": "Ler",
"watch": "Assistir",
"popular": "Popular",
"open_in_browser": "Abrir no navegador",
"clear_cookie": "Limpar cookie",

View file

@ -139,6 +139,7 @@
"no_description": "Нет описания",
"resume": "Продолжить",
"read": "Читать",
"watch": "Смотреть",
"popular": "Популярное",
"open_in_browser": "Открыть в браузере",
"clear_cookie": "Очистить cookie",

View file

@ -139,6 +139,7 @@
"no_description": "ไม่มีคำอธิบาย",
"resume": "ทำต่อ",
"read": "อ่าน",
"watch": "ดู",
"popular": "ยอดนิยม",
"open_in_browser": "เปิดในเบราว์เซอร์",
"clear_cookie": "ล้างคุ๊กกี้",

View file

@ -139,6 +139,7 @@
"no_description": "Açıklama Yok",
"resume": "Devam Et",
"read": "Oku",
"watch": "İzle",
"popular": "Popüler",
"open_in_browser": "Tarayıcıda Aç",
"clear_cookie": "Çerezi Temizle",

View file

@ -139,6 +139,7 @@
"no_description": "无描述",
"resume": "继续",
"read": "阅读",
"watch": "观看",
"popular": "流行",
"open_in_browser": "在浏览器中打开",
"clear_cookie": "清除Cookie",

View file

@ -33,6 +33,20 @@ class MangaDetailsView extends ConsumerStatefulWidget {
}
class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
Size measureText(String text, TextStyle style) {
final TextPainter textPainter = TextPainter(
text: TextSpan(text: text, style: style),
textDirection: TextDirection.ltr,
)..layout();
return textPainter.size;
}
double calculateDynamicButtonWidth(String text, TextStyle textStyle, double padding) {
final textSize = measureText(text, textStyle);
return textSize.width + padding;
}
@override
Widget build(BuildContext context) {
final l10n = l10nLocalizations(context)!;
@ -58,9 +72,7 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
(q) => q.isMangaEqualTo(widget.manga.isManga!)))
.watch(fireImmediately: true),
builder: (context, snapshot) {
final isFr =
ref.watch(l10nLocaleStateProvider).languageCode ==
"fr";
String buttonLabel = widget.manga.isManga! ? l10n.read : l10n.watch;
if (snapshot.hasData && snapshot.data!.isNotEmpty) {
final incognitoMode =
ref.watch(incognitoModeStateProvider);
@ -79,13 +91,13 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
onPressed: () {
chap.pushToReaderView(context);
},
textWidth: 70,
width: 110,
textWidth: measureText(l10n.resume, Theme.of(context).textTheme.labelLarge!).width,
width: calculateDynamicButtonWidth(l10n.resume, Theme.of(context).textTheme.labelLarge!, 50), // 50 Padding, else RenderFlex overflow Exception
);
}
return CustomFloatingActionBtn(
isExtended: !isExtended,
label: l10n.read,
label: buttonLabel,
onPressed: () {
widget.manga.chapters
.toList()
@ -94,13 +106,13 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
.last
.pushToReaderView(context);
},
textWidth: isFr ? 80 : 40,
width: isFr ? 130 : 90,
textWidth: measureText(buttonLabel, Theme.of(context).textTheme.labelLarge!).width,
width: calculateDynamicButtonWidth(buttonLabel, Theme.of(context).textTheme.labelLarge!, 50), // 50 Padding, else RenderFlex overflow Exception
);
}
return CustomFloatingActionBtn(
isExtended: !isExtended,
label: l10n.read,
label: buttonLabel,
onPressed: () {
widget.manga.chapters
.toList()
@ -109,8 +121,8 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
.last
.pushToReaderView(context);
},
textWidth: isFr ? 80 : 40,
width: isFr ? 130 : 90,
textWidth: measureText(buttonLabel, Theme.of(context).textTheme.labelLarge!).width,
width: calculateDynamicButtonWidth(buttonLabel, Theme.of(context).textTheme.labelLarge!, 50), // 50 Padding, else RenderFlex overflow Exception
);
},
)

View file

@ -192,7 +192,8 @@ class CustomExtendedNetworkImageProvider
) async {
final Directory cacheImagesDirectory = Directory(join(
(await getTemporaryDirectory()).path,
'Mangayomi/${imageCacheFolderName ?? "cacheimagecover"}'));
'Mangayomi',
imageCacheFolderName ?? 'cacheimagecover'));
Uint8List? data;
// exist, try to find cache image file
if (cacheImagesDirectory.existsSync()) {
@ -213,7 +214,7 @@ class CustomExtendedNetworkImageProvider
}
// create folder
else {
await cacheImagesDirectory.create();
await cacheImagesDirectory.create(recursive: true);
}
// load from network
if (data == null) {