fix filter extension
This commit is contained in:
parent
b51f170c3a
commit
8a2dba2e0d
13 changed files with 533 additions and 425 deletions
|
|
@ -5,379 +5,377 @@ List<SourceModel> sourcesList = [
|
|||
sourceName: "MangaHere",
|
||||
url: "http://www.mangahere.cc",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.single),
|
||||
typeSource: TypeSource.single,
|
||||
logoUrl: 'http://static.mangahere.cc/v20210106/mangahere/images/logo.png',
|
||||
isFullData: true),
|
||||
SourceModel(
|
||||
sourceName: "MangaSee",
|
||||
url: "https://mangasee123.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.single),
|
||||
typeSource: TypeSource.single,
|
||||
logoUrl: 'https://mangasee123.com/media/navbar.brand.png'),
|
||||
SourceModel(
|
||||
sourceName: "ManngaKawaii",
|
||||
sourceName: "MangaKawaii",
|
||||
url: "https://www.mangakawaii.io",
|
||||
lang: "fr",
|
||||
typeSource: TypeSource.single),
|
||||
typeSource: TypeSource.single,
|
||||
logoUrl: 'https://www.mangakawaii.io/assets/img/logo.png'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'en',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'ar',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'pt',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'pt-br',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'it',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'ru',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'es',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'es-419',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'id',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'hi',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'de',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'ja',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'tr',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'pl',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'zh',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'zh-hk',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: 'Comick',
|
||||
url: 'https://api.comick.fun/',
|
||||
lang: 'fr',
|
||||
typeSource: TypeSource.comick),
|
||||
typeSource: TypeSource.comick,
|
||||
logoUrl:
|
||||
'https://comick.app/_next/image?url=%2Fstatic%2Ficons%2Funicorn-64.png&w=144&q=75'),
|
||||
SourceModel(
|
||||
sourceName: "KomikLab",
|
||||
url: "https://komiklab.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "AnimatedGlitchedScans",
|
||||
url: "https://anigliscans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "ArenaScans",
|
||||
url: "https://arenascans.net",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://arenascans.net/wp-content/uploads/2023/02/arena-logo-1.png'),
|
||||
SourceModel(
|
||||
sourceName: "AzureScans",
|
||||
url: "https://azuremanga.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "Boosei",
|
||||
url: "https://boosei.net",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://cdn.boosei.com/wp-content/uploads/2021/11/Logo-Darkmode.png.webp'),
|
||||
SourceModel(
|
||||
sourceName: "Clayrer",
|
||||
url: "https://clayrer.net",
|
||||
lang: "es",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://clayrer.net/wp-content/uploads/2022/12/cropped-BackgroundEraser_20221205_145151639-1.png'),
|
||||
SourceModel(
|
||||
sourceName: "CosmicScans",
|
||||
url: "https://cosmicscans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "DiskusScan",
|
||||
url: "https://diskusscan.com",
|
||||
lang: "pt-BR",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
lang: "pt-br",
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://diskusscan.com/wp-content/uploads/2022/12/imagem_2022-12-26_222007506.png'),
|
||||
SourceModel(
|
||||
sourceName: "DuniaKomik",
|
||||
url: "https://duniakomik.id",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "FlameScans",
|
||||
url: "https://flamescans.fr",
|
||||
lang: "fr",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "GremoryMangas",
|
||||
url: "https://gremorymangas.com",
|
||||
lang: "es",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: 'https://gremorymangas.com/wp-content/uploads/2022/09/6941.png'),
|
||||
SourceModel(
|
||||
sourceName: "InfernalVoidScans",
|
||||
url: "https://void-scans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "Kiryuu",
|
||||
url: "https://kiryuu.id",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "KomikIndo",
|
||||
url: "https://komikindo.co",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "KomikMama",
|
||||
url: "https://komikmama.co",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "Komiku",
|
||||
url: "https://komiku.com",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: 'https://komiku.com/wp-content/uploads/2022/03/logooo.png'),
|
||||
SourceModel(
|
||||
sourceName: "KumaScans (Kuma Translation)",
|
||||
url: "https://kumascans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'http://kumascans.com/wp-content/uploads/2021/01/web-rawkuma-copy.png'),
|
||||
SourceModel(
|
||||
sourceName: "MangaKita",
|
||||
url: "https://mangakita.net",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "MangaTale",
|
||||
url: "https://mangatale.co",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'http://mangatale.co/wp-content/uploads/2022/07/Group-of-23-Objects.png'),
|
||||
SourceModel(
|
||||
sourceName: "MangaYaro",
|
||||
url: "https://mangayaro.net",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://cache.mangayaro.net/wp-content/uploads/2021/07/20210723_193720.png.webp'),
|
||||
SourceModel(
|
||||
sourceName: "MangKomik",
|
||||
url: "https://mangkomik.net",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://cdn.mangkomik.net/wp-content/uploads/2023/02/image_2023-02-04_175453454-e1675527068905.png'),
|
||||
SourceModel(
|
||||
sourceName: "MangásChan",
|
||||
url: "https://mangaschan.com",
|
||||
lang: "pt-BR",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
lang: "pt-br",
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: 'https://mangaschan.com/wp-content/uploads/Logo-web.webp'),
|
||||
SourceModel(
|
||||
sourceName: "ManhwaFreak",
|
||||
url: "https://manhwafreak.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://manhwafreak.com/wp-content/uploads/2022/09/New-Theme-Logo-2.png'),
|
||||
SourceModel(
|
||||
sourceName: "ManhwaList",
|
||||
url: "https://manhwalist.in",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: 'https://manhwalist.in/wp-content/uploads/2022/12/4666667.png'),
|
||||
SourceModel(
|
||||
sourceName: "MasterKomik",
|
||||
url: "https://masterkomik.com",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: 'https://masterkomik.com/wp-content/uploads/2020/12/New-MK.png'),
|
||||
SourceModel(
|
||||
sourceName: "Nekomik",
|
||||
url: "https://nekomik.com",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "PhantomScans",
|
||||
url: "https://phantomscans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "PhoenixFansub",
|
||||
url: "https://phoenixfansub.com",
|
||||
lang: "es",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: ''),
|
||||
SourceModel(
|
||||
sourceName: "PiScans",
|
||||
url: "https://piscans.in",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://piscans.in/wp-content/uploads/2022/11/WM-Websitewq1.png'),
|
||||
SourceModel(
|
||||
sourceName: "Rawkuma",
|
||||
url: "https://rawkuma.com/",
|
||||
lang: "ja",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'http://rawkuma.com/wp-content/uploads/2021/12/Rawkuma-Logo.png'),
|
||||
SourceModel(
|
||||
sourceName: "Readkomik",
|
||||
url: "https://readkomik.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://readkomik.com/wp-content/uploads/2021/01/PicsArt_01-23-03.51.01.png'),
|
||||
SourceModel(
|
||||
sourceName: "SuryaScans",
|
||||
url: "https://suryascans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://suryascans.com/wp-content/uploads/2022/09/new-text-surya-logo1x.png'),
|
||||
SourceModel(
|
||||
sourceName: "SushiScan",
|
||||
url: "https://sushiscan.ru",
|
||||
url: "https://sushiscan.net",
|
||||
lang: "fr",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl: 'https://sushiscan.net/wp-content/uploads/SushiScanNewLogo.png'),
|
||||
SourceModel(
|
||||
sourceName: "TsundokuTraduções",
|
||||
url: "https://tsundoku.com.br",
|
||||
lang: "pt-BR",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
lang: "pt-br",
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://tsundoku.com.br/wp-content/uploads/2022/01/TsunBranca.png'),
|
||||
SourceModel(
|
||||
sourceName: "TukangKomik",
|
||||
url: "https://tukangkomik.id",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://tukangkomik.id/wp-content/uploads/2022/03/tukangkomik-logo-1.png'),
|
||||
SourceModel(
|
||||
sourceName: "WestManga",
|
||||
url: "https://westmanga.info",
|
||||
lang: "id",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://westmanga.info/wp-content/uploads/2021/01/LOGOxx-1.png'),
|
||||
SourceModel(
|
||||
sourceName: "xCaliBRScans",
|
||||
url: "https://xcalibrscans.com",
|
||||
lang: "en",
|
||||
typeSource: TypeSource.mangathemesia),
|
||||
typeSource: TypeSource.mangathemesia,
|
||||
logoUrl:
|
||||
'https://xcalibrscans.com/wp-content/uploads/2021/06/xcalibr-dark-v3.png'),
|
||||
];
|
||||
|
||||
|
||||
|
||||
// List<SourceModel> sourcesList = [
|
||||
// SourceModel(Source("MangaHere", "http://www.mangahere.cc", "en", TypeSource.single)),
|
||||
// SourceModel(Source("MangaSee", "https://mangasee123.com", "en", typeSource:TypeSource.single)),
|
||||
// SourceModel(Source(
|
||||
// "ManngaKawaii", "https://www.mangakawaii.io", "fr", typeSource:TypeSource.single)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'en', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'ar', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'pt', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'pt-br', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'it', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'ru', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'es', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'es-419', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'id', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'hi', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'de', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'ja', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'tr', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'pl', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'zh', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'zh-hk', TypeSource.comick)),
|
||||
// SourceModel(Source('Comick', 'https://api.comick.fun/', 'fr', TypeSource.comick)),
|
||||
// SourceModel(Source(
|
||||
// "KomikLab", "https://komiklab.com", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("AnimatedGlitchedScans", "https://anigliscans.com", "en",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "ArenaScans", "https://arenascans.net", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "AzureScans", "https://azuremanga.com", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("Boosei", "https://boosei.net", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("Clayrer", "https://clayrer.net", "es", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "CosmicScans", "https://cosmicscans.com", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("DiskusScan", "https://diskusscan.com", "pt-BR",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "DuniaKomik", "https://duniakomik.id", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "FlameScans", "https://flamescans.fr", "fr", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("GremoryMangas", "https://gremorymangas.com", "es",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("InfernalVoidScans", "https://void-scans.com", "en",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("Kiryuu", "https://kiryuu.id", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "KomikIndo", "https://komikindo.co", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "KomikMama", "https://komikmama.co", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("Komiku", "https://komiku.com", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("KumaScans (Kuma Translation)", "https://kumascans.com", "en",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "MangaKita", "https://mangakita.net", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "MangaTale", "https://mangatale.co", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "MangaYaro", "https://mangayaro.net", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "MangKomik", "https://mangkomik.net", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("MangásChan", "https://mangaschan.com", "pt-BR",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "ManhwaFreak", "https://manhwafreak.com", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "ManhwaList", "https://manhwalist.in", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "MasterKomik", "https://masterkomik.com", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("Nekomik", "https://nekomik.com", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("PhantomScans", "https://phantomscans.com", "en",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("PhoenixFansub", "https://phoenixfansub.com", "es",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("PiScans", "https://piscans.in", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "Rawkuma", "https://rawkuma.com/", "ja", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "Readkomik", "https://readkomik.com", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "SuryaScans", "https://suryascans.com", "en", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "SushiScan", "https://sushiscan.ru", "fr", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("TsundokuTraduções", "https://tsundoku.com.br", "pt-BR",
|
||||
// TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "TukangKomik", "https://tukangkomik.id", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source(
|
||||
// "WestManga", "https://westmanga.info", "id", TypeSource.mangathemesia)),
|
||||
// SourceModel(Source("xCaliBRScans", "https://xcalibrscans.com", "en",
|
||||
// TypeSource.mangathemesia)),
|
||||
// ];
|
||||
|
|
|
|||
|
|
@ -17,15 +17,21 @@ class SourceModel extends HiveObject {
|
|||
final bool isNsfw;
|
||||
@HiveField(6)
|
||||
final TypeSource typeSource;
|
||||
SourceModel({
|
||||
required this.sourceName,
|
||||
required this.url,
|
||||
required this.lang,
|
||||
required this.typeSource,
|
||||
this.isActive = true,
|
||||
this.isAdded = false,
|
||||
this.isNsfw = false,
|
||||
});
|
||||
@HiveField(7)
|
||||
final String logoUrl;
|
||||
@HiveField(8, defaultValue: false)
|
||||
final bool isFullData;
|
||||
|
||||
SourceModel(
|
||||
{required this.sourceName,
|
||||
required this.url,
|
||||
required this.lang,
|
||||
required this.typeSource,
|
||||
required this.logoUrl,
|
||||
this.isActive = true,
|
||||
this.isAdded = false,
|
||||
this.isNsfw = false,
|
||||
this.isFullData = false});
|
||||
}
|
||||
|
||||
@HiveType(typeId: 4)
|
||||
|
|
|
|||
|
|
@ -21,16 +21,18 @@ class SourceModelAdapter extends TypeAdapter<SourceModel> {
|
|||
url: fields[1] as String,
|
||||
lang: fields[2] as String,
|
||||
typeSource: fields[6] as TypeSource,
|
||||
logoUrl: fields[7] as String,
|
||||
isActive: fields[3] == null ? true : fields[3] as bool,
|
||||
isAdded: fields[4] == null ? false : fields[4] as bool,
|
||||
isNsfw: fields[5] == null ? false : fields[5] as bool,
|
||||
isFullData: fields[8] == null ? false : fields[8] as bool,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, SourceModel obj) {
|
||||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(9)
|
||||
..writeByte(0)
|
||||
..write(obj.sourceName)
|
||||
..writeByte(1)
|
||||
|
|
@ -44,7 +46,11 @@ class SourceModelAdapter extends TypeAdapter<SourceModel> {
|
|||
..writeByte(5)
|
||||
..write(obj.isNsfw)
|
||||
..writeByte(6)
|
||||
..write(obj.typeSource);
|
||||
..write(obj.typeSource)
|
||||
..writeByte(7)
|
||||
..write(obj.logoUrl)
|
||||
..writeByte(8)
|
||||
..write(obj.isFullData);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -74,20 +74,22 @@ completeLang(String lang) {
|
|||
}
|
||||
}
|
||||
|
||||
final List<String> language = [
|
||||
"Français",
|
||||
"English",
|
||||
"العربية",
|
||||
'Português',
|
||||
'Português do brasil',
|
||||
'Italiano',
|
||||
'Pусский язык',
|
||||
'Español',
|
||||
'Español latinoamericano',
|
||||
'Bahasa Indonesia',
|
||||
'हिन्दी, हिंदी',
|
||||
'日本語',
|
||||
'Deutsch',
|
||||
'中文',
|
||||
'(Hong Kong) 繁體中文'
|
||||
];
|
||||
final List<String> language = [
|
||||
"Français",
|
||||
"English",
|
||||
"العربية",
|
||||
'Português',
|
||||
'Português do brasil',
|
||||
'Italiano',
|
||||
'Pусский язык',
|
||||
'Español',
|
||||
'Español latinoamericano',
|
||||
'Bahasa Indonesia',
|
||||
'हिन्दी, हिंदी',
|
||||
'日本語',
|
||||
'Polski',
|
||||
'Türkçe',
|
||||
'Deutsch',
|
||||
'中文',
|
||||
'(Hong Kong) 繁體中文'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mangayomi/views/browse/extension/extension.dart';
|
||||
import 'package:mangayomi/views/browse/migrate.dart';
|
||||
import 'package:mangayomi/views/browse/sources.dart';
|
||||
import 'package:mangayomi/views/browse/extension/extension_screen.dart';
|
||||
import 'package:mangayomi/views/browse/migrate_screen.dart';
|
||||
import 'package:mangayomi/views/browse/sources_screen.dart';
|
||||
|
||||
class BrowseScreen extends StatefulWidget {
|
||||
const BrowseScreen({super.key});
|
||||
|
|
@ -28,6 +28,7 @@ class _BrowseScreenState extends State<BrowseScreen>
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultTabController(
|
||||
animationDuration: Duration.zero,
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
@ -64,8 +65,8 @@ class _BrowseScreenState extends State<BrowseScreen>
|
|||
color: Theme.of(context).hintColor)),
|
||||
],
|
||||
bottom: TabBar(
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
controller: _tabBarController,
|
||||
isScrollable: true,
|
||||
tabs: const [
|
||||
Tab(text: "Sources"),
|
||||
Tab(text: "Extension"),
|
||||
|
|
@ -73,7 +74,7 @@ class _BrowseScreenState extends State<BrowseScreen>
|
|||
],
|
||||
),
|
||||
),
|
||||
body: TabBarView(controller: _tabBarController, children: [
|
||||
body: TabBarView(controller: _tabBarController, children: const [
|
||||
SourcesScreen(),
|
||||
ExtensionScreen(),
|
||||
MigrateScreen()
|
||||
|
|
|
|||
|
|
@ -1,101 +0,0 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:grouped_list/grouped_list.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/source/source_list.dart';
|
||||
import 'package:mangayomi/source/source_model.dart';
|
||||
import 'package:mangayomi/utils/lang.dart';
|
||||
import 'package:mangayomi/views/browse/extension/widgets/extension_list_tile_widget.dart';
|
||||
|
||||
class ExtensionScreen extends ConsumerStatefulWidget {
|
||||
const ExtensionScreen({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<ExtensionScreen> createState() => _ExtensionScreenState();
|
||||
}
|
||||
|
||||
class _ExtensionScreenState extends ConsumerState<ExtensionScreen> {
|
||||
_init() {
|
||||
if (_isLoading) {
|
||||
final ss = ref
|
||||
.watch(hiveBoxMangaFilterProvider)
|
||||
.get("language_filter", defaultValue: []);
|
||||
if (ss.isEmpty) {
|
||||
for (var element in sourcesList) {
|
||||
if (!ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.containsKey("${element.sourceName}${element.lang}")) {
|
||||
ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.put("${element.sourceName}${element.lang}", element);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var element in sourcesList) {
|
||||
for (var lang in ss) {
|
||||
if (element.lang == lang) {
|
||||
ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.delete("${element.sourceName}${element.lang}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool _isLoading = true;
|
||||
@override
|
||||
Widget build(
|
||||
BuildContext context,
|
||||
) {
|
||||
_init();
|
||||
return _isLoading
|
||||
? Container()
|
||||
: ValueListenableBuilder<Box<SourceModel>>(
|
||||
valueListenable: ref.watch(hiveBoxMangaSourceProvider).listenable(),
|
||||
builder: (context, value, child) {
|
||||
final entries = value.values.toList();
|
||||
return GroupedListView<SourceModel, String>(
|
||||
elements: entries,
|
||||
groupBy: (element) => element.lang,
|
||||
groupSeparatorBuilder: (String groupByValue) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8, left: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
completeLang(groupByValue.toLowerCase()),
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
itemBuilder: (context, SourceModel element) {
|
||||
final source =
|
||||
value.get("${element.sourceName}${element.lang}")!;
|
||||
return ExtensionListTileWidget(
|
||||
lang:
|
||||
value.get("${element.sourceName}${element.lang}")!.lang,
|
||||
onChanged: (val) {
|
||||
value.put(
|
||||
"${element.sourceName}${element.lang}",
|
||||
SourceModel(
|
||||
sourceName: element.sourceName,
|
||||
url: element.url,
|
||||
lang: element.lang,
|
||||
typeSource: element.typeSource,
|
||||
isAdded: val));
|
||||
},
|
||||
sourceName: source.sourceName,
|
||||
value: source.isAdded,
|
||||
);
|
||||
},
|
||||
order: GroupedListOrder.ASC,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
83
lib/views/browse/extension/extension_screen.dart
Normal file
83
lib/views/browse/extension/extension_screen.dart
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:grouped_list/grouped_list.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/source/source_model.dart';
|
||||
import 'package:mangayomi/utils/lang.dart';
|
||||
import 'package:mangayomi/views/browse/extension/refresh_filter_data.dart';
|
||||
import 'package:mangayomi/views/browse/extension/widgets/extension_list_tile_widget.dart';
|
||||
|
||||
|
||||
class ExtensionScreen extends ConsumerWidget {
|
||||
const ExtensionScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final refreshFilter = ref.watch(refreshFilterDataProvider);
|
||||
|
||||
return refreshFilter.when(
|
||||
data: (data) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: ValueListenableBuilder<Box<SourceModel>>(
|
||||
valueListenable:
|
||||
ref.watch(hiveBoxMangaSourceProvider).listenable(),
|
||||
builder: (context, value, child) {
|
||||
final entries = value.values.toList();
|
||||
return GroupedListView<SourceModel, String>(
|
||||
elements: entries,
|
||||
groupBy: (element) =>
|
||||
completeLang(element.lang.toLowerCase()),
|
||||
groupSeparatorBuilder: (String groupByValue) => Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
groupByValue,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300, fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
itemBuilder: (context, SourceModel element) {
|
||||
final source =
|
||||
value.get("${element.sourceName}${element.lang}")!;
|
||||
return ExtensionListTileWidget(
|
||||
lang: value
|
||||
.get("${element.sourceName}${element.lang}")!
|
||||
.lang,
|
||||
onChanged: (val) {
|
||||
value.put(
|
||||
"${element.sourceName}${element.lang}",
|
||||
SourceModel(
|
||||
sourceName: element.sourceName,
|
||||
url: element.url,
|
||||
lang: element.lang,
|
||||
typeSource: element.typeSource,
|
||||
isAdded: val,
|
||||
logoUrl: element.logoUrl));
|
||||
},
|
||||
sourceName: source.sourceName,
|
||||
value: source.isAdded,
|
||||
logoUrl: source.logoUrl,
|
||||
);
|
||||
},
|
||||
groupComparator: (group1, group2) => group1.compareTo(group2),
|
||||
itemComparator: (item1, item2) =>
|
||||
item1.sourceName.compareTo(item2.sourceName),
|
||||
order: GroupedListOrder.ASC,
|
||||
);
|
||||
}),
|
||||
);
|
||||
},
|
||||
error: (error, stackTrace) {
|
||||
return Container();
|
||||
},
|
||||
loading: () {
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
73
lib/views/browse/extension/refresh_filter_data.dart
Normal file
73
lib/views/browse/extension/refresh_filter_data.dart
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/source/source_list.dart';
|
||||
import 'package:mangayomi/source/source_model.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
part 'refresh_filter_data.g.dart';
|
||||
|
||||
@riverpod
|
||||
Future<bool> refreshFilterData(RefreshFilterDataRef ref) async {
|
||||
final lf = ref
|
||||
.watch(hiveBoxMangaFilterProvider)
|
||||
.get("language_filter", defaultValue: []);
|
||||
if (lf.isEmpty) {
|
||||
for (var element in sourcesList) {
|
||||
final sP = ref.watch(hiveBoxMangaSourceProvider);
|
||||
if (sP.containsKey("${element.sourceName}${element.lang}")) {
|
||||
final oldSp = ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.get("${element.sourceName}${element.lang}");
|
||||
ref.watch(hiveBoxMangaSourceProvider).put(
|
||||
"${element.sourceName}${element.lang}",
|
||||
SourceModel(
|
||||
sourceName: element.sourceName,
|
||||
url: element.url,
|
||||
lang: element.lang,
|
||||
typeSource: element.typeSource,
|
||||
logoUrl: element.logoUrl,
|
||||
isFullData: element.isFullData,
|
||||
isActive: oldSp!.isActive,
|
||||
isAdded: oldSp.isAdded,
|
||||
isNsfw: oldSp.isNsfw));
|
||||
} else {
|
||||
ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.put("${element.sourceName}${element.lang}", element);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var element in sourcesList) {
|
||||
final sP = ref.watch(hiveBoxMangaSourceProvider);
|
||||
if (sP.containsKey("${element.sourceName}${element.lang}")) {
|
||||
final oldSp = ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.get("${element.sourceName}${element.lang}");
|
||||
ref.watch(hiveBoxMangaSourceProvider).put(
|
||||
"${element.sourceName}${element.lang}",
|
||||
SourceModel(
|
||||
sourceName: element.sourceName,
|
||||
url: element.url,
|
||||
lang: element.lang,
|
||||
typeSource: element.typeSource,
|
||||
logoUrl: element.logoUrl,
|
||||
isFullData: element.isFullData,
|
||||
isActive: oldSp!.isActive,
|
||||
isAdded: oldSp.isAdded,
|
||||
isNsfw: oldSp.isNsfw));
|
||||
} else {
|
||||
ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.put("${element.sourceName}${element.lang}", element);
|
||||
}
|
||||
}
|
||||
for (var element in sourcesList) {
|
||||
for (var lang in lf) {
|
||||
if (element.lang.toLowerCase() == lang) {
|
||||
ref
|
||||
.watch(hiveBoxMangaSourceProvider)
|
||||
.delete("${element.sourceName}${element.lang}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
24
lib/views/browse/extension/refresh_filter_data.g.dart
Normal file
24
lib/views/browse/extension/refresh_filter_data.g.dart
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'refresh_filter_data.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$refreshFilterDataHash() => r'0a4c4949efbe333131bef6b2e52ee94d81f06036';
|
||||
|
||||
/// See also [refreshFilterData].
|
||||
@ProviderFor(refreshFilterData)
|
||||
final refreshFilterDataProvider = AutoDisposeFutureProvider<bool>.internal(
|
||||
refreshFilterData,
|
||||
name: r'refreshFilterDataProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$refreshFilterDataHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef RefreshFilterDataRef = AutoDisposeFutureProviderRef<bool>;
|
||||
// ignore_for_file: unnecessary_raw_strings, subtype_of_sealed_class, invalid_use_of_internal_member, do_not_use_environment, prefer_const_constructors, public_member_api_docs, avoid_private_typedef_functions
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mangayomi/utils/lang.dart';
|
||||
|
||||
|
|
@ -5,16 +8,19 @@ class ExtensionListTileWidget extends StatelessWidget {
|
|||
final String sourceName;
|
||||
final String lang;
|
||||
final bool value;
|
||||
final String logoUrl;
|
||||
final Function(bool) onChanged;
|
||||
const ExtensionListTileWidget(
|
||||
{super.key,
|
||||
required this.sourceName,
|
||||
required this.lang,
|
||||
required this.value,
|
||||
required this.onChanged});
|
||||
required this.onChanged,
|
||||
required this.logoUrl});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// log(logoUrl);
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
onChanged(!value);
|
||||
|
|
@ -23,12 +29,31 @@ class ExtensionListTileWidget extends StatelessWidget {
|
|||
height: 37,
|
||||
width: 37,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
color: Theme.of(context).secondaryHeaderColor.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
child: const Icon(Icons.source_outlined),
|
||||
child: logoUrl.isEmpty
|
||||
? const Icon(Icons.source_outlined)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: logoUrl,
|
||||
fit: BoxFit.contain,
|
||||
width: 37,
|
||||
height: 37,
|
||||
errorWidget: (context, url, error) {
|
||||
return const SizedBox(
|
||||
width: 37,
|
||||
height: 37,
|
||||
child: Center(
|
||||
child: Icon(Icons.source_outlined),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
title: Text(sourceName),
|
||||
subtitle: Text(completeLang(lang.toLowerCase())),
|
||||
subtitle: Text(
|
||||
completeLang(lang.toLowerCase()),
|
||||
style: const TextStyle(fontWeight: FontWeight.w300, fontSize: 12),
|
||||
),
|
||||
trailing: Switch(
|
||||
value: value,
|
||||
onChanged: (value) {
|
||||
|
|
|
|||
|
|
@ -1,131 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:grouped_list/grouped_list.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:mangayomi/models/manga_type.dart';
|
||||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/source/source_list.dart';
|
||||
import 'package:mangayomi/source/source_model.dart';
|
||||
import 'package:mangayomi/utils/lang.dart';
|
||||
|
||||
// class SourcesScreen extends StatefulWidget {
|
||||
// const SourcesScreen({super.key});
|
||||
|
||||
// @override
|
||||
// State<SourcesScreen> createState() => _SourcesScreenState();
|
||||
// }
|
||||
|
||||
// class _SourcesScreenState extends State<SourcesScreen> {
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Column(
|
||||
// children: [
|
||||
// ListTile(
|
||||
// onTap: () {
|
||||
// context.push('/mangaHome',
|
||||
// extra: MangaType(
|
||||
// isFullData: true, lang: 'en', source: 'MangaHere'));
|
||||
// },
|
||||
// leading: Container(
|
||||
// height: 37,
|
||||
// width: 37,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.grey, borderRadius: BorderRadius.circular(5)),
|
||||
// ),
|
||||
// subtitle: const Text('English'),
|
||||
// title: const Text('MangaHere'),
|
||||
// trailing: SizedBox(
|
||||
// width: 110,
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: const [
|
||||
// Text(
|
||||
// "Latest",
|
||||
// style: TextStyle(fontWeight: FontWeight.bold),
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.push_pin_outlined,
|
||||
// color: Colors.black,
|
||||
// )
|
||||
// ],
|
||||
// )),
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
class SourcesScreen extends ConsumerStatefulWidget {
|
||||
const SourcesScreen({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<SourcesScreen> createState() => _SourcesScreenState();
|
||||
}
|
||||
|
||||
class _SourcesScreenState extends ConsumerState<SourcesScreen> {
|
||||
@override
|
||||
Widget build(
|
||||
BuildContext context,
|
||||
) {
|
||||
return ValueListenableBuilder<Box<SourceModel>>(
|
||||
valueListenable: ref.watch(hiveBoxMangaSourceProvider).listenable(),
|
||||
builder: (context, value, child) {
|
||||
final entries =
|
||||
value.values.where((element) => element.isAdded == true).toList();
|
||||
if (entries.isEmpty) {
|
||||
return const Center(child: Text("Empty"));
|
||||
}
|
||||
return GroupedListView<SourceModel, String>(
|
||||
elements: entries,
|
||||
groupBy: (element) => element.lang,
|
||||
groupSeparatorBuilder: (String groupByValue) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8, left: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
completeLang(groupByValue.toLowerCase()),
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
itemBuilder: (context, SourceModel element) {
|
||||
final source = value.get("${element.sourceName}${element.lang}")!;
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
if (source.sourceName == 'MangaHere') {
|
||||
context.push('/mangaHome',
|
||||
extra: MangaType(
|
||||
isFullData: true, lang: 'en', source: 'MangaHere'));
|
||||
}
|
||||
},
|
||||
leading: Container(
|
||||
height: 37,
|
||||
width: 37,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
child: const Icon(Icons.source_outlined),
|
||||
),
|
||||
subtitle: Text(completeLang(source.lang.toLowerCase())),
|
||||
title: Text(source.sourceName),
|
||||
trailing: SizedBox(
|
||||
width: 110,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.push_pin_outlined,
|
||||
color: Colors.black,
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
},
|
||||
sort: true,
|
||||
order: GroupedListOrder.ASC,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
122
lib/views/browse/sources_screen.dart
Normal file
122
lib/views/browse/sources_screen.dart
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:grouped_list/grouped_list.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:mangayomi/models/manga_type.dart';
|
||||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/source/source_model.dart';
|
||||
import 'package:mangayomi/utils/lang.dart';
|
||||
import 'package:mangayomi/views/browse/extension/refresh_filter_data.dart';
|
||||
|
||||
class SourcesScreen extends ConsumerWidget {
|
||||
const SourcesScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final refreshFilter = ref.watch(refreshFilterDataProvider);
|
||||
|
||||
return refreshFilter.when(
|
||||
data: (data) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: ValueListenableBuilder<Box<SourceModel>>(
|
||||
valueListenable:
|
||||
ref.watch(hiveBoxMangaSourceProvider).listenable(),
|
||||
builder: (context, value, child) {
|
||||
final entries = value.values
|
||||
.where((element) => element.isAdded == true)
|
||||
.toList();
|
||||
if (entries.isEmpty) {
|
||||
return const Center(child: Text("Empty"));
|
||||
}
|
||||
return GroupedListView<SourceModel, String>(
|
||||
elements: entries,
|
||||
groupBy: (element) =>
|
||||
completeLang(element.lang.toLowerCase()),
|
||||
groupSeparatorBuilder: (String groupByValue) => Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
groupByValue,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300, fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
itemBuilder: (context, SourceModel element) {
|
||||
final source =
|
||||
value.get("${element.sourceName}${element.lang}")!;
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
context.push('/mangaHome',
|
||||
extra: MangaType(
|
||||
isFullData: element.isFullData,
|
||||
lang: element.lang,
|
||||
source: element.sourceName));
|
||||
},
|
||||
leading: Container(
|
||||
height: 37,
|
||||
width: 37,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.secondaryHeaderColor
|
||||
.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
child: element.logoUrl.isEmpty
|
||||
? const Icon(Icons.source_outlined)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: element.logoUrl,
|
||||
fit: BoxFit.contain,
|
||||
width: 37,
|
||||
height: 37,
|
||||
errorWidget: (context, url, error) {
|
||||
return const SizedBox(
|
||||
width: 37,
|
||||
height: 37,
|
||||
child: Center(
|
||||
child: Icon(Icons.source_outlined),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
completeLang(source.lang.toLowerCase()),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300, fontSize: 12),
|
||||
),
|
||||
title: Text(source.sourceName),
|
||||
trailing: SizedBox(
|
||||
width: 110,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.push_pin_outlined,
|
||||
color: Colors.black,
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
},
|
||||
groupComparator: (group1, group2) => group1.compareTo(group2),
|
||||
itemComparator: (item1, item2) =>
|
||||
item1.sourceName.compareTo(item2.sourceName),
|
||||
order: GroupedListOrder.ASC,
|
||||
);
|
||||
}),
|
||||
);
|
||||
},
|
||||
error: (error, stackTrace) {
|
||||
return Container();
|
||||
},
|
||||
loading: () {
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue