From 9dcc99ca3630124a18c1d193aa10b4d7822f8584 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 12 Apr 2023 16:16:58 +0200 Subject: [PATCH] chore(all): Format --- lib/licenses.g.dart | 396 ++++++++++++++++-------- lib/main.dart | 20 +- lib/src/data/anime.dart | 8 +- lib/src/data/manga.dart | 9 +- lib/src/data/type.dart | 63 ++-- lib/src/service/database.dart | 16 +- lib/src/ui/bloc/anime_list_bloc.dart | 119 ++++--- lib/src/ui/bloc/anime_list_event.dart | 4 +- lib/src/ui/bloc/anime_search_bloc.dart | 116 ++++--- lib/src/ui/bloc/anime_search_event.dart | 2 +- lib/src/ui/bloc/details_bloc.dart | 52 ++-- lib/src/ui/bloc/navigation_bloc.dart | 20 +- lib/src/ui/bloc/navigation_event.dart | 8 +- lib/src/ui/pages/about.dart | 11 +- lib/src/ui/pages/anime_list.dart | 158 +++++----- lib/src/ui/pages/anime_search.dart | 31 +- lib/src/ui/pages/details.dart | 388 ++++++++++++----------- lib/src/ui/widgets/dropdown.dart | 82 ++--- lib/src/ui/widgets/grid_item.dart | 4 +- lib/src/ui/widgets/image.dart | 11 +- lib/src/ui/widgets/integer_input.dart | 6 +- lib/src/ui/widgets/list_item.dart | 14 +- 22 files changed, 913 insertions(+), 625 deletions(-) diff --git a/lib/licenses.g.dart b/lib/licenses.g.dart index 222428c..6c8a7c4 100644 --- a/lib/licenses.g.dart +++ b/lib/licenses.g.dart @@ -5,8 +5,10 @@ const ossLicenses = [ Package( name: '_fe_analyzer_shared', - description: 'Logic that is shared between the front_end and analyzer packages.', - repository: 'https://github.com/dart-lang/sdk/tree/main/pkg/_fe_analyzer_shared', + description: + 'Logic that is shared between the front_end and analyzer packages.', + repository: + 'https://github.com/dart-lang/sdk/tree/main/pkg/_fe_analyzer_shared', authors: [], version: '50.0.0', license: '''Copyright 2019, the Dart project authors. @@ -42,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'analyzer', - description: 'This package provides a library that performs static analysis of Dart code.', + description: + 'This package provides a library that performs static analysis of Dart code.', repository: 'https://github.com/dart-lang/sdk/tree/main/pkg/analyzer', authors: [], version: '5.2.0', @@ -79,7 +82,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'archive', - description: 'Provides encoders and decoders for various archive and compression formats such as zip, tar, bzip2, gzip, and zlib.', + description: + 'Provides encoders and decoders for various archive and compression formats such as zip, tar, bzip2, gzip, and zlib.', repository: 'https://github.com/brendan-duncan/archive', authors: [], version: '3.3.6', @@ -111,7 +115,8 @@ THE SOFTWARE.''', ), Package( name: 'args', - description: 'Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.', + description: + 'Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.', repository: 'https://github.com/dart-lang/args', authors: [], version: '2.3.2', @@ -148,7 +153,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'async', - description: 'Utility functions and classes related to the \'dart:async\' library.', + description: + 'Utility functions and classes related to the \'dart:async\' library.', repository: 'https://github.com/dart-lang/async', authors: [], version: '2.9.0', @@ -185,7 +191,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'bloc', - description: 'A predictable state management library that helps implement the BLoC (Business Logic Component) design pattern.', + description: + 'A predictable state management library that helps implement the BLoC (Business Logic Component) design pattern.', homepage: 'https://github.com/felangel/bloc', repository: 'https://github.com/felangel/bloc/tree/master/packages/bloc', authors: [], @@ -217,7 +224,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.''', ), Package( name: 'boolean_selector', - description: 'A flexible syntax for boolean expressions, based on a simplified version of Dart\'s expression syntax.', + description: + 'A flexible syntax for boolean expressions, based on a simplified version of Dart\'s expression syntax.', homepage: 'https://github.com/dart-lang/boolean_selector', authors: [], version: '2.1.0', @@ -253,7 +261,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'bottom_bar', - description: 'Bottom bar helps create an optimized bottom navigation bar with beautiful animations', + description: + 'Bottom bar helps create an optimized bottom navigation bar with beautiful animations', homepage: 'https://github.com/CoderUni/bottom_bar/', authors: [], version: '2.0.3', @@ -284,7 +293,8 @@ SOFTWARE.''', ), Package( name: 'build', - description: 'A package for authoring build_runner compatible code generators.', + description: + 'A package for authoring build_runner compatible code generators.', repository: 'https://github.com/dart-lang/build/tree/master/build', authors: [], version: '2.3.1', @@ -321,7 +331,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'build_config', - description: 'Format definition and support for parsing `build.yaml` configuration.', + description: + 'Format definition and support for parsing `build.yaml` configuration.', repository: 'https://github.com/dart-lang/build/tree/master/build_config', authors: [], version: '1.1.1', @@ -396,7 +407,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'build_resolvers', description: 'Resolve Dart code in a Builder', - repository: 'https://github.com/dart-lang/build/tree/master/build_resolvers', + repository: + 'https://github.com/dart-lang/build/tree/master/build_resolvers', authors: [], version: '2.1.0', license: '''Copyright 2018, the Dart project authors. @@ -432,7 +444,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'build_runner', - description: 'A build system for Dart code generation and modular compilation.', + description: + 'A build system for Dart code generation and modular compilation.', repository: 'https://github.com/dart-lang/build/tree/master/build_runner', authors: [], version: '2.3.3', @@ -469,8 +482,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'build_runner_core', - description: 'Core tools to organize the structure of a build and run Builders.', - repository: 'https://github.com/dart-lang/build/tree/master/build_runner_core', + description: + 'Core tools to organize the structure of a build and run Builders.', + repository: + 'https://github.com/dart-lang/build/tree/master/build_runner_core', authors: [], version: '7.2.7', license: '''Copyright 2018, the Dart project authors. @@ -506,7 +521,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'built_collection', - description: '''Immutable collections based on the SDK collections. Each SDK collection class is split into a new immutable collection class and a corresponding mutable builder class. + description: + '''Immutable collections based on the SDK collections. Each SDK collection class is split into a new immutable collection class and a corresponding mutable builder class. ''', homepage: 'https://github.com/google/built_collection.dart', authors: [], @@ -545,9 +561,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'built_value', - description: '''Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency. + description: + '''Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency. ''', - repository: 'https://github.com/google/built_value.dart/tree/master/built_value', + repository: + 'https://github.com/google/built_value.dart/tree/master/built_value', authors: [], version: '8.4.3', license: '''Copyright 2015, Google Inc. All rights reserved. @@ -584,7 +602,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'cached_network_image', - description: 'Flutter library to load and cache network images. Can also be used with placeholder and error widgets.', + description: + 'Flutter library to load and cache network images. Can also be used with placeholder and error widgets.', homepage: 'https://github.com/Baseflow/flutter_cached_network_image', authors: [], version: '3.2.3', @@ -677,7 +696,8 @@ SOFTWARE.''', ), Package( name: 'characters', - description: 'String replacement with operations that are Unicode/grapheme cluster aware.', + description: + 'String replacement with operations that are Unicode/grapheme cluster aware.', repository: 'https://github.com/dart-lang/characters', authors: [], version: '1.2.1', @@ -714,8 +734,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'checked_yaml', - description: 'Generate more helpful exceptions when decoding YAML documents using package:json_serializable and package:yaml.', - repository: 'https://github.com/google/json_serializable.dart/tree/master/checked_yaml', + description: + 'Generate more helpful exceptions when decoding YAML documents using package:json_serializable and package:yaml.', + repository: + 'https://github.com/google/json_serializable.dart/tree/master/checked_yaml', authors: [], version: '2.0.2', license: '''Copyright 2019, the Dart project authors. All rights reserved. @@ -998,7 +1020,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'code_builder', - description: 'A fluent, builder-based library for generating valid Dart code', + description: + 'A fluent, builder-based library for generating valid Dart code', repository: 'https://github.com/dart-lang/code_builder', authors: [], version: '4.4.0', @@ -1035,7 +1058,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'collection', - description: 'Collections and utilities functions and classes related to collections.', + description: + 'Collections and utilities functions and classes related to collections.', repository: 'https://github.com/dart-lang/collection', authors: [], version: '1.16.0', @@ -1072,7 +1096,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'convert', - description: 'Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.', + description: + 'Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.', repository: 'https://github.com/dart-lang/convert', authors: [], version: '3.1.1', @@ -1109,7 +1134,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'crypto', - description: 'Implementations of SHA, MD5, and HMAC cryptographic functions', + description: + 'Implementations of SHA, MD5, and HMAC cryptographic functions', repository: 'https://github.com/dart-lang/crypto', authors: [], version: '3.0.2', @@ -1146,8 +1172,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'cupertino_icons', - description: 'Default icons asset for Cupertino widgets based on Apple styled icons', - repository: 'https://github.com/flutter/packages/tree/main/third_party/packages/cupertino_icons', + description: + 'Default icons asset for Cupertino widgets based on Apple styled icons', + repository: + 'https://github.com/flutter/packages/tree/main/third_party/packages/cupertino_icons', authors: [], version: '1.0.5', license: '''The MIT License (MIT) @@ -1176,8 +1204,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''', ), Package( name: 'dart_pubspec_licenses', - description: 'A library to make it easy to extract OSS license information from Dart packages using pubspec.yaml', - homepage: 'https://github.com/espresso3389/flutter_oss_licenses/tree/master/packages/dart_pubspec_licenses', + description: + 'A library to make it easy to extract OSS license information from Dart packages using pubspec.yaml', + homepage: + 'https://github.com/espresso3389/flutter_oss_licenses/tree/master/packages/dart_pubspec_licenses', repository: 'https://github.com/espresso3389/flutter_oss_licenses', authors: [], version: '2.0.2', @@ -1208,7 +1238,8 @@ SOFTWARE.''', ), Package( name: 'dart_style', - description: 'Opinionated, automatic Dart source code formatter. Provides an API and a CLI tool.', + description: + 'Opinionated, automatic Dart source code formatter. Provides an API and a CLI tool.', repository: 'https://github.com/dart-lang/dart_style', authors: [], version: '2.2.4', @@ -1245,7 +1276,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'fake_async', - description: 'Fake asynchronous events such as timers and microtasks for deterministic testing.', + description: + 'Fake asynchronous events such as timers and microtasks for deterministic testing.', repository: 'https://github.com/dart-lang/fake_async', authors: [], version: '1.3.1', @@ -1456,7 +1488,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'ffi', - description: 'Utilities for working with Foreign Function Interface (FFI) code.', + description: + 'Utilities for working with Foreign Function Interface (FFI) code.', repository: 'https://github.com/dart-lang/ffi', authors: [], version: '2.0.1', @@ -1493,7 +1526,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'file', - description: 'A pluggable, mockable file system abstraction for Dart. Supports local file system access, as well as in-memory file systems, record-replay file systems, and chroot file systems.', + description: + 'A pluggable, mockable file system abstraction for Dart. Supports local file system access, as well as in-memory file systems, record-replay file systems, and chroot file systems.', repository: 'https://github.com/google/file.dart/tree/master/packages/file', authors: [], version: '6.1.4', @@ -1529,7 +1563,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'fixnum', - description: 'Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes.', + description: + 'Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes.', repository: 'https://github.com/dart-lang/fixnum', authors: [], version: '1.0.1', @@ -1601,9 +1636,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'flutter_bloc', - description: 'Flutter Widgets that make it easy to implement the BLoC (Business Logic Component) design pattern. Built to be used with the bloc state management package.', + description: + 'Flutter Widgets that make it easy to implement the BLoC (Business Logic Component) design pattern. Built to be used with the bloc state management package.', homepage: 'https://bloclibrary.dev', - repository: 'https://github.com/felangel/bloc/tree/master/packages/flutter_bloc', + repository: + 'https://github.com/felangel/bloc/tree/master/packages/flutter_bloc', authors: [], version: '8.1.1', license: '''The MIT License (MIT) @@ -1633,7 +1670,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.''', ), Package( name: 'flutter_blurhash', - description: 'Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium', + description: + 'Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium', homepage: 'https://github.com/fluttercommunity/flutter_blurhash', authors: [], version: '0.7.0', @@ -1664,8 +1702,10 @@ SOFTWARE.''', ), Package( name: 'flutter_cache_manager', - description: 'Generic cache manager for flutter. Saves web files on the storages of the device and saves the cache info using sqflite.', - homepage: 'https://github.com/Baseflow/flutter_cache_manager/tree/master/flutter_cache_manager', + description: + 'Generic cache manager for flutter. Saves web files on the storages of the device and saves the cache info using sqflite.', + homepage: + 'https://github.com/Baseflow/flutter_cache_manager/tree/master/flutter_cache_manager', authors: [], version: '3.3.0', license: '''The MIT License (MIT) @@ -1695,7 +1735,8 @@ SOFTWARE.''', ), Package( name: 'flutter_launcher_icons', - description: 'A package which simplifies the task of updating your Flutter app\'s launcher icon.', + description: + 'A package which simplifies the task of updating your Flutter app\'s launcher icon.', homepage: 'https://github.com/fluttercommunity/flutter_launcher_icons', repository: 'https://github.com/fluttercommunity/flutter_launcher_icons/', authors: [], @@ -1727,8 +1768,10 @@ SOFTWARE.''', ), Package( name: 'flutter_lints', - description: 'Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.', - repository: 'https://github.com/flutter/packages/tree/main/packages/flutter_lints', + description: + 'Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.', + repository: + 'https://github.com/flutter/packages/tree/main/packages/flutter_lints', authors: [], version: '2.0.1', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -1762,8 +1805,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'flutter_oss_licenses', - description: 'A tool to generate detail and better OSS license list using pubspec.yaml/lock files.', - homepage: 'https://github.com/espresso3389/flutter_oss_licenses/tree/master/packages/flutter_oss_licenses', + description: + 'A tool to generate detail and better OSS license list using pubspec.yaml/lock files.', + homepage: + 'https://github.com/espresso3389/flutter_oss_licenses/tree/master/packages/flutter_oss_licenses', repository: 'https://github.com/espresso3389/flutter_oss_licenses', authors: [], version: '2.0.1', @@ -1794,7 +1839,8 @@ SOFTWARE.''', ), Package( name: 'freezed', - description: '''Code generation for immutable classes that has a simple syntax/API without compromising on the features. + description: + '''Code generation for immutable classes that has a simple syntax/API without compromising on the features. ''', repository: 'https://github.com/rrousselGit/freezed', authors: [], @@ -1826,7 +1872,8 @@ SOFTWARE.''', ), Package( name: 'freezed_annotation', - description: '''Annotations for the freezed code-generator. This package does nothing without freezed too. + description: + '''Annotations for the freezed code-generator. This package does nothing without freezed too. ''', homepage: 'https://github.com/rrousselGit/freezed', authors: [], @@ -1858,8 +1905,10 @@ SOFTWARE.''', ), Package( name: 'frontend_server_client', - description: 'Client code to start and interact with the frontend_server compiler from the Dart SDK.', - repository: 'https://github.com/dart-lang/webdev/tree/master/frontend_server_client', + description: + 'Client code to start and interact with the frontend_server compiler from the Dart SDK.', + repository: + 'https://github.com/dart-lang/webdev/tree/master/frontend_server_client', authors: [], version: '3.2.0', license: '''Copyright 2020, the Dart project authors. @@ -1895,9 +1944,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'get_it', - description: 'Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"', + description: + 'Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"', homepage: 'https://github.com/fluttercommunity/get_it', - authors: ['Flutter Community ', 'Thomas Burkhart '], + authors: [ + 'Flutter Community ', + 'Thomas Burkhart ' + ], version: '7.2.0', license: '''MIT License @@ -1963,7 +2016,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'graphs', - description: 'Graph algorithms that operate on graphs in any representation', + description: + 'Graph algorithms that operate on graphs in any representation', repository: 'https://github.com/dart-lang/graphs', authors: [], version: '2.2.0', @@ -2000,7 +2054,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'http', - description: 'A composable, multi-platform, Future-based API for HTTP requests.', + description: + 'A composable, multi-platform, Future-based API for HTTP requests.', repository: 'https://github.com/dart-lang/http/tree/master/pkgs/http', authors: [], version: '0.13.5', @@ -2037,7 +2092,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'http_multi_server', - description: 'A dart:io HttpServer wrapper that handles requests from multiple servers.', + description: + 'A dart:io HttpServer wrapper that handles requests from multiple servers.', repository: 'https://github.com/dart-lang/http_multi_server', authors: [], version: '3.2.1', @@ -2074,7 +2130,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'http_parser', - description: 'A platform-independent package for parsing and serializing HTTP formats.', + description: + 'A platform-independent package for parsing and serializing HTTP formats.', repository: 'https://github.com/dart-lang/http_parser', authors: [], version: '4.0.2', @@ -2111,7 +2168,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'image', - description: 'Provides server and web apps the ability to load, manipulate, and save images with various image file formats including PNG, JPEG, GIF, BMP, WebP, TIFF, TGA, PSD, PVR, and OpenEXR.', + description: + 'Provides server and web apps the ability to load, manipulate, and save images with various image file formats including PNG, JPEG, GIF, BMP, WebP, TIFF, TGA, PSD, PVR, and OpenEXR.', homepage: 'https://github.com/brendan-duncan/image', authors: [], version: '3.3.0', @@ -2143,7 +2201,8 @@ THE SOFTWARE.''', ), Package( name: 'io', - description: 'Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values.', + description: + 'Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values.', repository: 'https://github.com/dart-lang/io', authors: [], version: '1.0.4', @@ -2180,7 +2239,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'jikan_api', - description: 'Dart wrapper for the Jikan API, an unofficial MyAnimeList API.', + description: + 'Dart wrapper for the Jikan API, an unofficial MyAnimeList API.', homepage: 'https://github.com/javoeria/jikan-dart', authors: [], version: '2.0.0', @@ -2211,7 +2271,8 @@ SOFTWARE.''', ), Package( name: 'js', - description: 'Annotations to create static Dart interfaces for JavaScript APIs.', + description: + 'Annotations to create static Dart interfaces for JavaScript APIs.', homepage: 'https://github.com/dart-lang/sdk/tree/master/pkg/js', authors: [], version: '0.6.4', @@ -2248,8 +2309,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'json_annotation', - description: 'Classes and helper functions that support JSON code generation via the `json_serializable` package.', - repository: 'https://github.com/google/json_serializable.dart/tree/master/json_annotation', + description: + 'Classes and helper functions that support JSON code generation via the `json_serializable` package.', + repository: + 'https://github.com/google/json_serializable.dart/tree/master/json_annotation', authors: [], version: '4.6.0', license: '''Copyright 2017, the Dart project authors. All rights reserved. @@ -2284,8 +2347,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'json_serializable', - description: 'Automatically generate code for converting to and from JSON by annotating Dart classes.', - repository: 'https://github.com/google/json_serializable.dart/tree/master/json_serializable', + description: + 'Automatically generate code for converting to and from JSON by annotating Dart classes.', + repository: + 'https://github.com/google/json_serializable.dart/tree/master/json_serializable', authors: [], version: '6.3.2', license: '''Copyright 2017, the Dart project authors. All rights reserved. @@ -2320,7 +2385,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'lints', - description: '''Official Dart lint rules. Defines the \'core\' and \'recommended\' set of lints suggested by the Dart team. + description: + '''Official Dart lint rules. Defines the \'core\' and \'recommended\' set of lints suggested by the Dart team. ''', repository: 'https://github.com/dart-lang/lints', authors: [], @@ -2358,7 +2424,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'logging', - description: 'Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger.', + description: + 'Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger.', repository: 'https://github.com/dart-lang/logging', authors: [], version: '1.1.1', @@ -2395,7 +2462,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'matcher', - description: 'Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases.', + description: + 'Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases.', repository: 'https://github.com/dart-lang/matcher', authors: [], version: '0.12.12', @@ -2432,8 +2500,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'material_color_utilities', - description: 'Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.', - repository: 'https://github.com/material-foundation/material-color-utilities', + description: + 'Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.', + repository: + 'https://github.com/material-foundation/material-color-utilities', authors: [], version: '0.1.5', license: '''Apache License @@ -2643,7 +2713,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'meta', - description: 'Annotations used to express developer intentions that can\'t otherwise be deduced by statically analyzing source code.', + description: + 'Annotations used to express developer intentions that can\'t otherwise be deduced by statically analyzing source code.', repository: 'https://github.com/dart-lang/sdk/tree/main/pkg/meta', authors: [], version: '1.8.0', @@ -2680,7 +2751,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'mime', - description: 'Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.', + description: + 'Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.', repository: 'https://github.com/dart-lang/mime', authors: [], version: '1.0.4', @@ -2717,7 +2789,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'nested', - description: 'A Flutter Widget which helps nest multiple widgets without needing to manually nest them.', + description: + 'A Flutter Widget which helps nest multiple widgets without needing to manually nest them.', repository: 'https://github.com/rrousselGit/nested', authors: [], version: '1.0.0', @@ -2748,7 +2821,8 @@ SOFTWARE.''', ), Package( name: 'octo_image', - description: 'A multifunctional Flutter image widget. Supports placeholders, error widgets and image transformers with fading.', + description: + 'A multifunctional Flutter image widget. Supports placeholders, error widgets and image transformers with fading.', homepage: 'https://github.com/Baseflow/octo_image', authors: [], version: '1.0.2', @@ -2779,7 +2853,8 @@ SOFTWARE.''', ), Package( name: 'package_config', - description: 'Support for reading and writing Dart Package Configuration files.', + description: + 'Support for reading and writing Dart Package Configuration files.', repository: 'https://github.com/dart-lang/package_config', authors: [], version: '2.1.0', @@ -2816,7 +2891,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'path', - description: 'A string-based path manipulation library. All of the path operations you know and love, with solid support for Windows, POSIX (Linux and Mac OS X), and the web.', + description: + 'A string-based path manipulation library. All of the path operations you know and love, with solid support for Windows, POSIX (Linux and Mac OS X), and the web.', repository: 'https://github.com/dart-lang/path', authors: [], version: '1.8.2', @@ -2853,8 +2929,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'path_provider', - description: 'Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider', + description: + 'Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider', authors: [], version: '2.0.12', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -2889,7 +2967,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'path_provider_android', description: 'Android implementation of the path_provider plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_android', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_android', authors: [], version: '2.0.22', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -2924,7 +3003,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'path_provider_foundation', description: 'iOS and macOS implementation of the path_provider plugin', - repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_foundation', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_foundation', authors: [], version: '2.1.1', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -2959,7 +3039,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'path_provider_linux', description: 'Linux implementation of the path_provider plugin', - repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_linux', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_linux', authors: [], version: '2.1.7', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -2994,7 +3075,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'path_provider_platform_interface', description: 'A common platform interface for the path_provider plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_platform_interface', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_platform_interface', authors: [], version: '2.0.5', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -3029,7 +3111,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'path_provider_windows', description: 'Windows implementation of the path_provider plugin', - repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_windows', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_windows', authors: [], version: '2.1.3', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -3063,7 +3146,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'pedantic', - description: 'The Dart analyzer settings and best practices used internally at Google.', + description: + 'The Dart analyzer settings and best practices used internally at Google.', homepage: 'https://github.com/google/pedantic', authors: [], version: '1.11.1', @@ -3099,7 +3183,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'petitparser', - description: 'A dynamic parser framework to build efficient grammars and parsers quickly.', + description: + 'A dynamic parser framework to build efficient grammars and parsers quickly.', homepage: 'https://petitparser.github.io', repository: 'https://github.com/petitparser/dart-petitparser', authors: [], @@ -3168,8 +3253,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'plugin_platform_interface', - description: 'Reusable base class for platform interfaces of Flutter federated plugins, to help enforce best practices.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/plugin_platform_interface', + description: + 'Reusable base class for platform interfaces of Flutter federated plugins, to help enforce best practices.', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/plugin_platform_interface', authors: [], version: '2.1.3', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -3203,11 +3290,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'pointycastle', - description: 'A Dart library implementing cryptographic algorithms and primitives, modeled on the BouncyCastle library.', + description: + 'A Dart library implementing cryptographic algorithms and primitives, modeled on the BouncyCastle library.', homepage: 'https://github.com/bcgit/pc-dart', authors: [], version: '3.6.2', - license: '''Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) + license: + '''Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in @@ -3231,7 +3320,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''', ), Package( name: 'pool', - description: 'Manage a finite pool of resources. Useful for controlling concurrent file system or network requests.', + description: + 'Manage a finite pool of resources. Useful for controlling concurrent file system or network requests.', repository: 'https://github.com/dart-lang/pool', authors: [], version: '1.5.1', @@ -3268,7 +3358,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'process', - description: 'A pluggable, mockable process invocation abstraction for Dart.', + description: + 'A pluggable, mockable process invocation abstraction for Dart.', homepage: 'https://github.com/google/process.dart', authors: [], version: '4.2.4', @@ -3304,7 +3395,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'provider', - description: 'A wrapper around InheritedWidget to make them easier to use and more reusable.', + description: + 'A wrapper around InheritedWidget to make them easier to use and more reusable.', repository: 'https://github.com/rrousselGit/provider', authors: [], version: '6.0.5', @@ -3335,7 +3427,8 @@ SOFTWARE.''', ), Package( name: 'pub_semver', - description: 'Versions and version constraints implementing pub\'s versioning policy. This is very similar to vanilla semver, with a few corner cases.', + description: + 'Versions and version constraints implementing pub\'s versioning policy. This is very similar to vanilla semver, with a few corner cases.', repository: 'https://github.com/dart-lang/pub_semver', authors: [], version: '2.1.3', @@ -3372,7 +3465,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'pubspec_parse', - description: 'Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting.', + description: + 'Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting.', repository: 'https://github.com/dart-lang/pubspec_parse', authors: [], version: '1.2.1', @@ -3409,12 +3503,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'rxdart', - description: '''RxDart is an implementation of the popular reactiveX api for asynchronous programming, leveraging the native Dart Streams api. + description: + '''RxDart is an implementation of the popular reactiveX api for asynchronous programming, leveraging the native Dart Streams api. ''', repository: 'https://github.com/ReactiveX/rxdart', authors: [], version: '0.27.7', - license: '''Licensed under the Apache License, Version 2.0 (the "License"); you + license: + '''Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -3431,7 +3527,8 @@ and limitations under the License.''', ), Package( name: 'shelf', - description: '''A model for web server middleware that encourages composition and easy reuse. + description: + '''A model for web server middleware that encourages composition and easy reuse. ''', repository: 'https://github.com/dart-lang/shelf/tree/master/pkgs/shelf', authors: [], @@ -3469,9 +3566,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'shelf_web_socket', - description: '''A shelf handler that wires up a listener for every connection. + description: + '''A shelf handler that wires up a listener for every connection. ''', - repository: 'https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_web_socket', + repository: + 'https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_web_socket', authors: [], version: '1.0.3', license: '''Copyright 2014, the Dart project authors. @@ -3507,8 +3606,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'source_gen', - description: 'Source code generation builders and utilities for the Dart build system', - repository: 'https://github.com/dart-lang/source_gen/tree/master/source_gen', + description: + 'Source code generation builders and utilities for the Dart build system', + repository: + 'https://github.com/dart-lang/source_gen/tree/master/source_gen', authors: [], version: '1.2.7', license: '''Copyright 2015, the Dart project authors. @@ -3544,7 +3645,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'source_helper', - description: 'Utilities to help with Dart source code generation. Includes utilities for properly generating String literals from any String value.', + description: + 'Utilities to help with Dart source code generation. Includes utilities for properly generating String literals from any String value.', repository: 'https://github.com/google/source_helper.dart', authors: [], version: '1.3.3', @@ -3792,7 +3894,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'sqflite', - description: 'Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine.', + description: + 'Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine.', repository: 'https://github.com/tekartik/sqflite/tree/master/sqflite', authors: [], version: '2.2.4+1', @@ -3827,7 +3930,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'sqflite_common', - description: 'Dart wrapper on SQLite, a self-contained, high-reliability, embedded, SQL database engine.', + description: + 'Dart wrapper on SQLite, a self-contained, high-reliability, embedded, SQL database engine.', homepage: 'https://github.com/tekartik/sqflite/tree/master/sqflite_common', authors: [], version: '2.4.2+2', @@ -3862,7 +3966,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'stack_trace', - description: 'A package for manipulating stack traces and printing them readably.', + description: + 'A package for manipulating stack traces and printing them readably.', homepage: 'https://github.com/dart-lang/stack_trace', authors: [], version: '1.10.0', @@ -3898,7 +4003,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'stream_channel', - description: 'An abstraction for two-way communication channels based on the Dart Stream class.', + description: + 'An abstraction for two-way communication channels based on the Dart Stream class.', homepage: 'https://github.com/dart-lang/stream_channel', authors: [], version: '2.1.0', @@ -3934,7 +4040,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'stream_transform', - description: 'A collection of utilities to transform and manipulate streams.', + description: + 'A collection of utilities to transform and manipulate streams.', repository: 'https://github.com/dart-lang/stream_transform', authors: [], version: '2.1.0', @@ -4008,7 +4115,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'swipeable_tile', - description: 'A package to dismiss with animated background. Also Swipe to tigger action without dismiss.', + description: + 'A package to dismiss with animated background. Also Swipe to tigger action without dismiss.', repository: 'https://github.com/watery-desert/swipeable_tile', authors: [], version: '2.0.0+3', @@ -4047,8 +4155,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'synchronized', - description: 'Lock mechanism to prevent concurrent access to asynchronous code.', - homepage: 'https://github.com/tekartik/synchronized.dart/tree/master/synchronized', + description: + 'Lock mechanism to prevent concurrent access to asynchronous code.', + homepage: + 'https://github.com/tekartik/synchronized.dart/tree/master/synchronized', authors: [], version: '3.0.1', license: '''MIT License @@ -4152,7 +4262,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'timing', - description: 'A simple package for tracking the performance of synchronous and asynchronous actions.', + description: + 'A simple package for tracking the performance of synchronous and asynchronous actions.', repository: 'https://github.com/dart-lang/timing', authors: [], version: '1.0.1', @@ -4189,7 +4300,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'typed_data', - description: 'Utility functions and classes related to the dart:typed_data library.', + description: + 'Utility functions and classes related to the dart:typed_data library.', repository: 'https://github.com/dart-lang/typed_data', authors: [], version: '1.3.1', @@ -4226,8 +4338,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'url_launcher', - description: 'Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher', + description: + 'Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher', authors: [], version: '6.1.8', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4262,7 +4376,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'url_launcher_android', description: 'Android implementation of the url_launcher plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_android', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_android', authors: [], version: '6.0.23', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4297,7 +4412,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'url_launcher_ios', description: 'iOS implementation of the url_launcher plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_ios', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_ios', authors: [], version: '6.0.18', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4332,7 +4448,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'url_launcher_linux', description: 'Linux implementation of the url_launcher plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_linux', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_linux', authors: [], version: '3.0.2', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4367,7 +4484,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'url_launcher_macos', description: 'macOS implementation of the url_launcher plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_macos', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_macos', authors: [], version: '3.0.2', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4402,7 +4520,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'url_launcher_platform_interface', description: 'A common platform interface for the url_launcher plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_platform_interface', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_platform_interface', authors: [], version: '2.1.1', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4437,7 +4556,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', Package( name: 'url_launcher_web', description: 'Web platform implementation of url_launcher', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_web', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_web', authors: [], version: '2.0.14', license: '''url_launcher_web @@ -4678,7 +4798,8 @@ platform_detect Package( name: 'url_launcher_windows', description: 'Windows implementation of the url_launcher plugin.', - repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_windows', + repository: + 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_windows', authors: [], version: '3.0.3', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4712,7 +4833,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'uuid', - description: '''RFC4122 (v1, v4, v5) UUID Generator and Parser for all Dart platforms (Web, VM, Flutter) + description: + '''RFC4122 (v1, v4, v5) UUID Generator and Parser for all Dart platforms (Web, VM, Flutter) ''', homepage: 'https://github.com/Daegalus/dart-uuid', authors: [], @@ -4786,7 +4908,8 @@ freely, subject to the following restrictions: ), Package( name: 'very_good_analysis', - description: 'Lint rules for Dart and Flutter used internally at Very Good Ventures.', + description: + 'Lint rules for Dart and Flutter used internally at Very Good Ventures.', homepage: 'https://github.com/VeryGoodOpenSource/very_good_analysis', repository: 'https://github.com/VeryGoodOpenSource/very_good_analysis', authors: [], @@ -4818,7 +4941,8 @@ SOFTWARE.''', ), Package( name: 'watcher', - description: 'A file system watcher. It monitors changes to contents of directories and sends notifications when files have been added, removed, or modified.', + description: + 'A file system watcher. It monitors changes to contents of directories and sends notifications when files have been added, removed, or modified.', repository: 'https://github.com/dart-lang/watcher', authors: [], version: '1.0.2', @@ -4855,7 +4979,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'web_socket_channel', - description: 'StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API, a cross-platform implementation of that API that communicates over an underlying StreamChannel.', + description: + 'StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API, a cross-platform implementation of that API that communicates over an underlying StreamChannel.', repository: 'https://github.com/dart-lang/web_socket_channel', authors: [], version: '2.3.0', @@ -4892,7 +5017,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'win32', - description: 'A Dart library for accessing common Win32 APIs using FFI. No C required!', + description: + 'A Dart library for accessing common Win32 APIs using FFI. No C required!', homepage: 'https://win32.pub', repository: 'https://github.com/timsneath/win32', authors: [], @@ -4929,8 +5055,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'xdg_directories', - description: 'A Dart package for reading XDG directory configuration information on Linux.', - repository: 'https://github.com/flutter/packages/tree/main/packages/xdg_directories', + description: + 'A Dart package for reading XDG directory configuration information on Linux.', + repository: + 'https://github.com/flutter/packages/tree/main/packages/xdg_directories', authors: [], version: '0.2.0+3', license: '''Copyright 2013 The Flutter Authors. All rights reserved. @@ -4964,7 +5092,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', ), Package( name: 'xml', - description: 'A lightweight library for parsing, traversing, querying, transforming and building XML documents.', + description: + 'A lightweight library for parsing, traversing, querying, transforming and building XML documents.', homepage: 'https://github.com/renggli/dart-xml', authors: [], version: '6.1.0', @@ -4996,7 +5125,8 @@ THE SOFTWARE.''', ), Package( name: 'yaml', - description: 'A parser for YAML, a human-friendly data serialization standard', + description: + 'A parser for YAML, a human-friendly data serialization standard', repository: 'https://github.com/dart-lang/yaml', authors: [], version: '3.1.1', @@ -5024,29 +5154,37 @@ SOFTWARE.''', isSdk: false, isDirectDependency: false, ), - ]; /// Package license definition. class Package { /// Package name final String name; + /// Description final String description; + /// Website URL final String? homepage; + /// Repository URL final String? repository; + /// Authors final List authors; + /// Version final String version; + /// License final String? license; + /// Whether the license is in markdown format or not (plain text). final bool isMarkdown; + /// Whether the package is included in the SDK or not. final bool isSdk; + /// Whether the package is direct dependency or not. final bool isDirectDependency; diff --git a/lib/main.dart b/lib/main.dart index 9c5d1ca..c0184db 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,9 +31,9 @@ void main() async { // Load animes GetIt.I.get().add( - AnimesLoadedEvent(), - ); - + AnimesLoadedEvent(), + ); + runApp( MultiBlocProvider( providers: [ @@ -62,7 +62,7 @@ class MyApp extends StatelessWidget { }); final GlobalKey navKey; - + @override Widget build(BuildContext context) { return MaterialApp( @@ -81,10 +81,14 @@ class MyApp extends StatelessWidget { onGenerateRoute: (settings) { switch (settings.name) { case '/': - case animeListRoute: return AnimeListPage.route; - case animeSearchRoute: return AnimeSearchPage.route; - case detailsRoute: return DetailsPage.route; - case aboutRoute: return AboutPage.route; + case animeListRoute: + return AnimeListPage.route; + case animeSearchRoute: + return AnimeSearchPage.route; + case detailsRoute: + return DetailsPage.route; + case aboutRoute: + return AboutPage.route; } return null; diff --git a/lib/src/data/anime.dart b/lib/src/data/anime.dart index 0b86ff0..a39116b 100644 --- a/lib/src/data/anime.dart +++ b/lib/src/data/anime.dart @@ -10,18 +10,24 @@ class AnimeTrackingData with _$AnimeTrackingData, TrackingMedium { factory AnimeTrackingData( /// The ID of the anime String id, + /// The state of the anime @MediumTrackingStateConverter() MediumTrackingState state, + /// The title of the anime String title, + /// Episodes in total. int episodesWatched, + /// Episodes watched. int? episodesTotal, + /// URL to the thumbnail/cover art for the anime. String thumbnailUrl, ) = _AnimeTrackingData; /// JSON - factory AnimeTrackingData.fromJson(Map json) => _$AnimeTrackingDataFromJson(json); + factory AnimeTrackingData.fromJson(Map json) => + _$AnimeTrackingDataFromJson(json); } diff --git a/lib/src/data/manga.dart b/lib/src/data/manga.dart index cf28e9a..d13a57a 100644 --- a/lib/src/data/manga.dart +++ b/lib/src/data/manga.dart @@ -10,20 +10,27 @@ class MangaTrackingData with _$MangaTrackingData, TrackingMedium { factory MangaTrackingData( /// The ID of the manga String id, + /// The state of the manga @MediumTrackingStateConverter() MediumTrackingState state, + /// The title of the manga String title, + /// Chapters read. int chaptersRead, + /// Chapters read. int volumesOwned, + /// Episodes watched. int? chaptersTotal, + /// URL to the thumbnail/cover art for the manga. String thumbnailUrl, ) = _MangaTrackingData; /// JSON - factory MangaTrackingData.fromJson(Map json) => _$MangaTrackingDataFromJson(json); + factory MangaTrackingData.fromJson(Map json) => + _$MangaTrackingDataFromJson(json); } diff --git a/lib/src/data/type.dart b/lib/src/data/type.dart index 14c00f2..03e4659 100644 --- a/lib/src/data/type.dart +++ b/lib/src/data/type.dart @@ -32,52 +32,75 @@ abstract class TrackingMedium { extension MediumStateExtension on MediumTrackingState { int toInteger() { - assert(this != MediumTrackingState.all, 'MediumTrackingState.all must not be serialized'); + assert( + this != MediumTrackingState.all, + 'MediumTrackingState.all must not be serialized', + ); switch (this) { - case MediumTrackingState.ongoing: return 0; - case MediumTrackingState.completed: return 1; - case MediumTrackingState.planned: return 2; - case MediumTrackingState.dropped: return 3; - case MediumTrackingState.all: return -1; + case MediumTrackingState.ongoing: + return 0; + case MediumTrackingState.completed: + return 1; + case MediumTrackingState.planned: + return 2; + case MediumTrackingState.dropped: + return 3; + case MediumTrackingState.all: + return -1; } } String toNameString(TrackingMediumType type) { - assert(this != MediumTrackingState.all, 'MediumTrackingState.all must not be stringified'); + assert( + this != MediumTrackingState.all, + 'MediumTrackingState.all must not be stringified', + ); switch (this) { case MediumTrackingState.ongoing: switch (type) { - case TrackingMediumType.anime: return 'Watching'; - case TrackingMediumType.manga: return 'Reading'; + case TrackingMediumType.anime: + return 'Watching'; + case TrackingMediumType.manga: + return 'Reading'; } - case MediumTrackingState.completed: return 'Completed'; + case MediumTrackingState.completed: + return 'Completed'; case MediumTrackingState.planned: switch (type) { - case TrackingMediumType.anime: return 'Plan to watch'; - case TrackingMediumType.manga: return 'Plan to read'; + case TrackingMediumType.anime: + return 'Plan to watch'; + case TrackingMediumType.manga: + return 'Plan to read'; } - case MediumTrackingState.dropped: return 'Dropped'; - case MediumTrackingState.all: return 'All'; + case MediumTrackingState.dropped: + return 'Dropped'; + case MediumTrackingState.all: + return 'All'; } } } -class MediumTrackingStateConverter implements JsonConverter { +class MediumTrackingStateConverter + implements JsonConverter { const MediumTrackingStateConverter(); @override MediumTrackingState fromJson(int json) { switch (json) { - case 0: return MediumTrackingState.ongoing; - case 1: return MediumTrackingState.completed; - case 2: return MediumTrackingState.planned; - case 3: return MediumTrackingState.dropped; + case 0: + return MediumTrackingState.ongoing; + case 1: + return MediumTrackingState.completed; + case 2: + return MediumTrackingState.planned; + case 3: + return MediumTrackingState.dropped; } return MediumTrackingState.planned; } - + @override int toJson(MediumTrackingState state) => state.toInteger(); } diff --git a/lib/src/service/database.dart b/lib/src/service/database.dart index 66c8b63..50d14b1 100644 --- a/lib/src/service/database.dart +++ b/lib/src/service/database.dart @@ -46,20 +46,20 @@ class DatabaseService { final animes = await _db.query(animeTable); return animes - .cast>() - .map(AnimeTrackingData.fromJson) - .toList(); + .cast>() + .map(AnimeTrackingData.fromJson) + .toList(); } Future> loadMangas() async { final mangas = await _db.query(mangaTable); return mangas - .cast>() - .map(MangaTrackingData.fromJson) - .toList(); + .cast>() + .map(MangaTrackingData.fromJson) + .toList(); } - + Future addAnime(AnimeTrackingData data) async { await _db.insert( animeTable, @@ -83,7 +83,7 @@ class DatabaseService { whereArgs: [id], ); } - + Future addManga(MangaTrackingData data) async { await _db.insert( mangaTable, diff --git a/lib/src/ui/bloc/anime_list_bloc.dart b/lib/src/ui/bloc/anime_list_bloc.dart index 318d8de..017f1d5 100644 --- a/lib/src/ui/bloc/anime_list_bloc.dart +++ b/lib/src/ui/bloc/anime_list_bloc.dart @@ -30,30 +30,35 @@ class AnimeListBloc extends Bloc { } /// Internal anime state - final List _animes = List.empty(growable: true); - final List _mangas = List.empty(growable: true); + final List _animes = + List.empty(growable: true); + final List _mangas = + List.empty(growable: true); - List _getFilteredAnime({MediumTrackingState? trackingState}) { + List _getFilteredAnime({ + MediumTrackingState? trackingState, + }) { final filterState = trackingState ?? state.animeFilterState; if (filterState == MediumTrackingState.all) return _animes; - return _animes - .where((anime) => anime.state == filterState) - .toList(); + return _animes.where((anime) => anime.state == filterState).toList(); } - List _getFilteredManga({MediumTrackingState? trackingState}) { + List _getFilteredManga({ + MediumTrackingState? trackingState, + }) { final filterState = trackingState ?? state.mangaFilterState; if (state.mangaFilterState == MediumTrackingState.all) return _mangas; - return _mangas - .where((manga) => manga.state == filterState) - .toList(); + return _mangas.where((manga) => manga.state == filterState).toList(); } - - Future _onAnimeAdded(AnimeAddedEvent event, Emitter emit) async { + + Future _onAnimeAdded( + AnimeAddedEvent event, + Emitter emit, + ) async { // Add the anime to the database await GetIt.I.get().addAnime(event.data); @@ -67,7 +72,10 @@ class AnimeListBloc extends Bloc { ); } - Future _onMangaAdded(MangaAddedEvent event, Emitter emit) async { + Future _onMangaAdded( + MangaAddedEvent event, + Emitter emit, + ) async { // Add the manga to the database await GetIt.I.get().addManga(event.data); @@ -80,13 +88,17 @@ class AnimeListBloc extends Bloc { ), ); } - - Future _onAnimeIncremented(AnimeEpisodeIncrementedEvent event, Emitter emit) async { + + Future _onAnimeIncremented( + AnimeEpisodeIncrementedEvent event, + Emitter emit, + ) async { final index = state.animes.indexWhere((item) => item.id == event.id); if (index == -1) return; final anime = state.animes[index]; - if (anime.episodesTotal != null && anime.episodesWatched + 1 > anime.episodesTotal!) return; + if (anime.episodesTotal != null && + anime.episodesWatched + 1 > anime.episodesTotal!) return; final newList = List.from(state.animes); final newAnime = anime.copyWith( @@ -103,7 +115,10 @@ class AnimeListBloc extends Bloc { await GetIt.I.get().updateAnime(newAnime); } - Future _onAnimeDecremented(AnimeEpisodeDecrementedEvent event, Emitter emit) async { + Future _onAnimeDecremented( + AnimeEpisodeDecrementedEvent event, + Emitter emit, + ) async { final index = state.animes.indexWhere((item) => item.id == event.id); if (index == -1) return; @@ -125,14 +140,17 @@ class AnimeListBloc extends Bloc { await GetIt.I.get().updateAnime(newAnime); } - Future _onAnimesLoaded(AnimesLoadedEvent event, Emitter emit) async { + Future _onAnimesLoaded( + AnimesLoadedEvent event, + Emitter emit, + ) async { _animes.addAll( await GetIt.I.get().loadAnimes(), ); _mangas.addAll( await GetIt.I.get().loadMangas(), ); - + emit( state.copyWith( animes: _getFilteredAnime(), @@ -141,7 +159,10 @@ class AnimeListBloc extends Bloc { ); } - Future _onAnimesFiltered(AnimeFilterChangedEvent event, Emitter emit) async { + Future _onAnimesFiltered( + AnimeFilterChangedEvent event, + Emitter emit, + ) async { emit( state.copyWith( animeFilterState: event.filterState, @@ -150,7 +171,10 @@ class AnimeListBloc extends Bloc { ); } - Future _onMangasFiltered(MangaFilterChangedEvent event, Emitter emit) async { + Future _onMangasFiltered( + MangaFilterChangedEvent event, + Emitter emit, + ) async { emit( state.copyWith( mangaFilterState: event.filterState, @@ -158,8 +182,11 @@ class AnimeListBloc extends Bloc { ), ); } - - Future _onTrackingTypeChanged(AnimeTrackingTypeChanged event, Emitter emit) async { + + Future _onTrackingTypeChanged( + AnimeTrackingTypeChanged event, + Emitter emit, + ) async { emit( state.copyWith( trackingType: event.type, @@ -168,12 +195,16 @@ class AnimeListBloc extends Bloc { ); } - Future _onMangaIncremented(MangaChapterIncrementedEvent event, Emitter emit) async { + Future _onMangaIncremented( + MangaChapterIncrementedEvent event, + Emitter emit, + ) async { final index = state.mangas.indexWhere((item) => item.id == event.id); assert(index != -1, 'The manga must exist'); final manga = state.mangas[index]; - if (manga.chaptersTotal != null && manga.chaptersRead + 1 > manga.chaptersTotal!) return; + if (manga.chaptersTotal != null && + manga.chaptersRead + 1 > manga.chaptersTotal!) return; final newList = List.from(state.mangas); final newManga = manga.copyWith( @@ -185,7 +216,7 @@ class AnimeListBloc extends Bloc { final cacheIndex = _mangas.indexWhere((m) => m.id == event.id); assert(cacheIndex != -1, 'The manga must exist'); _mangas[cacheIndex] = newManga; - + emit( state.copyWith( mangas: newList, @@ -195,7 +226,10 @@ class AnimeListBloc extends Bloc { await GetIt.I.get().updateManga(newManga); } - Future _onMangaDecremented(MangaChapterDecrementedEvent event, Emitter emit) async { + Future _onMangaDecremented( + MangaChapterDecrementedEvent event, + Emitter emit, + ) async { final index = state.mangas.indexWhere((item) => item.id == event.id); if (index == -1) return; @@ -212,7 +246,7 @@ class AnimeListBloc extends Bloc { final cacheIndex = _mangas.indexWhere((m) => m.id == event.id); assert(cacheIndex != -1, 'The manga must exist'); _mangas[cacheIndex] = newManga; - + emit( state.copyWith( mangas: newList, @@ -222,7 +256,10 @@ class AnimeListBloc extends Bloc { await GetIt.I.get().updateManga(newManga); } - Future _onAnimeUpdated(AnimeUpdatedEvent event, Emitter emit) async { + Future _onAnimeUpdated( + AnimeUpdatedEvent event, + Emitter emit, + ) async { final index = _animes.indexWhere((anime) => anime.id == event.anime.id); assert(index != -1, 'The anime must exist'); @@ -235,7 +272,10 @@ class AnimeListBloc extends Bloc { ); } - Future _onMangaUpdated(MangaUpdatedEvent event, Emitter emit) async { + Future _onMangaUpdated( + MangaUpdatedEvent event, + Emitter emit, + ) async { final index = _mangas.indexWhere((manga) => manga.id == event.manga.id); assert(index != -1, 'The manga must exist'); @@ -248,7 +288,10 @@ class AnimeListBloc extends Bloc { ); } - Future _onAnimeRemoved(AnimeRemovedEvent event, Emitter emit) async { + Future _onAnimeRemoved( + AnimeRemovedEvent event, + Emitter emit, + ) async { emit( state.copyWith( animes: List.from( @@ -265,8 +308,11 @@ class AnimeListBloc extends Bloc { // Update the database await GetIt.I.get().deleteAnime(event.id); } - - Future _onMangaRemoved(MangaRemovedEvent event, Emitter emit) async { + + Future _onMangaRemoved( + MangaRemovedEvent event, + Emitter emit, + ) async { emit( state.copyWith( mangas: List.from( @@ -279,12 +325,15 @@ class AnimeListBloc extends Bloc { final cacheIndex = _animes.indexWhere((a) => a.id == event.id); assert(cacheIndex != -1, 'The manga must exist'); _animes.removeAt(cacheIndex); - + // Update the database await GetIt.I.get().deleteManga(event.id); } - Future _onButtonVisibilityToggled(AddButtonVisibilitySetEvent event, Emitter emit) async { + Future _onButtonVisibilityToggled( + AddButtonVisibilitySetEvent event, + Emitter emit, + ) async { emit( state.copyWith( buttonVisibility: event.state, diff --git a/lib/src/ui/bloc/anime_list_event.dart b/lib/src/ui/bloc/anime_list_event.dart index 7aef5af..2f2cc57 100644 --- a/lib/src/ui/bloc/anime_list_event.dart +++ b/lib/src/ui/bloc/anime_list_event.dart @@ -18,7 +18,7 @@ class AnimeEpisodeDecrementedEvent extends AnimeListEvent { class AnimeAddedEvent extends AnimeListEvent { AnimeAddedEvent(this.data); - + /// The anime to add. final AnimeTrackingData data; } @@ -57,7 +57,7 @@ class AnimeRemovedEvent extends AnimeListEvent { class MangaAddedEvent extends AnimeListEvent { MangaAddedEvent(this.data); - + /// The manga to add. final MangaTrackingData data; } diff --git a/lib/src/ui/bloc/anime_search_bloc.dart b/lib/src/ui/bloc/anime_search_bloc.dart index a3883b1..e407c9c 100644 --- a/lib/src/ui/bloc/anime_search_bloc.dart +++ b/lib/src/ui/bloc/anime_search_bloc.dart @@ -22,7 +22,10 @@ class AnimeSearchBloc extends Bloc { on(_onResultTapped); } - Future _onRequested(AnimeSearchRequestedEvent event, Emitter emit) async { + Future _onRequested( + AnimeSearchRequestedEvent event, + Emitter emit, + ) async { emit( state.copyWith( searchQuery: '', @@ -33,21 +36,27 @@ class AnimeSearchBloc extends Bloc { ); GetIt.I.get().add( - PushedNamedEvent( - const NavigationDestination(animeSearchRoute), - ), - ); + PushedNamedEvent( + const NavigationDestination(animeSearchRoute), + ), + ); } - Future _onQueryChanged(SearchQueryChangedEvent event, Emitter emit) async { + Future _onQueryChanged( + SearchQueryChangedEvent event, + Emitter emit, + ) async { emit( state.copyWith( searchQuery: event.query, ), ); } - - Future _onQuerySubmitted(SearchQuerySubmittedEvent event, Emitter emit) async { + + Future _onQuerySubmitted( + SearchQuerySubmittedEvent event, + Emitter emit, + ) async { if (state.searchQuery.isEmpty) return; emit( @@ -65,13 +74,17 @@ class AnimeSearchBloc extends Bloc { emit( state.copyWith( working: false, - searchResults: result.map((Anime anime) => SearchResult( - anime.title, - anime.malId.toString(), - anime.episodes, - anime.imageUrl, - anime.synopsis ?? '', - ),).toList(), + searchResults: result + .map( + (Anime anime) => SearchResult( + anime.title, + anime.malId.toString(), + anime.episodes, + anime.imageUrl, + anime.synopsis ?? '', + ), + ) + .toList(), ), ); } else { @@ -83,46 +96,53 @@ class AnimeSearchBloc extends Bloc { emit( state.copyWith( working: false, - searchResults: result.map((Manga manga) => SearchResult( - manga.title, - manga.malId.toString(), - manga.chapters, - manga.imageUrl, - manga.synopsis ?? '', - ),).toList(), + searchResults: result + .map( + (Manga manga) => SearchResult( + manga.title, + manga.malId.toString(), + manga.chapters, + manga.imageUrl, + manga.synopsis ?? '', + ), + ) + .toList(), ), ); } } - Future _onResultTapped(ResultTappedEvent event, Emitter emit) async { + Future _onResultTapped( + ResultTappedEvent event, + Emitter emit, + ) async { GetIt.I.get().add( - state.trackingType == TrackingMediumType.anime ? - list.AnimeAddedEvent( - AnimeTrackingData( - event.result.id, - MediumTrackingState.ongoing, - event.result.title, - 0, - event.result.total, - event.result.thumbnailUrl, - ), - ) : - list.MangaAddedEvent( - MangaTrackingData( - event.result.id, - MediumTrackingState.ongoing, - event.result.title, - 0, - 0, - event.result.total, - event.result.thumbnailUrl, - ), - ), - ); + state.trackingType == TrackingMediumType.anime + ? list.AnimeAddedEvent( + AnimeTrackingData( + event.result.id, + MediumTrackingState.ongoing, + event.result.title, + 0, + event.result.total, + event.result.thumbnailUrl, + ), + ) + : list.MangaAddedEvent( + MangaTrackingData( + event.result.id, + MediumTrackingState.ongoing, + event.result.title, + 0, + 0, + event.result.total, + event.result.thumbnailUrl, + ), + ), + ); GetIt.I.get().add( - PoppedRouteEvent(), - ); + PoppedRouteEvent(), + ); } } diff --git a/lib/src/ui/bloc/anime_search_event.dart b/lib/src/ui/bloc/anime_search_event.dart index 721e4f4..2cb486f 100644 --- a/lib/src/ui/bloc/anime_search_event.dart +++ b/lib/src/ui/bloc/anime_search_event.dart @@ -12,7 +12,7 @@ class AnimeSearchRequestedEvent extends AnimeSearchEvent { /// Triggered when the search query is changed. class SearchQueryChangedEvent extends AnimeSearchEvent { SearchQueryChangedEvent(this.query); - + /// The current value of the query final String query; } diff --git a/lib/src/ui/bloc/details_bloc.dart b/lib/src/ui/bloc/details_bloc.dart index d8fa9f4..095b551 100644 --- a/lib/src/ui/bloc/details_bloc.dart +++ b/lib/src/ui/bloc/details_bloc.dart @@ -21,7 +21,10 @@ class DetailsBloc extends Bloc { on(_onItemRemoved); } - Future _onAnimeRequested(AnimeDetailsRequestedEvent event, Emitter emit) async { + Future _onAnimeRequested( + AnimeDetailsRequestedEvent event, + Emitter emit, + ) async { emit( state.copyWith( trackingType: TrackingMediumType.anime, @@ -30,13 +33,16 @@ class DetailsBloc extends Bloc { ); GetIt.I.get().add( - PushedNamedEvent( - const NavigationDestination(detailsRoute), - ), - ); + PushedNamedEvent( + const NavigationDestination(detailsRoute), + ), + ); } - Future _onMangaRequested(MangaDetailsRequestedEvent event, Emitter emit) async { + Future _onMangaRequested( + MangaDetailsRequestedEvent event, + Emitter emit, + ) async { emit( state.copyWith( trackingType: TrackingMediumType.manga, @@ -45,13 +51,16 @@ class DetailsBloc extends Bloc { ); GetIt.I.get().add( - PushedNamedEvent( - const NavigationDestination(detailsRoute), - ), - ); + PushedNamedEvent( + const NavigationDestination(detailsRoute), + ), + ); } - Future _onDetailsUpdated(DetailsUpdatedEvent event, Emitter emit) async { + Future _onDetailsUpdated( + DetailsUpdatedEvent event, + Emitter emit, + ) async { if (state.trackingType == TrackingMediumType.anime) { emit( state.copyWith( @@ -59,11 +68,13 @@ class DetailsBloc extends Bloc { ), ); - await GetIt.I.get().updateAnime(event.data as AnimeTrackingData); + await GetIt.I + .get() + .updateAnime(event.data as AnimeTrackingData); GetIt.I.get().add( - AnimeUpdatedEvent(event.data as AnimeTrackingData), - ); + AnimeUpdatedEvent(event.data as AnimeTrackingData), + ); } else { emit( state.copyWith( @@ -71,15 +82,20 @@ class DetailsBloc extends Bloc { ), ); - await GetIt.I.get().updateManga(event.data as MangaTrackingData); + await GetIt.I + .get() + .updateManga(event.data as MangaTrackingData); GetIt.I.get().add( - MangaUpdatedEvent(event.data as MangaTrackingData), - ); + MangaUpdatedEvent(event.data as MangaTrackingData), + ); } } - Future _onItemRemoved(ItemRemovedEvent event, Emitter emit) async { + Future _onItemRemoved( + ItemRemovedEvent event, + Emitter emit, + ) async { emit( state.copyWith( data: null, diff --git a/lib/src/ui/bloc/navigation_bloc.dart b/lib/src/ui/bloc/navigation_bloc.dart index e7a3f0d..cb31bc4 100644 --- a/lib/src/ui/bloc/navigation_bloc.dart +++ b/lib/src/ui/bloc/navigation_bloc.dart @@ -13,14 +13,20 @@ class NavigationBloc extends Bloc { } final GlobalKey navigationKey; - Future _onPushedNamed(PushedNamedEvent event, Emitter emit) async { + Future _onPushedNamed( + PushedNamedEvent event, + Emitter emit, + ) async { await navigationKey.currentState!.pushNamed( event.destination.path, arguments: event.destination.arguments, ); } - Future _onPushedNamedAndRemoveUntil(PushedNamedAndRemoveUntilEvent event, Emitter emit) async { + Future _onPushedNamedAndRemoveUntil( + PushedNamedAndRemoveUntilEvent event, + Emitter emit, + ) async { await navigationKey.currentState!.pushNamedAndRemoveUntil( event.destination.path, event.predicate, @@ -28,14 +34,20 @@ class NavigationBloc extends Bloc { ); } - Future _onPushedNamedReplaceEvent(PushedNamedReplaceEvent event, Emitter emit) async { + Future _onPushedNamedReplaceEvent( + PushedNamedReplaceEvent event, + Emitter emit, + ) async { await navigationKey.currentState!.pushReplacementNamed( event.destination.path, arguments: event.destination.arguments, ); } - Future _onPoppedRoute(PoppedRouteEvent event, Emitter emit) async { + Future _onPoppedRoute( + PoppedRouteEvent event, + Emitter emit, + ) async { navigationKey.currentState!.pop(); } diff --git a/lib/src/ui/bloc/navigation_event.dart b/lib/src/ui/bloc/navigation_event.dart index 3de99ff..9426ff8 100644 --- a/lib/src/ui/bloc/navigation_event.dart +++ b/lib/src/ui/bloc/navigation_event.dart @@ -2,11 +2,9 @@ part of 'navigation_bloc.dart'; class NavigationDestination { const NavigationDestination( - this.path, - { - this.arguments, - } - ); + this.path, { + this.arguments, + }); final String path; final Object? arguments; } diff --git a/lib/src/ui/pages/about.dart b/lib/src/ui/pages/about.dart index 182acf4..0ab7bf9 100644 --- a/lib/src/ui/pages/about.dart +++ b/lib/src/ui/pages/about.dart @@ -9,11 +9,11 @@ class AboutPage extends StatelessWidget { }); static MaterialPageRoute get route => MaterialPageRoute( - builder: (_) => const AboutPage(), - settings: const RouteSettings( - name: aboutRoute, - ), - ); + builder: (_) => const AboutPage(), + settings: const RouteSettings( + name: aboutRoute, + ), + ); @override Widget build(BuildContext context) { @@ -34,7 +34,6 @@ class AboutPage extends StatelessWidget { 'AniTrack', style: Theme.of(context).textTheme.titleLarge, ), - ElevatedButton( onPressed: () async { await launchUrl( diff --git a/lib/src/ui/pages/anime_list.dart b/lib/src/ui/pages/anime_list.dart index c0442e3..9df1228 100644 --- a/lib/src/ui/pages/anime_list.dart +++ b/lib/src/ui/pages/anime_list.dart @@ -16,11 +16,11 @@ class AnimeListPage extends StatefulWidget { }); static MaterialPageRoute get route => MaterialPageRoute( - builder: (_) => AnimeListPage(), - settings: const RouteSettings( - name: animeListRoute, - ), - ); + builder: (_) => const AnimeListPage(), + settings: const RouteSettings( + name: animeListRoute, + ), + ); @override AnimeListPageState createState() => AnimeListPageState(); @@ -35,11 +35,12 @@ class AnimeListPageState extends State { super.initState(); _animeScrollController.addListener(_onAnimeListScrolled); } - + void _onAnimeListScrolled() { //print(_animeScrollController.position.maxScrollExtent); final bloc = GetIt.I.get(); - if (_animeScrollController.offset + 20 >= _animeScrollController.position.maxScrollExtent) { + if (_animeScrollController.offset + 20 >= + _animeScrollController.position.maxScrollExtent) { if (bloc.state.buttonVisibility) { bloc.add( AddButtonVisibilitySetEvent(false), @@ -53,15 +54,19 @@ class AnimeListPageState extends State { } } } - + String _getPageTitle(TrackingMediumType type) { switch (type) { - case TrackingMediumType.anime: return 'Anime'; - case TrackingMediumType.manga: return 'Manga'; + case TrackingMediumType.anime: + return 'Anime'; + case TrackingMediumType.manga: + return 'Manga'; } } - List> _getPopupButtonItems(TrackingMediumType type) { + List> _getPopupButtonItems( + TrackingMediumType type, + ) { return [ PopupMenuItem( value: MediumTrackingState.ongoing, @@ -85,7 +90,7 @@ class AnimeListPageState extends State { ), ]; } - + Widget _getPopupButton(BuildContext context, AnimeListState state) { switch (state.trackingType) { case TrackingMediumType.anime: @@ -96,8 +101,8 @@ class AnimeListPageState extends State { initialValue: state.animeFilterState, onSelected: (filterState) { context.read().add( - AnimeFilterChangedEvent(filterState), - ); + AnimeFilterChangedEvent(filterState), + ); }, itemBuilder: (_) => _getPopupButtonItems(TrackingMediumType.anime), ); @@ -109,14 +114,14 @@ class AnimeListPageState extends State { initialValue: state.mangaFilterState, onSelected: (filterState) { context.read().add( - MangaFilterChangedEvent(filterState), - ); + MangaFilterChangedEvent(filterState), + ); }, itemBuilder: (_) => _getPopupButtonItems(TrackingMediumType.manga), ); } } - + @override Widget build(BuildContext context) { return BlocBuilder( @@ -145,7 +150,6 @@ class AnimeListPageState extends State { ), ), ), - ListTile( leading: const Icon(Icons.info), title: const Text('About'), @@ -178,37 +182,37 @@ class AnimeListPageState extends State { return GridItem( minusCallback: () { context.read().add( - AnimeEpisodeDecrementedEvent( - anime.id, - ), - ); + AnimeEpisodeDecrementedEvent( + anime.id, + ), + ); }, plusCallback: () { context.read().add( - AnimeEpisodeIncrementedEvent( - anime.id, - ), - ); + AnimeEpisodeIncrementedEvent( + anime.id, + ), + ); }, child: AnimeCoverImage( - url: anime.thumbnailUrl, - hero: anime.id, - onTap: () { - context.read().add( - AnimeDetailsRequestedEvent(anime), - ); - }, - extra: Align( - alignment: Alignment.centerRight, - child: Padding( - padding: const EdgeInsets.only(right: 8), - child: Text( - '${anime.episodesWatched}/${anime.episodesTotal ?? "???"}', - style: Theme.of(context).textTheme.titleMedium, - ), + url: anime.thumbnailUrl, + hero: anime.id, + onTap: () { + context.read().add( + AnimeDetailsRequestedEvent(anime), + ); + }, + extra: Align( + alignment: Alignment.centerRight, + child: Padding( + padding: const EdgeInsets.only(right: 8), + child: Text( + '${anime.episodesWatched}/${anime.episodesTotal ?? "???"}', + style: Theme.of(context).textTheme.titleMedium, ), ), ), + ), ); }, ), @@ -228,37 +232,37 @@ class AnimeListPageState extends State { return GridItem( minusCallback: () { context.read().add( - MangaChapterDecrementedEvent( - manga.id, - ), - ); + MangaChapterDecrementedEvent( + manga.id, + ), + ); }, plusCallback: () { context.read().add( - MangaChapterIncrementedEvent( - manga.id, - ), - ); + MangaChapterIncrementedEvent( + manga.id, + ), + ); }, child: AnimeCoverImage( hero: manga.id, - url: manga.thumbnailUrl, - onTap: () { - context.read().add( - MangaDetailsRequestedEvent(manga), - ); - }, - extra: Align( - alignment: Alignment.centerRight, - child: Padding( - padding: const EdgeInsets.only(right: 8), - child: Text( - '${manga.chaptersRead}/${manga.chaptersTotal ?? "???"}', - style: Theme.of(context).textTheme.titleMedium, - ), + url: manga.thumbnailUrl, + onTap: () { + context.read().add( + MangaDetailsRequestedEvent(manga), + ); + }, + extra: Align( + alignment: Alignment.centerRight, + child: Padding( + padding: const EdgeInsets.only(right: 8), + child: Text( + '${manga.chaptersRead}/${manga.chaptersTotal ?? "???"}', + style: Theme.of(context).textTheme.titleMedium, ), ), ), + ), ); }, ), @@ -266,19 +270,18 @@ class AnimeListPageState extends State { ], ), floatingActionButton: BlocBuilder( - buildWhen: (prev, next) => prev.buttonVisibility != next.buttonVisibility, + buildWhen: (prev, next) => + prev.buttonVisibility != next.buttonVisibility, builder: (context, state) { return AnimatedScale( duration: const Duration(milliseconds: 250), - scale: state.buttonVisibility ? - 1 : - 0, + scale: state.buttonVisibility ? 1 : 0, curve: Curves.easeInOutQuint, child: FloatingActionButton( onPressed: () { context.read().add( - AnimeSearchRequestedEvent(state.trackingType), - ); + AnimeSearchRequestedEvent(state.trackingType), + ); }, tooltip: 'Add new item', child: const Icon(Icons.add), @@ -287,17 +290,16 @@ class AnimeListPageState extends State { }, ), bottomNavigationBar: BottomBar( - selectedIndex: state.trackingType == TrackingMediumType.anime ? - 0 : - 1, + selectedIndex: + state.trackingType == TrackingMediumType.anime ? 0 : 1, onTap: (int index) { context.read().add( - AnimeTrackingTypeChanged( - index == 0 ? - TrackingMediumType.anime : - TrackingMediumType.manga, - ), - ); + AnimeTrackingTypeChanged( + index == 0 + ? TrackingMediumType.anime + : TrackingMediumType.manga, + ), + ); _controller.jumpToPage(index); }, diff --git a/lib/src/ui/pages/anime_search.dart b/lib/src/ui/pages/anime_search.dart index b9fb918..6c116c7 100644 --- a/lib/src/ui/pages/anime_search.dart +++ b/lib/src/ui/pages/anime_search.dart @@ -11,12 +11,12 @@ class AnimeSearchPage extends StatelessWidget { }); static MaterialPageRoute get route => MaterialPageRoute( - builder: (_) => const AnimeSearchPage(), - settings: const RouteSettings( - name: animeSearchRoute, - ), - ); - + builder: (_) => const AnimeSearchPage(), + settings: const RouteSettings( + name: animeSearchRoute, + ), + ); + @override Widget build(BuildContext context) { return BlocBuilder( @@ -24,9 +24,9 @@ class AnimeSearchPage extends StatelessWidget { return Scaffold( appBar: AppBar( title: Text( - state.trackingType == TrackingMediumType.anime ? - 'Anime Search' : - 'Manga Search', + state.trackingType == TrackingMediumType.anime + ? 'Anime Search' + : 'Manga Search', ), ), body: Column( @@ -40,17 +40,16 @@ class AnimeSearchPage extends StatelessWidget { ), onSubmitted: (_) { context.read().add( - SearchQuerySubmittedEvent(), - ); + SearchQuerySubmittedEvent(), + ); }, onChanged: (value) { context.read().add( - SearchQueryChangedEvent(value), - ); + SearchQueryChangedEvent(value), + ); }, ), ), - if (state.working) const Expanded( child: Align( @@ -66,8 +65,8 @@ class AnimeSearchPage extends StatelessWidget { return InkWell( onTap: () { context.read().add( - ResultTappedEvent(item), - ); + ResultTappedEvent(item), + ); }, child: ListItem( title: item.title, diff --git a/lib/src/ui/pages/details.dart b/lib/src/ui/pages/details.dart index 62ea333..fe9ebaf 100644 --- a/lib/src/ui/pages/details.dart +++ b/lib/src/ui/pages/details.dart @@ -16,11 +16,11 @@ class DetailsPage extends StatelessWidget { }); static MaterialPageRoute get route => MaterialPageRoute( - builder: (_) => const DetailsPage(), - settings: const RouteSettings( - name: detailsRoute, - ), - ); + builder: (_) => const DetailsPage(), + settings: const RouteSettings( + name: detailsRoute, + ), + ); @override Widget build(BuildContext context) { @@ -30,195 +30,213 @@ class DetailsPage extends StatelessWidget { ), body: BlocBuilder( builder: (context, state) { - return state.data == null ? - Container() : - Padding( - padding: const EdgeInsets.all(8), - child: ListView( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [AnimeCoverImage( - url: state.data!.thumbnailUrl, - hero: state.data!.id, - ), - - Expanded( - child: Padding( - padding: const EdgeInsets.only( - left: 8, - ), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - state.data!.title, - textAlign: TextAlign.left, - style: Theme.of(context).textTheme.titleLarge, - maxLines: 2, - softWrap: true, - overflow: TextOverflow.ellipsis, - ), - - ElevatedButton( - onPressed: () async { - final result = await showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text('Remove "${state.data!.title}"?'), - content: Text('Are you sure you want to remove "${state.data!.title}" from the list?'), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(true); - }, - style: TextButton.styleFrom( - foregroundColor: Colors.red, - ), - child: const Text('Remove'), - ), - TextButton( - onPressed: () { - Navigator.of(context).pop(false); - }, - child: const Text('Cancel'), - ), - ], - ); - }, - ); - - if (result != true) return; - - // ignore: use_build_context_synchronously - context.read().add( - ItemRemovedEvent( - state.data!.id, - state.trackingType, + return state.data == null + ? Container() + : Padding( + padding: const EdgeInsets.all(8), + child: ListView( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AnimeCoverImage( + url: state.data!.thumbnailUrl, + hero: state.data!.id, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + left: 8, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + state.data!.title, + textAlign: TextAlign.left, + style: + Theme.of(context).textTheme.titleLarge, + maxLines: 2, + softWrap: true, + overflow: TextOverflow.ellipsis, ), - ); - }, - child: const Icon(Icons.delete), + ElevatedButton( + onPressed: () async { + final result = await showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text( + 'Remove "${state.data!.title}"?', + ), + content: Text( + 'Are you sure you want to remove "${state.data!.title}" from the list?', + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context) + .pop(true); + }, + style: TextButton.styleFrom( + foregroundColor: Colors.red, + ), + child: const Text('Remove'), + ), + TextButton( + onPressed: () { + Navigator.of(context) + .pop(false); + }, + child: const Text('Cancel'), + ), + ], + ); + }, + ); + + if (result != true) return; + + // ignore: use_build_context_synchronously + context.read().add( + ItemRemovedEvent( + state.data!.id, + state.trackingType, + ), + ); + }, + child: const Icon(Icons.delete), + ), + ], + ), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.symmetric( + vertical: 8, + ), + child: DropdownSelector( + title: state.trackingType == TrackingMediumType.anime + ? 'Watch state' + : 'Read state', + onChanged: (MediumTrackingState newState) { + if (state.trackingType == + TrackingMediumType.anime) { + context.read().add( + DetailsUpdatedEvent( + (state.data! as AnimeTrackingData) + .copyWith( + state: newState, + ), + ), + ); + } else if (state.trackingType == + TrackingMediumType.manga) { + context.read().add( + DetailsUpdatedEvent( + (state.data! as MangaTrackingData) + .copyWith( + state: newState, + ), + ), + ); + } + }, + values: [ + SelectorItem( + MediumTrackingState.ongoing, + MediumTrackingState.ongoing + .toNameString(state.trackingType), + ), + SelectorItem( + MediumTrackingState.completed, + MediumTrackingState.completed + .toNameString(state.trackingType), + ), + SelectorItem( + MediumTrackingState.planned, + MediumTrackingState.planned + .toNameString(state.trackingType), + ), + SelectorItem( + MediumTrackingState.dropped, + MediumTrackingState.dropped + .toNameString(state.trackingType), ), ], + initialValue: state.data!.state, ), ), - ), - ], - ), - - Padding( - padding: const EdgeInsets.symmetric( - vertical: 8, - ), - child: DropdownSelector( - title: state.trackingType == TrackingMediumType.anime ? - 'Watch state' : - 'Read state', - onChanged: (MediumTrackingState newState) { - if (state.trackingType == TrackingMediumType.anime) { - context.read().add( - DetailsUpdatedEvent( - (state.data! as AnimeTrackingData).copyWith( - state: newState, - ), + Padding( + padding: const EdgeInsets.symmetric( + vertical: 8, + ), + child: IntegerInput( + labelText: + state.trackingType == TrackingMediumType.anime + ? 'Episodes' + : 'Chapters', + onChanged: (value) { + switch (state.trackingType) { + case TrackingMediumType.anime: + final data = state.data! as AnimeTrackingData; + context.read().add( + DetailsUpdatedEvent( + data.copyWith( + episodesWatched: value, + ), + ), + ); + break; + case TrackingMediumType.manga: + final data = state.data! as MangaTrackingData; + context.read().add( + DetailsUpdatedEvent( + data.copyWith( + chaptersRead: value, + ), + ), + ); + break; + } + }, + initialValue: state.trackingType == + TrackingMediumType.anime + ? (state.data! as AnimeTrackingData) + .episodesWatched + : (state.data! as MangaTrackingData).chaptersRead, + ), + ), + if (state.trackingType == TrackingMediumType.manga) + Padding( + padding: const EdgeInsets.symmetric( + vertical: 8, ), - ); - } else if (state.trackingType == TrackingMediumType.manga) { - context.read().add( - DetailsUpdatedEvent( - (state.data! as MangaTrackingData).copyWith( - state: newState, - ), + child: IntegerInput( + labelText: 'Volumes owned', + onChanged: (value) { + final data = state.data! as MangaTrackingData; + context.read().add( + DetailsUpdatedEvent( + data.copyWith( + volumesOwned: value, + ), + ), + ); + }, + initialValue: (GetIt.I + .get() + .state + .data! as MangaTrackingData) + .volumesOwned, ), - ); - } - }, - values: [ - SelectorItem( - MediumTrackingState.ongoing, - MediumTrackingState.ongoing.toNameString(state.trackingType), - ), - SelectorItem( - MediumTrackingState.completed, - MediumTrackingState.completed.toNameString(state.trackingType), - ), - SelectorItem( - MediumTrackingState.planned, - MediumTrackingState.planned.toNameString(state.trackingType), - ), - SelectorItem( - MediumTrackingState.dropped, - MediumTrackingState.dropped.toNameString(state.trackingType), - ), + ), ], - initialValue: state.data!.state, ), - ), - - Padding( - padding: const EdgeInsets.symmetric( - vertical: 8, - ), - child: IntegerInput( - labelText: state.trackingType == TrackingMediumType.anime ? - 'Episodes' : - 'Chapters', - onChanged: (value) { - switch (state.trackingType) { - case TrackingMediumType.anime: - final data = state.data! as AnimeTrackingData; - context.read().add( - DetailsUpdatedEvent( - data.copyWith( - episodesWatched: value, - ), - ), - ); - break; - case TrackingMediumType.manga: - final data = state.data! as MangaTrackingData; - context.read().add( - DetailsUpdatedEvent( - data.copyWith( - chaptersRead: value, - ), - ), - ); - break; - } - }, - initialValue: state.trackingType == TrackingMediumType.anime ? - (state.data! as AnimeTrackingData).episodesWatched : - (state.data! as MangaTrackingData).chaptersRead, - ), - ), - - if (state.trackingType == TrackingMediumType.manga) - Padding( - padding: const EdgeInsets.symmetric( - vertical: 8, - ), - child: IntegerInput( - labelText: 'Volumes owned', - onChanged: (value) { - final data = state.data! as MangaTrackingData; - context.read().add( - DetailsUpdatedEvent( - data.copyWith( - volumesOwned: value, - ), - ), - ); - }, - initialValue: (GetIt.I.get().state.data! as MangaTrackingData).volumesOwned, - ), - ), - ], - ), - ); + ); }, ), ); diff --git a/lib/src/ui/widgets/dropdown.dart b/lib/src/ui/widgets/dropdown.dart index 09b4d40..bec160b 100644 --- a/lib/src/ui/widgets/dropdown.dart +++ b/lib/src/ui/widgets/dropdown.dart @@ -23,10 +23,10 @@ class DropdownSelector extends StatefulWidget { final List> values; final T initialValue; - + /// Called when the selection has changed final void Function(T) onChanged; - + @override DropdownSelectorState createState() => DropdownSelectorState(); } @@ -76,54 +76,56 @@ class DropdownSelectorState extends State> { void initState() { super.initState(); - index = widget.values.indexWhere((item) => item.value == widget.initialValue); + index = + widget.values.indexWhere((item) => item.value == widget.initialValue); } @override Widget build(BuildContext context) { return Row( - children: [ - Expanded( - child: Card( - clipBehavior: Clip.hardEdge, - child: InkWell( - onTap: () async { - final result = await showDialog( - context: context, - builder: (context) => DropdownSelectorDialog( - values: widget.values.cast>(), - ), - ); - - if (result == null) return; - if (result == widget.values[index].value) return; - - setState(() { - index = widget.values.indexWhere((item) => item.value == result); - }); - - widget.onChanged(result); - }, - child: Padding( - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.title, - style: Theme.of(context).textTheme.titleSmall, - ), - Text( - widget.values[index].text, - style: Theme.of(context).textTheme.bodyLarge, - ), - ], + children: [ + Expanded( + child: Card( + clipBehavior: Clip.hardEdge, + child: InkWell( + onTap: () async { + final result = await showDialog( + context: context, + builder: (context) => DropdownSelectorDialog( + values: widget.values.cast>(), ), + ); + + if (result == null) return; + if (result == widget.values[index].value) return; + + setState(() { + index = + widget.values.indexWhere((item) => item.value == result); + }); + + widget.onChanged(result); + }, + child: Padding( + padding: const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.title, + style: Theme.of(context).textTheme.titleSmall, + ), + Text( + widget.values[index].text, + style: Theme.of(context).textTheme.bodyLarge, + ), + ], ), ), ), ), - ], + ), + ], ); } } diff --git a/lib/src/ui/widgets/grid_item.dart b/lib/src/ui/widgets/grid_item.dart index 0985292..b9540f1 100644 --- a/lib/src/ui/widgets/grid_item.dart +++ b/lib/src/ui/widgets/grid_item.dart @@ -13,7 +13,7 @@ class GridItem extends StatefulWidget { final void Function() plusCallback; final void Function() minusCallback; - + @override GridItemState createState() => GridItemState(); } @@ -28,7 +28,7 @@ class GridItemState extends State { onHorizontalDragUpdate: (details) { setState(() { _offset += details.delta.dx; - _translationX = 160 / (1 + exp(-1 * (1/30) * _offset)) - 80; + _translationX = 160 / (1 + exp(-1 * (1 / 30) * _offset)) - 80; }); }, onHorizontalDragEnd: (_) { diff --git a/lib/src/ui/widgets/image.dart b/lib/src/ui/widgets/image.dart index 0768a17..c364858 100644 --- a/lib/src/ui/widgets/image.dart +++ b/lib/src/ui/widgets/image.dart @@ -19,13 +19,13 @@ class AnimeCoverImage extends StatelessWidget { /// The hero tag of the image. final String hero; - + /// An extra widget with a translucent backdrop. final Widget? extra; /// Callback for when the image is tapped. final void Function()? onTap; - + @override Widget build(BuildContext context) { return Hero( @@ -48,15 +48,14 @@ class AnimeCoverImage extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( image: DecorationImage( - image: cached ? - CachedNetworkImageProvider(url) as ImageProvider : - NetworkImage(url), + image: cached + ? CachedNetworkImageProvider(url) as ImageProvider + : NetworkImage(url), fit: BoxFit.cover, ), ), ), ), - if (extra != null) Positioned( left: 0, diff --git a/lib/src/ui/widgets/integer_input.dart b/lib/src/ui/widgets/integer_input.dart index 645e8bf..8e7bd6b 100644 --- a/lib/src/ui/widgets/integer_input.dart +++ b/lib/src/ui/widgets/integer_input.dart @@ -27,7 +27,7 @@ class IntegerInputState extends State { /// The controller for the TextField. final TextEditingController _controller = TextEditingController(); - + @override void initState() { super.initState(); @@ -44,7 +44,7 @@ class IntegerInputState extends State { _controller.text = '$_value'; widget.onChanged(_value); } - + @override Widget build(BuildContext context) { return Row( @@ -59,7 +59,6 @@ class IntegerInputState extends State { }, child: const Icon(Icons.remove), ), - Expanded( child: Padding( padding: const EdgeInsets.symmetric( @@ -84,7 +83,6 @@ class IntegerInputState extends State { ), ), ), - ElevatedButton( onPressed: () { _value++; diff --git a/lib/src/ui/widgets/list_item.dart b/lib/src/ui/widgets/list_item.dart index 5f7b561..ae9addf 100644 --- a/lib/src/ui/widgets/list_item.dart +++ b/lib/src/ui/widgets/list_item.dart @@ -15,7 +15,7 @@ class ListItem extends StatelessWidget { this.imageExtra, super.key, }); - + /// URL for the cover image. final String thumbnailUrl; @@ -26,14 +26,14 @@ class ListItem extends StatelessWidget { final List extra; final Widget? imageExtra; - + /// Callbacks for the swipe functionality. final void Function()? onLeftSwipe; final void Function()? onRightSwipe; /// Flag indicating whether the thumbnail image should be cached final bool cached; - + @override Widget build(BuildContext context) { return SwipeableTile.swipeToTrigger( @@ -66,9 +66,9 @@ class ListItem extends StatelessWidget { return Container(); }, color: Theme.of(context).scaffoldBackgroundColor, - direction: onRightSwipe != null && onLeftSwipe != null ? - SwipeDirection.horizontal : - SwipeDirection.none, + direction: onRightSwipe != null && onLeftSwipe != null + ? SwipeDirection.horizontal + : SwipeDirection.none, child: Padding( padding: const EdgeInsets.all(8), child: Row( @@ -81,7 +81,6 @@ class ListItem extends StatelessWidget { extra: imageExtra, url: thumbnailUrl, ), - Expanded( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), @@ -97,7 +96,6 @@ class ListItem extends StatelessWidget { softWrap: true, overflow: TextOverflow.ellipsis, ), - ...extra, ], ),