Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kodjodevf committed Dec 6, 2023
1 parent a4663ba commit 3f4d427
Show file tree
Hide file tree
Showing 9 changed files with 1,007 additions and 810 deletions.
4 changes: 2 additions & 2 deletions lib/models/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class Settings {
sortLibraryManga = json['sortLibraryManga'] != null
? SortLibraryManga.fromJson(json['sortLibraryManga'])
: null;
if (json['sortChapterList'] != null) {
if (json['autoScrollPages'] != null) {
autoScrollPages = (json['autoScrollPages'] as List)
.map((e) => AutoScrollPages.fromJson(e))
.toList();
Expand Down Expand Up @@ -396,7 +396,7 @@ class Settings {
'showPagesNumber': showPagesNumber,
if (sortChapterList != null)
'sortChapterList': sortChapterList!.map((v) => v.toJson()).toList(),
if (sortChapterList != null)
if (autoScrollPages != null)
'autoScrollPages': autoScrollPages!.map((v) => v.toJson()).toList(),
'sortLibraryAnime': sortLibraryAnime,
if (sortLibraryManga != null)
Expand Down
12 changes: 6 additions & 6 deletions lib/models/settings.g.dart

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

300 changes: 151 additions & 149 deletions lib/modules/browse/extension/extension_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,161 +34,163 @@ class _ExtensionDetailState extends ConsumerState<ExtensionDetail> {
appBar: AppBar(
title: Text(l10n.extension_detail),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 20),
child: Container(
decoration: BoxDecoration(
color:
Theme.of(context).secondaryHeaderColor.withOpacity(0.5),
borderRadius: BorderRadius.circular(10)),
child: widget.source.iconUrl!.isEmpty
? const Icon(Icons.source_outlined, size: 140)
: CachedNetworkImage(
imageUrl: widget.source.iconUrl!,
fit: BoxFit.contain,
width: 140,
height: 140,
errorWidget: (context, url, error) {
return const SizedBox(
width: 140,
height: 140,
child: Center(
child: Icon(Icons.source_outlined, size: 140),
),
);
},
),
body: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 20),
child: Container(
decoration: BoxDecoration(
color:
Theme.of(context).secondaryHeaderColor.withOpacity(0.5),
borderRadius: BorderRadius.circular(10)),
child: widget.source.iconUrl!.isEmpty
? const Icon(Icons.source_outlined, size: 140)
: CachedNetworkImage(
imageUrl: widget.source.iconUrl!,
fit: BoxFit.contain,
width: 140,
height: 140,
errorWidget: (context, url, error) {
return const SizedBox(
width: 140,
height: 140,
child: Center(
child: Icon(Icons.source_outlined, size: 140),
),
);
},
),
),
),
),
Padding(
padding: const EdgeInsets.all(12),
child: Text(
widget.source.name!,
style: const TextStyle(fontSize: 23, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
Padding(
padding: const EdgeInsets.all(12),
child: Text(
widget.source.name!,
style: const TextStyle(fontSize: 23, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: primaryColor(context).withOpacity(0.2),
borderRadius: BorderRadius.circular(10)),
child: Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Text(
widget.source.version!,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
Text(
l10n.version,
style: const TextStyle(fontSize: 11),
),
],
),
if (widget.source.isNsfw!)
Container(
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.7),
borderRadius: BorderRadius.circular(5)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"NSFW (18+)",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white),
),
)),
Column(
children: [
Text(
completeLanguageName(widget.source.lang!),
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
Text(
l10n.language,
style: const TextStyle(fontSize: 11),
),
],
),
],
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: primaryColor(context).withOpacity(0.2),
borderRadius: BorderRadius.circular(10)),
child: Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Text(
widget.source.version!,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
Text(
l10n.version,
style: const TextStyle(fontSize: 11),
),
],
),
if (widget.source.isNsfw!)
Container(
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.7),
borderRadius: BorderRadius.circular(5)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"NSFW (18+)",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white),
),
)),
Column(
children: [
Text(
completeLanguageName(widget.source.lang!),
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
Text(
l10n.language,
style: const TextStyle(fontSize: 11),
),
],
),
],
),
),
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
width: mediaWidth(context, 1),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(0),
side:
BorderSide(color: primaryColor(context), width: 0.3),
backgroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5)),
elevation: 0,
shadowColor: Colors.transparent),
onPressed: () {
showDialog(
context: context,
builder: (ctx) {
return AlertDialog(
title: Text(
widget.source.name!,
),
content: Text(
l10n.uninstall_extension(widget.source.name!)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () {
Navigator.pop(ctx);
},
child: Text(l10n.cancel)),
const SizedBox(
width: 15,
),
TextButton(
onPressed: () {
isar.writeTxnSync(() =>
isar.sources.putSync(widget.source
..sourceCode = ""
..isAdded = false
..isPinned = false));
Navigator.pop(ctx);
Navigator.pop(context);
},
child: Text(l10n.ok)),
],
)
],
);
});
},
child: Text(
l10n.uninstall,
style: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
)),
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
width: mediaWidth(context, 1),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(0),
side:
BorderSide(color: primaryColor(context), width: 0.3),
backgroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5)),
elevation: 0,
shadowColor: Colors.transparent),
onPressed: () {
showDialog(
context: context,
builder: (ctx) {
return AlertDialog(
title: Text(
widget.source.name!,
),
content: Text(
l10n.uninstall_extension(widget.source.name!)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () {
Navigator.pop(ctx);
},
child: Text(l10n.cancel)),
const SizedBox(
width: 15,
),
TextButton(
onPressed: () {
isar.writeTxnSync(() =>
isar.sources.putSync(widget.source
..sourceCode = ""
..isAdded = false
..isPinned = false));
Navigator.pop(ctx);
Navigator.pop(context);
},
child: Text(l10n.ok)),
],
)
],
);
});
},
child: Text(
l10n.uninstall,
style: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
)),
),
),
),
SourcePreferenceWidget(
sourcePreference: sourcePreference, source: source)
],
SourcePreferenceWidget(
sourcePreference: sourcePreference, source: source)
],
),
),
);
}
Expand Down
Loading

0 comments on commit 3f4d427

Please sign in to comment.