mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 23:22:07 +00:00
new features
This commit is contained in:
parent
14aabfc5f3
commit
7c345bf00b
20 changed files with 218 additions and 171 deletions
|
|
@ -14,19 +14,19 @@ class ModelManga extends HiveObject {
|
|||
String? imageUrl;
|
||||
|
||||
@HiveField(3)
|
||||
String? description = '';
|
||||
String? description;
|
||||
|
||||
@HiveField(4)
|
||||
String? author = '';
|
||||
String? author;
|
||||
|
||||
@HiveField(5)
|
||||
String? status = '';
|
||||
String? status;
|
||||
|
||||
@HiveField(6)
|
||||
List<String>? genre;
|
||||
|
||||
@HiveField(7)
|
||||
bool favorite = false;
|
||||
bool favorite;
|
||||
|
||||
@HiveField(8)
|
||||
List<String>? chapterTitle;
|
||||
|
|
@ -43,6 +43,12 @@ class ModelManga extends HiveObject {
|
|||
@HiveField(12)
|
||||
String? lang;
|
||||
|
||||
@HiveField(13)
|
||||
int? dateAdded;
|
||||
|
||||
@HiveField(14)
|
||||
int? lastUpdate;
|
||||
|
||||
ModelManga(
|
||||
{required this.chapterDate,
|
||||
required this.source,
|
||||
|
|
@ -56,5 +62,7 @@ class ModelManga extends HiveObject {
|
|||
required this.link,
|
||||
required this.name,
|
||||
required this.status,
|
||||
required this.description});
|
||||
required this.description,
|
||||
required this.dateAdded,
|
||||
required this.lastUpdate});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,13 +30,15 @@ class ModelMangaAdapter extends TypeAdapter<ModelManga> {
|
|||
name: fields[0] as String?,
|
||||
status: fields[5] as String?,
|
||||
description: fields[3] as String?,
|
||||
dateAdded: fields[13] as int?,
|
||||
lastUpdate: fields[14] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, ModelManga obj) {
|
||||
writer
|
||||
..writeByte(13)
|
||||
..writeByte(15)
|
||||
..writeByte(0)
|
||||
..write(obj.name)
|
||||
..writeByte(1)
|
||||
|
|
@ -62,7 +64,11 @@ class ModelMangaAdapter extends TypeAdapter<ModelManga> {
|
|||
..writeByte(11)
|
||||
..write(obj.source)
|
||||
..writeByte(12)
|
||||
..write(obj.lang);
|
||||
..write(obj.lang)
|
||||
..writeByte(13)
|
||||
..write(obj.dateAdded)
|
||||
..writeByte(14)
|
||||
..write(obj.lastUpdate);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ part of 'get_manga_chapter_url.dart';
|
|||
// **************************************************************************
|
||||
|
||||
String _$getMangaChapterUrlHash() =>
|
||||
r'b17d3053901db005a4eee673163d2dc78ceb75f4';
|
||||
r'3a7026ca88efc6cedff804e23d0f04224d6d88d8';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'get_manga_detail.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$getMangaDetailHash() => r'b312cc1f35a45520a827c87b7be862cf5f67ffb3';
|
||||
String _$getMangaDetailHash() => r'0beaacd9a8611bd3763bf3f92ea71b2eb133d40c';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'search_manga.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$searchMangaHash() => r'6cb4c0eaa232a0c2b54a2c8f4841d3acfffacd40';
|
||||
String _$searchMangaHash() => r'b2376a19c02cbe43ad7f41357caeae3e7f2a210e';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -3,3 +3,7 @@ import 'package:flutter/material.dart';
|
|||
generalColor(BuildContext context) {
|
||||
return Theme.of(context).toggleButtonsTheme.color;
|
||||
}
|
||||
|
||||
secondaryColor(BuildContext context) {
|
||||
return Theme.of(context).iconTheme.color!.withOpacity(0.7);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,9 @@ class _MangaGlobalImageCardState extends ConsumerState<MangaGlobalImageCard>
|
|||
favorite: false,
|
||||
link: data.url,
|
||||
source: data.source,
|
||||
lang: widget.lang);
|
||||
lang: widget.lang,
|
||||
dateAdded: DateTime.now().microsecondsSinceEpoch,
|
||||
lastUpdate: DateTime.now().microsecondsSinceEpoch);
|
||||
if (mounted) {
|
||||
context.push('/manga-reader/detail', extra: modelManga);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,17 +36,19 @@ class _GeneralScreenState extends ConsumerState<GeneralScreen> {
|
|||
final incognitoMode = ref.watch(incognitoModeStateProvider);
|
||||
return Material(
|
||||
child: AnimatedContainer(
|
||||
height: incognitoMode ? 40 : 0,
|
||||
height:
|
||||
incognitoMode ? MediaQuery.of(context).padding.top * 2 : 0,
|
||||
curve: Curves.easeIn,
|
||||
duration: const Duration(milliseconds: 150),
|
||||
color: generalColor(context),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'Icongnito mode',
|
||||
'Incognito mode',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontFamily: GoogleFonts.aBeeZee().fontFamily,
|
||||
|
|
@ -73,7 +75,7 @@ class _GeneralScreenState extends ConsumerState<GeneralScreen> {
|
|||
child: NavigationBarTheme(
|
||||
data: NavigationBarThemeData(
|
||||
indicatorShape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
borderRadius: BorderRadius.circular(30)),
|
||||
height: 20,
|
||||
),
|
||||
child: NavigationBar(
|
||||
|
|
@ -101,7 +103,7 @@ class _GeneralScreenState extends ConsumerState<GeneralScreen> {
|
|||
Icons.history,
|
||||
),
|
||||
icon: Icon(
|
||||
Icons.history_sharp,
|
||||
Icons.history_outlined,
|
||||
),
|
||||
label: "History"),
|
||||
NavigationDestination(
|
||||
|
|
|
|||
|
|
@ -141,23 +141,8 @@ class _HistoryScreenState extends ConsumerState<HistoryScreen> {
|
|||
height: 90,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
final model = ModelManga(
|
||||
status: element.modelManga.status,
|
||||
imageUrl: element.modelManga.imageUrl,
|
||||
name: element.modelManga.name,
|
||||
genre: element.modelManga.genre,
|
||||
author: element.modelManga.author,
|
||||
chapterDate: element.modelManga.chapterDate,
|
||||
chapterTitle: element.modelManga.chapterTitle,
|
||||
chapterUrl: element.modelManga.chapterUrl,
|
||||
description: element.modelManga.description,
|
||||
favorite: element.modelManga.favorite,
|
||||
link: element.modelManga.link,
|
||||
source: element.modelManga.source,
|
||||
lang: element.modelManga.lang);
|
||||
|
||||
context.push('/manga-reader/detail',
|
||||
extra: model);
|
||||
extra: element.modelManga);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
|
|
|
|||
|
|
@ -25,22 +25,7 @@ class LibraryGridViewWidget extends StatelessWidget {
|
|||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
final model = ModelManga(
|
||||
imageUrl: entriesManga[index].imageUrl,
|
||||
name: entriesManga[index].name,
|
||||
genre: entriesManga[index].genre,
|
||||
author: entriesManga[index].author,
|
||||
status: entriesManga[index].status,
|
||||
chapterDate: entriesManga[index].chapterDate,
|
||||
chapterTitle: entriesManga[index].chapterTitle,
|
||||
chapterUrl: entriesManga[index].chapterUrl,
|
||||
description: entriesManga[index].description,
|
||||
favorite: entriesManga[index].favorite,
|
||||
link: entriesManga[index].link,
|
||||
source: entriesManga[index].source,
|
||||
lang: entriesManga[index].lang);
|
||||
|
||||
context.push('/manga-reader/detail', extra: model);
|
||||
context.push('/manga-reader/detail', extra: entriesManga[index]);
|
||||
},
|
||||
child: CoverViewWidget(
|
||||
bottomTextWidget: BottomTextWidget(
|
||||
|
|
|
|||
|
|
@ -17,22 +17,7 @@ class LibraryListViewWidget extends StatelessWidget {
|
|||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
final model = ModelManga(
|
||||
imageUrl: entriesManga[index].imageUrl,
|
||||
name: entriesManga[index].name,
|
||||
genre: entriesManga[index].genre,
|
||||
author: entriesManga[index].author,
|
||||
status: entriesManga[index].status,
|
||||
chapterDate: entriesManga[index].chapterDate,
|
||||
chapterTitle: entriesManga[index].chapterTitle,
|
||||
chapterUrl: entriesManga[index].chapterUrl,
|
||||
description: entriesManga[index].description,
|
||||
favorite: entriesManga[index].favorite,
|
||||
link: entriesManga[index].link,
|
||||
source: entriesManga[index].source,
|
||||
lang: entriesManga[index].lang);
|
||||
|
||||
context.push('/manga-reader/detail', extra: model);
|
||||
context.push('/manga-reader/detail', extra: entriesManga[index]);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
|
|
@ -71,8 +56,9 @@ class LibraryListViewWidget extends StatelessWidget {
|
|||
child: Padding(
|
||||
padding: const EdgeInsets.all(1),
|
||||
child: Text(
|
||||
entriesManga[index].chapterDate!.length.toString(),
|
||||
style: const TextStyle(color: Colors.white),),
|
||||
entriesManga[index].chapterDate!.length.toString(),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:mangayomi/models/manga_reader.dart';
|
||||
import 'package:mangayomi/models/model_manga.dart';
|
||||
import 'package:mangayomi/utils/cached_network.dart';
|
||||
import 'package:mangayomi/utils/colors.dart';
|
||||
import 'package:mangayomi/utils/media_query.dart';
|
||||
import 'package:mangayomi/views/manga/detail/providers/state_providers.dart';
|
||||
import 'package:mangayomi/views/manga/detail/readmore.dart';
|
||||
|
|
@ -133,7 +134,23 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
Widget _listView() {
|
||||
return Consumer(builder: (context, ref, child) {
|
||||
final reverse = ref.watch(reverseMangaStateProvider);
|
||||
return DraggableScrollbar.rrect(
|
||||
return DraggableScrollbar(
|
||||
heightScrollThumb: 48.0,
|
||||
backgroundColor: generalColor(context),
|
||||
scrollThumbBuilder:
|
||||
(backgroundColor, thumbAnimation, labelAnimation, height,
|
||||
{labelConstraints, labelText}) {
|
||||
return FadeTransition(
|
||||
opacity: thumbAnimation,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(20)),
|
||||
height: height,
|
||||
width: 10.0,
|
||||
),
|
||||
);
|
||||
},
|
||||
scrollbarTimeToFade: const Duration(seconds: 2),
|
||||
controller: _scrollController,
|
||||
child: ListView.builder(
|
||||
|
|
@ -188,7 +205,13 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
Widget _bodyContainer() {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(top: 0, child: _backgroundConstructor()),
|
||||
Positioned(
|
||||
top: 0,
|
||||
child: cachedNetworkImage(
|
||||
imageUrl: widget.modelManga!.imageUrl!,
|
||||
width: mediaWidth(context, 1),
|
||||
height: 300,
|
||||
fit: BoxFit.cover)),
|
||||
Container(
|
||||
height: 300,
|
||||
decoration: BoxDecoration(
|
||||
|
|
@ -210,14 +233,13 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
height: 180,
|
||||
child: Stack(
|
||||
children: [
|
||||
_titleConstructor(),
|
||||
_cardConstructor(),
|
||||
_titles(),
|
||||
_coverCard(),
|
||||
],
|
||||
),
|
||||
),
|
||||
_actionConstructor(),
|
||||
Container(
|
||||
key: const Key("widget_body"),
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
@ -249,13 +271,17 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
height: 30,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
Colors.grey.withOpacity(0.2),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(5))),
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
widget.modelManga!.genre![i],
|
||||
style: const TextStyle(fontSize: 12),
|
||||
style: const TextStyle(
|
||||
fontSize: 11.5,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -277,6 +303,8 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
height: 30,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
Colors.grey.withOpacity(0.2),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
|
|
@ -284,8 +312,9 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
onPressed: () {},
|
||||
child: Text(
|
||||
widget.modelManga!.genre![i],
|
||||
style:
|
||||
const TextStyle(fontSize: 12),
|
||||
style: const TextStyle(
|
||||
fontSize: 11.5,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -325,9 +354,8 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
);
|
||||
}
|
||||
|
||||
Widget _cardConstructor() {
|
||||
Widget _coverCard() {
|
||||
return Positioned(
|
||||
key: const Key("widget_card"),
|
||||
top: 20,
|
||||
left: 20,
|
||||
child: GestureDetector(
|
||||
|
|
@ -349,17 +377,8 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
);
|
||||
}
|
||||
|
||||
Widget _backgroundConstructor() {
|
||||
return cachedNetworkImage(
|
||||
imageUrl: widget.modelManga!.imageUrl!,
|
||||
width: mediaWidth(context, 1),
|
||||
height: 300,
|
||||
fit: BoxFit.cover);
|
||||
}
|
||||
|
||||
Widget _titleConstructor() {
|
||||
Widget _titles() {
|
||||
return Positioned(
|
||||
key: const Key("widget_title"),
|
||||
top: 60,
|
||||
left: 30,
|
||||
child: Container(
|
||||
|
|
@ -383,38 +402,40 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
Widget _actionConstructor() {
|
||||
return Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
widget.action!,
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
SizedBox(
|
||||
width: mediaWidth(context, 0.4),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0),
|
||||
onPressed: () {},
|
||||
child: Column(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.public,
|
||||
size: 25,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text('WebView')
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
widget.action!,
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
SizedBox(
|
||||
width: mediaWidth(context, 0.4),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0),
|
||||
onPressed: () {},
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.public,
|
||||
size: 22,
|
||||
color: secondaryColor(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
'WebView',
|
||||
style:
|
||||
TextStyle(fontSize: 13, color: secondaryColor(context)),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
|
@ -7,6 +5,7 @@ import 'package:hive_flutter/hive_flutter.dart';
|
|||
import 'package:mangayomi/models/manga_reader.dart';
|
||||
import 'package:mangayomi/models/model_manga.dart';
|
||||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/utils/colors.dart';
|
||||
import 'package:mangayomi/utils/media_query.dart';
|
||||
import 'package:mangayomi/views/manga/detail/manga_detail_view.dart';
|
||||
import 'package:mangayomi/views/more/settings/providers/incognito_mode_state_provider.dart';
|
||||
|
|
@ -73,14 +72,13 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
height: 50,
|
||||
width: !ref.watch(isExtended)
|
||||
? 63
|
||||
: mediaWidth(context, 0.3),
|
||||
duration: const Duration(milliseconds: 400),
|
||||
height: 55,
|
||||
width: !ref.watch(isExtended) ? 63 : 130,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeIn,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: generalColor(context),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15))),
|
||||
onPressed: () {
|
||||
|
|
@ -92,21 +90,27 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.play_arrow,
|
||||
color: secondaryColor(context),
|
||||
),
|
||||
AnimatedContainer(
|
||||
curve: Curves.easeIn,
|
||||
width: !ref.watch(isExtended)
|
||||
? 0
|
||||
: mediaWidth(context, 0.15),
|
||||
duration: const Duration(milliseconds: 400),
|
||||
child: const Text(
|
||||
width: !ref.watch(isExtended) ? 0 : 8,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
),
|
||||
AnimatedContainer(
|
||||
curve: Curves.easeIn,
|
||||
width: !ref.watch(isExtended) ? 0 : 60,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: Text(
|
||||
"Continue",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: secondaryColor(context)),
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_arrow,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -120,14 +124,13 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
height: 50,
|
||||
width: !ref.watch(isExtended)
|
||||
? 60
|
||||
: mediaWidth(context, 0.3),
|
||||
height: 55,
|
||||
width: !ref.watch(isExtended) ? 60 : 105,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeIn,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: generalColor(context),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15))),
|
||||
onPressed: () {
|
||||
|
|
@ -138,26 +141,29 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
widget.modelManga.chapterTitle!.length - 1);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.play_arrow,
|
||||
color: secondaryColor(context),
|
||||
),
|
||||
AnimatedContainer(
|
||||
curve: Curves.easeIn,
|
||||
width: !ref.watch(isExtended) ? 0 : 5,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
),
|
||||
AnimatedContainer(
|
||||
curve: Curves.easeIn,
|
||||
width: !ref.watch(isExtended) ? 0 : 40,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: const Text(
|
||||
child: Text(
|
||||
"Read",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: secondaryColor(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
AnimatedContainer(
|
||||
curve: Curves.easeIn,
|
||||
width: !ref.watch(isExtended) ? 0 : 10,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_arrow,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -225,12 +231,15 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
children: const [
|
||||
Icon(
|
||||
Icons.favorite,
|
||||
size: 25,
|
||||
size: 22,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text('In library')
|
||||
Text(
|
||||
'In library',
|
||||
style: TextStyle(fontSize: 13),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -259,21 +268,28 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
favorite: true,
|
||||
link: widget.modelManga.link,
|
||||
source: widget.modelManga.source,
|
||||
lang: widget.modelManga.lang);
|
||||
lang: widget.modelManga.lang,
|
||||
dateAdded: DateTime.now().microsecondsSinceEpoch,
|
||||
lastUpdate: DateTime.now().microsecondsSinceEpoch);
|
||||
manga.put(
|
||||
'${widget.modelManga.lang}-${widget.modelManga.link}',
|
||||
model);
|
||||
},
|
||||
child: Column(
|
||||
children: const [
|
||||
children: [
|
||||
Icon(
|
||||
Icons.favorite_border_rounded,
|
||||
size: 25,
|
||||
size: 22,
|
||||
color: secondaryColor(context),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text('Add to library')
|
||||
Text(
|
||||
'Add to library',
|
||||
style: TextStyle(
|
||||
color: secondaryColor(context), fontSize: 13),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -301,21 +317,28 @@ class _MangaDetailsViewState extends ConsumerState<MangaDetailsView> {
|
|||
favorite: true,
|
||||
link: widget.modelManga.link,
|
||||
source: widget.modelManga.source,
|
||||
lang: widget.modelManga.lang);
|
||||
lang: widget.modelManga.lang,
|
||||
dateAdded: DateTime.now().microsecondsSinceEpoch,
|
||||
lastUpdate: DateTime.now().microsecondsSinceEpoch);
|
||||
manga.put(
|
||||
'${widget.modelManga.lang}-${widget.modelManga.link}',
|
||||
model);
|
||||
},
|
||||
child: Column(
|
||||
children: const [
|
||||
children: [
|
||||
Icon(
|
||||
Icons.favorite_border_rounded,
|
||||
size: 25,
|
||||
size: 22,
|
||||
color: secondaryColor(context),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text('Add to library')
|
||||
Text(
|
||||
'Add to library',
|
||||
style: TextStyle(
|
||||
color: secondaryColor(context), fontSize: 13),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ class _MangaReaderDetailState extends ConsumerState<MangaReaderDetail> {
|
|||
.then((value) {
|
||||
if (value.chapterDate.isNotEmpty &&
|
||||
value.chapterTitle.isNotEmpty &&
|
||||
value.chapterUrl.isNotEmpty) {
|
||||
value.chapterUrl.isNotEmpty &&
|
||||
value.chapterDate.length >
|
||||
widget.modelManga.chapterDate!.length) {
|
||||
final model = ModelManga(
|
||||
imageUrl: widget.modelManga.imageUrl,
|
||||
name: widget.modelManga.name,
|
||||
|
|
@ -64,7 +66,9 @@ class _MangaReaderDetailState extends ConsumerState<MangaReaderDetail> {
|
|||
favorite: _isFavorite,
|
||||
link: widget.modelManga.link,
|
||||
source: widget.modelManga.source,
|
||||
lang: widget.modelManga.lang);
|
||||
lang: widget.modelManga.lang,
|
||||
dateAdded: widget.modelManga.dateAdded,
|
||||
lastUpdate: DateTime.now().microsecondsSinceEpoch);
|
||||
ref.watch(hiveBoxManga).put(
|
||||
'${widget.modelManga.lang}-${widget.modelManga.link}',
|
||||
model);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ReaderModeAdapter extends TypeAdapter<ReaderMode> {
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$currentIndexHash() => r'7a7a8ed760ffac461ac79522531a2b6929cf2008';
|
||||
String _$currentIndexHash() => r'd7ced153c521783c0cef060c8aeb61112bc4b7aa';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
@ -182,7 +182,7 @@ class CurrentIndexProvider
|
|||
}
|
||||
}
|
||||
|
||||
String _$readerControllerHash() => r'8d9f171beadfd98a701e370a4f9a8e145d6b31de';
|
||||
String _$readerControllerHash() => r'243aaf5a9eb3aa92f6477876e3d907bd1f45f6d3';
|
||||
|
||||
abstract class _$ReaderController extends BuildlessAutoDisposeNotifier<void> {
|
||||
late final MangaReaderModel mangaReaderModel;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:mangayomi/utils/colors.dart';
|
||||
import 'package:mangayomi/views/more/settings/appearance/providers/theme_mode_state_provider.dart';
|
||||
// import 'package:rive/rive.dart';
|
||||
|
||||
|
|
@ -25,7 +26,10 @@ class _DarkModeButtonState extends ConsumerState<DarkModeButton> {
|
|||
}
|
||||
},
|
||||
title: const Text("Theme mode"),
|
||||
subtitle: Text(ref.watch(themeModeStateProvider) ? 'Light' : 'Dark'),
|
||||
subtitle: Text(
|
||||
ref.watch(themeModeStateProvider) ? 'Light' : 'Dark',
|
||||
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
|
||||
),
|
||||
trailing: Switch(
|
||||
value: !isLight,
|
||||
onChanged: (dd) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:mangayomi/providers/hive_provider.dart';
|
||||
import 'package:mangayomi/utils/colors.dart';
|
||||
import 'package:mangayomi/views/more/settings/appearance/providers/flex_scheme_color_state_provider.dart';
|
||||
|
||||
class ThemeSelector extends ConsumerStatefulWidget {
|
||||
|
|
@ -93,9 +94,9 @@ class _ThemeSelectorState extends ConsumerState<ThemeSelector> {
|
|||
child: CircleAvatar(
|
||||
radius: 14,
|
||||
backgroundColor: theme.primaryColorLight,
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
FontAwesomeIcons.check,
|
||||
color: Colors.black,
|
||||
color: secondaryColor(context),
|
||||
size: 16,
|
||||
)),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,21 +14,30 @@ class SettingsScreen extends StatelessWidget {
|
|||
body: Column(
|
||||
children: [
|
||||
ListTileWidget(
|
||||
title: 'General', icon: Icons.tune_rounded, onTap: () {}),
|
||||
title: 'General',
|
||||
subtitle: 'App language',
|
||||
icon: Icons.tune_rounded,
|
||||
onTap: () {}),
|
||||
ListTileWidget(
|
||||
title: 'Appearance',
|
||||
subtitle: 'Theme',
|
||||
icon: Icons.color_lens_rounded,
|
||||
onTap: () => context.push('/appearance')),
|
||||
ListTileWidget(
|
||||
title: 'Library',
|
||||
subtitle: 'Categories',
|
||||
icon: Icons.collections_bookmark_rounded,
|
||||
onTap: () {}),
|
||||
ListTileWidget(
|
||||
title: 'Reader',
|
||||
subtitle: 'Reading mode, display, navigation',
|
||||
icon: Icons.chrome_reader_mode_rounded,
|
||||
onTap: () {}),
|
||||
ListTileWidget(
|
||||
title: 'Explore', icon: Icons.explore_rounded, onTap: () {}),
|
||||
title: 'Browse',
|
||||
subtitle: 'Sources, extensions, global search',
|
||||
icon: Icons.explore_rounded,
|
||||
onTap: () {}),
|
||||
ListTileWidget(
|
||||
onTap: () {
|
||||
context.push('/about');
|
||||
|
|
|
|||
|
|
@ -19,7 +19,12 @@ class ListTileWidget extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
onTap: onTap,
|
||||
subtitle: subtitle != null ? Text(subtitle!) : null,
|
||||
subtitle: subtitle != null
|
||||
? Text(
|
||||
subtitle!,
|
||||
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
|
||||
)
|
||||
: null,
|
||||
leading: SizedBox(
|
||||
height: 40,
|
||||
child: Icon(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ class _MangaImageCardWidgetState extends ConsumerState<MangaImageCardWidget> {
|
|||
favorite: false,
|
||||
link: widget.getMangaDetailModel!.url,
|
||||
source: widget.getMangaDetailModel!.source,
|
||||
lang: widget.lang);
|
||||
lang: widget.lang,
|
||||
dateAdded: DateTime.now().microsecondsSinceEpoch,
|
||||
lastUpdate: DateTime.now().microsecondsSinceEpoch);
|
||||
if (mounted) {
|
||||
context.push('/manga-reader/detail', extra: modelManga);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue