Merge pull request #326 from NBA2K1/main
Issue #313 + Windows PathNotFoundException fix
This commit is contained in:
commit
f24b3987e5
16 changed files with 40 additions and 13 deletions
|
|
@ -139,6 +139,7 @@
|
|||
"no_description": "لا يوجد وصف",
|
||||
"resume": "استئناف",
|
||||
"read": "قراءة",
|
||||
"watch": "مشاهدة",
|
||||
"popular": "شائع",
|
||||
"open_in_browser": "فتح في المتصفح",
|
||||
"clear_cookie": "مسح الكوكي",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
"no_description": "Нет описания",
|
||||
"resume": "Продолжить",
|
||||
"read": "Читать",
|
||||
"watch": "Смотреть",
|
||||
"popular": "Популярное",
|
||||
"open_in_browser": "Открыть в браузере",
|
||||
"clear_cookie": "Очистить cookie",
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
"no_description": "ไม่มีคำอธิบาย",
|
||||
"resume": "ทำต่อ",
|
||||
"read": "อ่าน",
|
||||
"watch": "ดู",
|
||||
"popular": "ยอดนิยม",
|
||||
"open_in_browser": "เปิดในเบราว์เซอร์",
|
||||
"clear_cookie": "ล้างคุ๊กกี้",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
"no_description": "无描述",
|
||||
"resume": "继续",
|
||||
"read": "阅读",
|
||||
"watch": "观看",
|
||||
"popular": "流行",
|
||||
"open_in_browser": "在浏览器中打开",
|
||||
"clear_cookie": "清除Cookie",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue