Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
joaojsrbr committed May 10, 2022
1 parent a2af567 commit d4a9dca
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 94 deletions.
1 change: 1 addition & 0 deletions lib/app/data/services/local_storage_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import '../enums/reader_navigation_layout.dart';

class LocalStorageService extends GetxService {
final box = GetStorage();
// ignore: todo
// TODO Need Enhancement in Tachidesk-server
// https://github.com/Suwayomi/Tachidesk-Server/issues/312
// final Rx<Settings> _settings = Settings().obs;
Expand Down
2 changes: 2 additions & 0 deletions lib/app/modules/browse/views/browse_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: no_leading_underscores_for_local_identifiers

import 'package:flutter/material.dart';

import 'package:get/get.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/app/modules/extensions/views/extensions_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: no_leading_underscores_for_local_identifiers

import 'package:flutter/material.dart';

import 'package:cached_network_image/cached_network_image.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/app/modules/home/controllers/home_controller copy.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

Expand Down
6 changes: 3 additions & 3 deletions lib/app/modules/home/views/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import 'package:get/get.dart';

import '../../../../generated/locales.g.dart';
import '../../browse/views/browse_view.dart';
import '../../browse/widgets/browse_appbar_actions.dart';

import '../../downloads/views/downloads_view.dart';
import '../../library/views/library_view.dart';
import '../../library/widgets/library_appbar_actions.dart';

import '../../more/views/more_view.dart';
import '../../updates/views/updates_view.dart';
import '../controllers/home_controller.dart';
import '../widgets/big_screen_navigation_bar.dart';

import '../widgets/small_screen_navigation_bar.dart';

const List<String> navigationBarTitles = [
Expand Down
2 changes: 0 additions & 2 deletions lib/app/modules/home/widgets/small_screen_navigation_bar.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

import 'package:get/get.dart';
import 'package:tachidesk_sorayomi/app/modules/browse/controllers/browse_controller.dart';
import 'package:tachidesk_sorayomi/app/modules/updates/controllers/updates_controller.dart';
Expand Down
4 changes: 3 additions & 1 deletion lib/app/modules/library/views/library_view copy.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// ignore_for_file: file_names

import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:tachidesk_sorayomi/app/modules/browse/widgets/browse_appbar_actions.dart';
import 'package:tachidesk_sorayomi/app/modules/home/controllers/home_controller.dart';
import 'package:tachidesk_sorayomi/app/modules/home/widgets/small_screen_navigation_bar.dart';

import 'package:tachidesk_sorayomi/app/modules/library/widgets/library_appbar_actions.dart';

import '../../../../generated/locales.g.dart';
Expand Down
11 changes: 7 additions & 4 deletions lib/app/modules/library/views/library_view.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// ignore_for_file: no_leading_underscores_for_local_identifiers

import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:grouped_list/sliver_grouped_list.dart';

import 'package:tachidesk_sorayomi/app/modules/browse/widgets/browse_appbar_actions.dart';
import 'package:tachidesk_sorayomi/app/modules/home/controllers/home_controller.dart';
import 'package:tachidesk_sorayomi/app/modules/home/views/home_view.dart';
Expand Down Expand Up @@ -112,7 +114,6 @@ class LibraryView extends GetView<LibraryController> {
// elevation: 0,
pinned: true,
stretch: true,

floating: true,
actions: [
IconButton(
Expand All @@ -131,7 +132,6 @@ class LibraryView extends GetView<LibraryController> {
? BrowseAppBarActions()
: SizedBox())
],

title: Text(navigationBarTitles[0].tr),
bottom: controller.categoryListLength <= 1
? null
Expand All @@ -141,8 +141,11 @@ class LibraryView extends GetView<LibraryController> {
indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Theme.of(context).colorScheme.primary,
// padding: EdgeInsets.all(8),

tabs: controller.categoryList
.map<Tab>((e) => Tab(text: e?.name ?? "Default"))
.map<Tab>((e) => Tab(
text: e?.name ?? "Default",
))
.toList(),
),
)),
Expand Down
18 changes: 10 additions & 8 deletions lib/app/modules/reader/views/reader_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ class ReaderView extends GetView<ReaderController> {
children: [
!controller.isLoading
? controller.chapter.pageCount != null
? Obx(() {
ReaderMode readerMode = controller.readerMode ==
ReaderMode.defaultReader
? controller.localStorageService.readerMode
: controller.readerMode;
return controller.readerModeMap[readerMode]!(
controller: controller);
})
? Obx(
() {
ReaderMode readerMode = controller.readerMode ==
ReaderMode.defaultReader
? controller.localStorageService.readerMode
: controller.readerMode;
return controller.readerModeMap[readerMode]!(
controller: controller);
},
)
: EmoticonsView(
text: "${LocaleKeys.no.tr} "
"${LocaleKeys.readerScreen_chapterError.tr}",
Expand Down
4 changes: 1 addition & 3 deletions lib/app/modules/reader/widgets/paga_number_slider.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'dart:math';

import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:path/path.dart';

import 'package:syncfusion_flutter_sliders/sliders.dart';

import '../controllers/reader_controller.dart';
Expand Down
140 changes: 69 additions & 71 deletions lib/app/modules/reader/widgets/reader_modes/webtoon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/services.dart';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:get/get.dart';
import 'package:pinch_zoom_image_last/pinch_zoom_image_last.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

import '../../../../../generated/locales.g.dart';
Expand Down Expand Up @@ -69,83 +70,80 @@ class Webtoon extends StatelessWidget {
@override
Widget build(BuildContext context) {
initListeners();
return InteractiveViewer(
child: Shortcuts(
shortcuts: {
LogicalKeySet(LogicalKeyboardKey.arrowUp): PreviousScrollIntent(),
LogicalKeySet(LogicalKeyboardKey.arrowDown): NextScrollIntent(),
return Shortcuts(
shortcuts: {
LogicalKeySet(LogicalKeyboardKey.arrowUp): PreviousScrollIntent(),
LogicalKeySet(LogicalKeyboardKey.arrowDown): NextScrollIntent(),
},
child: Actions(
actions: {
PreviousScrollIntent: CallbackAction<PreviousScrollIntent>(
onInvoke: (intent) => controller.previousScroll!(),
),
NextScrollIntent: CallbackAction<NextScrollIntent>(
onInvoke: (intent) => controller.nextScroll!(),
),
},
child: Actions(
actions: {
PreviousScrollIntent: CallbackAction<PreviousScrollIntent>(
onInvoke: (intent) => controller.previousScroll!(),
),
NextScrollIntent: CallbackAction<NextScrollIntent>(
onInvoke: (intent) => controller.nextScroll!(),
),
},
child: Focus(
autofocus: true,
child: ScrollablePositionedList.builder(
itemScrollController: itemScrollController,
itemPositionsListener: itemPositionsListener,
itemCount: controller.chapter.pageCount ?? 0,
itemBuilder: (context, index) {
if (index == (controller.chapter.pageCount! - 1)) {
controller.markAsRead();
}
Map<String, String>? headers =
controller.localStorageService.baseAuthType ==
AuthType.basic
? {
"Authorization":
controller.localStorageService.basicAuth,
}
: null;
return GestureDetector(
onSecondaryTap: () {
readerPageBottomSheet(
context: context,
index: index,
controller: controller,
headers: headers,
);
},
onLongPress: () {
readerPageBottomSheet(
index: index,
context: context,
controller: controller,
headers: headers,
);
},
child: CachedNetworkImage(
fit: BoxFit.fitWidth,
imageUrl: controller.getChapterPage(index),
httpHeaders: headers,
filterQuality: FilterQuality.high,
progressIndicatorBuilder:
(context, url, downloadProgress) => SizedBox(
height: context.height * .7,
child: Center(
child: CircularProgressIndicator(
value: downloadProgress.progress,
),
child: Focus(
autofocus: true,
child: ScrollablePositionedList.builder(
itemScrollController: itemScrollController,
itemPositionsListener: itemPositionsListener,
itemCount: controller.chapter.pageCount ?? 0,
itemBuilder: (context, index) {
if (index == (controller.chapter.pageCount! - 1)) {
controller.markAsRead();
}
Map<String, String>? headers =
controller.localStorageService.baseAuthType == AuthType.basic
? {
"Authorization":
controller.localStorageService.basicAuth,
}
: null;
return GestureDetector(
onSecondaryTap: () {
readerPageBottomSheet(
context: context,
index: index,
controller: controller,
headers: headers,
);
},
onLongPress: () {
readerPageBottomSheet(
index: index,
context: context,
controller: controller,
headers: headers,
);
},
child: CachedNetworkImage(
fit: BoxFit.fitWidth,
imageUrl: controller.getChapterPage(index),
httpHeaders: headers,
filterQuality: FilterQuality.high,
progressIndicatorBuilder: (context, url, downloadProgress) =>
SizedBox(
height: context.height * .7,
child: Center(
child: CircularProgressIndicator(
value: downloadProgress.progress,
),
),
errorWidget: (context, url, error) => SizedBox(
height: context.height,
child: Center(
child: EmoticonsView(
text: "${LocaleKeys.no.tr} "
"${LocaleKeys.readerScreen_image.tr}",
),
),
errorWidget: (context, url, error) => SizedBox(
height: context.height,
child: Center(
child: EmoticonsView(
text: "${LocaleKeys.no.tr} "
"${LocaleKeys.readerScreen_image.tr}",
),
),
),
);
},
),
),
);
},
),
),
),
Expand Down
2 changes: 2 additions & 0 deletions lib/app/modules/sources/views/sources_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: no_leading_underscores_for_local_identifiers

import 'package:flutter/material.dart';

import 'package:cached_network_image/cached_network_image.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/app/modules/updates/views/updates_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import '../../../data/enums/auth_type.dart';
import '../../../data/manga_page_model.dart';
import '../../../routes/app_pages.dart';
import '../../../widgets/emoticons.dart';
import '../../home/controllers/home_controller.dart';

import '../../home/views/home_view.dart';
import '../controllers/updates_controller.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/app/widgets/manga_grid_design copy.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names

import 'package:flutter/material.dart';

import 'package:cached_network_image/cached_network_image.dart';
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
pinch_zoom_image_last:
dependency: "direct main"
description:
name: pinch_zoom_image_last
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.1"
platform:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tachidesk_sorayomi
version: 1.0.12+1
version: 1.0.13+1
publish_to: none
description: A new Flutter frontend for Tachidesk.
environment:
Expand Down Expand Up @@ -29,6 +29,7 @@ dependencies:
scrollable_positioned_list: ^0.2.3
syncfusion_flutter_sliders: ^20.1.52
url_launcher: ^6.0.17
pinch_zoom_image_last: ^0.4.1

dev_dependencies:
flutter_lints: ^2.0.1
Expand Down

0 comments on commit d4a9dca

Please sign in to comment.