format code

This commit is contained in:
deltamaya
2024-11-03 11:51:00 +08:00
parent 03727d114c
commit 9e0e318107
2 changed files with 12 additions and 8 deletions

View File

@@ -45,7 +45,7 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
void updateHistory() async { void updateHistory() async {
var newHistory = await HistoryManager() var newHistory = await HistoryManager()
.find(widget.id, ComicType(widget.sourceKey.hashCode)); .find(widget.id, ComicType(widget.sourceKey.hashCode));
if(newHistory?.ep != history?.ep || newHistory?.page != history?.page) { if (newHistory?.ep != history?.ep || newHistory?.page != history?.page) {
history = newHistory; history = newHistory;
update(); update();
} }
@@ -249,7 +249,7 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
onPressed: continueRead, onPressed: continueRead,
iconColor: context.useTextColor(Colors.yellow), iconColor: context.useTextColor(Colors.yellow),
), ),
if(!isMobile || hasHistory) if (!isMobile || hasHistory)
_ActionButton( _ActionButton(
icon: const Icon(Icons.play_circle_outline), icon: const Icon(Icons.play_circle_outline),
text: 'Start'.tl, text: 'Start'.tl,
@@ -268,7 +268,9 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
icon: const Icon(Icons.favorite_border), icon: const Icon(Icons.favorite_border),
activeIcon: const Icon(Icons.favorite), activeIcon: const Icon(Icons.favorite),
isActive: isLiked, isActive: isLiked,
text: ((data!.likesCount!=null) ?(data!.likesCount!+(isLiked?1:0)) :(isLiked ? 'Liked'.tl : 'Like'.tl)) text: ((data!.likesCount != null)
? (data!.likesCount! + (isLiked ? 1 : 0))
: (isLiked ? 'Liked'.tl : 'Like'.tl))
.toString(), .toString(),
isLoading: isLiking, isLoading: isLiking,
onPressed: likeOrUnlike, onPressed: likeOrUnlike,

View File

@@ -107,7 +107,7 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
} }
void openOrClose() { void openOrClose() {
if(!_isOpen) { if (!_isOpen) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
} else { } else {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive); SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
@@ -147,7 +147,9 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
), ),
AnimatedPositioned( AnimatedPositioned(
duration: const Duration(milliseconds: 180), duration: const Duration(milliseconds: 180),
bottom: _isOpen ? 0 : -(kBottomBarHeight + MediaQuery.of(context).padding.bottom), bottom: _isOpen
? 0
: -(kBottomBarHeight + MediaQuery.of(context).padding.bottom),
left: 0, left: 0,
right: 0, right: 0,
child: buildBottom(), child: buildBottom(),
@@ -218,7 +220,7 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
if (!context.reader.toPrevChapter()) { if (!context.reader.toPrevChapter()) {
context.reader.toPage(1); context.reader.toPage(1);
} else { } else {
if(showFloatingButtonValue != 0) { if (showFloatingButtonValue != 0) {
setState(() { setState(() {
showFloatingButtonValue = 0; showFloatingButtonValue = 0;
}); });
@@ -235,7 +237,7 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
if (!context.reader.toNextChapter()) { if (!context.reader.toNextChapter()) {
context.reader.toPage(context.reader.maxPage); context.reader.toPage(context.reader.maxPage);
} else { } else {
if(showFloatingButtonValue != 0) { if (showFloatingButtonValue != 0) {
setState(() { setState(() {
showFloatingButtonValue = 0; showFloatingButtonValue = 0;
}); });
@@ -541,7 +543,7 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
height: value.clamp(0, 58*3) / 3, height: value.clamp(0, 58 * 3) / 3,
child: ColoredBox( child: ColoredBox(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme