Skip to content

Commit

Permalink
Restructure directories
Browse files Browse the repository at this point in the history
  • Loading branch information
r52 committed Nov 24, 2024
1 parent e2f797c commit 92870d3
Show file tree
Hide file tree
Showing 66 changed files with 108 additions and 113 deletions.
2 changes: 1 addition & 1 deletion lib/drawer.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:gagaku/util/util.dart';
import 'package:gagaku/version.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/local/archive_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:archive/archive_io.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/local/model.dart';
import 'package:gagaku/local/types.dart';
import 'package:gagaku/local/model/model.dart';
import 'package:gagaku/local/model/types.dart';
import 'package:gagaku/reader/main.dart';
import 'package:gagaku/reader/types.dart';
import 'package:gagaku/reader/model/types.dart';
import 'package:gagaku/util/ui.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand Down
4 changes: 2 additions & 2 deletions lib/local/directory_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import 'dart:io';
import 'package:collection/collection.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/local/model.dart';
import 'package:gagaku/local/model/model.dart';
import 'package:gagaku/reader/main.dart';
import 'package:gagaku/reader/types.dart';
import 'package:gagaku/reader/model/types.dart';
import 'package:gagaku/util/ui.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand Down
4 changes: 2 additions & 2 deletions lib/local/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/drawer.dart';
import 'package:gagaku/local/archive_reader.dart';
import 'package:gagaku/local/config.dart';
import 'package:gagaku/local/model/config.dart';
import 'package:gagaku/local/directory_reader.dart';
import 'package:gagaku/local/model.dart';
import 'package:gagaku/local/model/model.dart';
import 'package:gagaku/local/settings.dart';
import 'package:gagaku/local/widgets.dart';
import 'package:gagaku/util/ui.dart';
Expand Down
5 changes: 2 additions & 3 deletions lib/local/config.dart → lib/local/model/config.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:convert';

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand All @@ -14,8 +14,7 @@ class LocalLibConfig with _$LocalLibConfig {
@Default('') String libraryDirectory,
}) = _LocalLibConfig;

factory LocalLibConfig.fromJson(Map<String, dynamic> json) =>
_$LocalLibConfigFromJson(json);
factory LocalLibConfig.fromJson(Map<String, dynamic> json) => _$LocalLibConfigFromJson(json);
}

@Riverpod(keepAlive: true)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/local/model.dart → lib/local/model/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:io';
import 'package:collection/collection.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:gagaku/local/config.dart';
import 'package:gagaku/local/model/config.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/local/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/local/config.dart';
import 'package:gagaku/local/model/config.dart';
import 'package:gagaku/util/ui.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:permission_handler/permission_handler.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/local/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/config.dart';
import 'package:gagaku/local/model.dart';
import 'package:gagaku/model/config.dart';
import 'package:gagaku/local/model/model.dart';
import 'package:gagaku/util/ui.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

Expand Down
8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/config.dart';
import 'package:gagaku/model/config.dart';
import 'package:gagaku/local/main.dart';
import 'package:gagaku/log.dart';
import 'package:gagaku/cache.dart';
import 'package:gagaku/model/cache.dart';
import 'package:gagaku/mangadex/chapter_feed.dart';
import 'package:gagaku/mangadex/creator_view.dart';
import 'package:gagaku/mangadex/edit_list.dart';
Expand All @@ -23,9 +23,9 @@ import 'package:gagaku/mangadex/manga_view.dart';
import 'package:gagaku/mangadex/reader.dart';
import 'package:gagaku/mangadex/recent_feed.dart';
import 'package:gagaku/mangadex/search.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:gagaku/settings.dart';
import 'package:gagaku/types.dart';
import 'package:gagaku/model/types.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
import 'package:gagaku/web/favorites.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/chapter_feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/manga_feed.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/default_scroll_controller.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/creator_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/edit_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/frontpage.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/default_scroll_controller.dart';
import 'package:gagaku/util/ui.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/mangadex/group_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:animations/animations.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/config.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/config.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/history_feed.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/default_scroll_controller.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/latest_feed.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:math';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/default_scroll_controller.dart';
import 'package:gagaku/util/ui.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'package:animations/animations.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/mangadex/lists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/drawer.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:gagaku/util/default_scroll_controller.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/mangadex/login_auth.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/util/ui.dart';

class MangaDexLoginWidget extends StatelessWidget {
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/login_password.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:gagaku/util/ui.dart';
import 'package:go_router/go_router.dart';
import 'package:hive_flutter/hive_flutter.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/drawer.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:gagaku/util/default_scroll_controller.dart';
import 'package:gagaku/util/util.dart';
import 'package:go_router/go_router.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/manga_feed.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/manga_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/cache.dart → lib/mangadex/model/cache.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:convert';

import 'package:gagaku/cache.dart';
import 'package:gagaku/model/cache.dart';
import 'package:gagaku/log.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/types.dart';

extension MDCacheManagerExt on CacheManager {
/// Adds all API data from a [list] into the cache, resolving its ids automatically
Expand Down
11 changes: 4 additions & 7 deletions lib/mangadex/config.dart → lib/mangadex/model/config.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:convert';

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/model/model.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/types.dart';

part 'config.freezed.dart';
part 'config.g.dart';
Expand All @@ -14,15 +14,12 @@ class MangaDexConfig with _$MangaDexConfig {
factory MangaDexConfig({
@Default({}) @LanguageConverter() Set<Language> translatedLanguages,
@Default({}) @LanguageConverter() Set<Language> originalLanguage,
@Default(
{ContentRating.safe, ContentRating.suggestive, ContentRating.erotica})
Set<ContentRating> contentRating,
@Default({ContentRating.safe, ContentRating.suggestive, ContentRating.erotica}) Set<ContentRating> contentRating,
@Default(false) bool dataSaver,
@Default({}) Set<String> groupBlacklist,
}) = _MangaDexConfig;

factory MangaDexConfig.fromJson(Map<String, dynamic> json) =>
_$MangaDexConfigFromJson(json);
factory MangaDexConfig.fromJson(Map<String, dynamic> json) => _$MangaDexConfigFromJson(json);
}

@riverpod
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions lib/mangadex/model.dart → lib/mangadex/model/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import 'dart:math';

import 'package:gagaku/util/http.dart';
import 'package:gagaku/log.dart';
import 'package:gagaku/cache.dart';
import 'package:gagaku/mangadex/cache.dart';
import 'package:gagaku/mangadex/config.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/model.dart';
import 'package:gagaku/model/cache.dart';
import 'package:gagaku/mangadex/model/cache.dart';
import 'package:gagaku/mangadex/model/config.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/model/model.dart';
import 'package:gagaku/util/util.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:mutex/mutex.dart';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/mangadex/reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/reader/main.dart';
import 'package:gagaku/reader/types.dart';
import 'package:gagaku/reader/model/types.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
import 'package:go_router/go_router.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/recent_feed.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/mangadex/search.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/mangadex/widgets.dart';
import 'package:gagaku/util/ui.dart';
import 'package:gagaku/util/util.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/mangadex/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gagaku/log.dart';
import 'package:gagaku/mangadex/config.dart';
import 'package:gagaku/mangadex/model.dart';
import 'package:gagaku/mangadex/types.dart';
import 'package:gagaku/mangadex/model/config.dart';
import 'package:gagaku/mangadex/model/model.dart';
import 'package:gagaku/mangadex/model/types.dart';
import 'package:gagaku/util/ui.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
Expand Down
Loading

0 comments on commit 92870d3

Please sign in to comment.