├── .gitignore ├── .metadata ├── .slidy ├── 1586173270780 ├── 1586173296041 ├── 1586173332876 ├── 1586173437663 ├── 1586173736119 ├── 1586173756246 ├── 1586173766370 ├── 1586175135423 ├── 1586175162468 ├── 1586175398444 ├── 1586175431232 ├── 1586175461966 ├── 1586175875467 ├── 1586176021805 ├── 1586176094978 ├── 1586176682055 ├── 1586176829635 ├── 1586176942750 ├── 1586177196594 ├── 1586177204295 ├── 1586177364216 ├── 1586177380060 ├── 1586179617247 ├── 1586179645638 ├── 1586179921947 ├── 1586195044620 ├── 1586197370772 ├── 1586197387951 ├── 1586197401328 ├── 1586197467154 ├── 1586197629324 ├── 1586914839228 ├── 1586914862368 ├── 1586915085428 ├── 1586915094911 ├── 1586916215829 ├── 1586916593727 ├── 1586916796075 ├── 1586957825998 ├── 1586957840433 ├── 1586957876432 └── 1586958495921 ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── toshi │ │ │ │ └── pokedex_modular │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── fonts │ ├── ProductSans-Bold.ttf │ └── ProductSans-Regular.ttf └── images │ ├── pokeball.png │ └── pokeball_dark.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── app │ ├── app_controller.dart │ ├── app_controller.g.dart │ ├── app_module.dart │ ├── app_widget.dart │ ├── modules │ │ └── home │ │ │ ├── components │ │ │ ├── app_bar │ │ │ │ └── app_bar_widget.dart │ │ │ ├── body │ │ │ │ ├── body_widget.dart │ │ │ │ └── pokemon_list │ │ │ │ │ ├── card_list │ │ │ │ │ ├── card_item │ │ │ │ │ │ ├── card_item_widget.dart │ │ │ │ │ │ └── pokemon │ │ │ │ │ │ │ └── pokemon_widget.dart │ │ │ │ │ └── card_list_widget.dart │ │ │ │ │ └── pokemon_list_widget.dart │ │ │ ├── header │ │ │ │ └── header_widget.dart │ │ │ ├── poke_background │ │ │ │ └── poke_background_widget.dart │ │ │ └── poke_image │ │ │ │ └── poke_image_widget.dart │ │ │ ├── home_controller.dart │ │ │ ├── home_controller.g.dart │ │ │ ├── home_module.dart │ │ │ ├── home_page.dart │ │ │ ├── models │ │ │ ├── evolution_chain_model.dart │ │ │ ├── list_pokemon_model.dart │ │ │ ├── pokedex_model.dart │ │ │ ├── pokemon_model.dart │ │ │ └── pokemon_species_model.dart │ │ │ ├── pages │ │ │ └── poke_detail │ │ │ │ ├── components │ │ │ │ ├── app_bar_detail │ │ │ │ │ └── app_bar_detail_widget.dart │ │ │ │ ├── image_detail │ │ │ │ │ └── image_detail_widget.dart │ │ │ │ ├── poke_detail_header │ │ │ │ │ └── poke_detail_header_widget.dart │ │ │ │ └── power_info │ │ │ │ │ ├── power_info_widget.dart │ │ │ │ │ └── tabs │ │ │ │ │ ├── about │ │ │ │ │ └── about_widget.dart │ │ │ │ │ ├── evolution │ │ │ │ │ ├── evolution_controller.dart │ │ │ │ │ ├── evolution_controller.g.dart │ │ │ │ │ └── evolution_widget.dart │ │ │ │ │ ├── status │ │ │ │ │ └── status_widget.dart │ │ │ │ │ ├── tabs_controller.dart │ │ │ │ │ ├── tabs_controller.g.dart │ │ │ │ │ └── tabs_widget.dart │ │ │ │ ├── poke_detail_controller.dart │ │ │ │ ├── poke_detail_controller.g.dart │ │ │ │ └── poke_detail_page.dart │ │ │ ├── repositories │ │ │ ├── evolution_chain_repository.dart │ │ │ ├── interfaces │ │ │ │ ├── evolution_chain_repository_interface.dart │ │ │ │ ├── pokedex_repository_interface.dart │ │ │ │ ├── pokemon_repository_interface.dart │ │ │ │ └── pokemon_species_repository_interface.dart │ │ │ ├── pokedex_repository.dart │ │ │ ├── pokemon_repository.dart │ │ │ └── pokemon_species_repository.dart │ │ │ └── services │ │ │ ├── evolution_chain_service.dart │ │ │ ├── interfaces │ │ │ ├── evolution_chain_service_interface.dart │ │ │ ├── pokedex_service_interface.dart │ │ │ ├── pokemon_service_interface.dart │ │ │ └── pokemon_species_service_interface.dart │ │ │ ├── pokedex_service.dart │ │ │ ├── pokemon_service.dart │ │ │ └── pokemon_species_service.dart │ └── shared │ │ ├── custom_dio │ │ ├── custom_dio.dart │ │ └── interceptor.dart │ │ └── utils │ │ ├── consts_app.dart │ │ └── utils.dart └── main.dart ├── pubspec.lock ├── pubspec.yaml ├── test └── app │ └── modules │ └── home │ ├── pages │ └── poke_detail │ │ ├── components │ │ ├── app_bar_detail │ │ │ └── app_bar_detail_widget_test.dart │ │ ├── image_detail │ │ │ └── image_detail_widget_test.dart │ │ ├── poke_detail_header │ │ │ └── poke_detail_header_widget_test.dart │ │ ├── poower_info │ │ │ └── tabs │ │ │ │ ├── tabs_controller_test.dart │ │ │ │ └── tabs_widget_test.dart │ │ └── power_info │ │ │ ├── about │ │ │ └── about_widget_test.dart │ │ │ ├── power_info_widget_test.dart │ │ │ ├── tabs │ │ │ ├── evolution │ │ │ │ ├── evolution_controller_test.dart │ │ │ │ └── evolution_widget_test.dart │ │ │ ├── status │ │ │ │ └── status_widget_test.dart │ │ │ └── tabs_widget_test.dart │ │ │ └── tabs_controller_test.dart │ │ ├── poke_detail_controller_test.dart │ │ └── poke_detail_page_test.dart │ ├── repositories │ ├── evolution_chain_repository_test.dart │ ├── evolution_chain_service_test.dart │ └── pokemon_species_repository_test.dart │ └── services │ ├── evolution_chain_service_test.dart │ └── pokemon_species_service_test.dart └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: ab14307e0c77e4a03ea23ccaa68436d9128a445d 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.slidy/1586173270780: -------------------------------------------------------------------------------- 1 | lib/app/moduloes/home/services/pokemon_service.dart 2 | test/app/moduloes/home/services/pokemon_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586173296041: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/services/pokemon_service.dart 2 | test/app/modules/home/services/pokemon_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586173332876: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/repositories/pokemon_repository.dart 2 | test/app/modules/home/repositories/pokemon_repository_test.dart -------------------------------------------------------------------------------- /.slidy/1586173437663: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/models/pokemon_model.dart -------------------------------------------------------------------------------- /.slidy/1586173736119: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/services/pokedex_service.dart 2 | test/app/modules/home/services/pokedex_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586173756246: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/repositories/pokedex_repository.dart 2 | test/app/modules/home/repositories/pokedex_repository_test.dart -------------------------------------------------------------------------------- /.slidy/1586173766370: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/models/pokedex_model.dart -------------------------------------------------------------------------------- /.slidy/1586175135423: -------------------------------------------------------------------------------- 1 | lib/app/modules/modules_widget.dart 2 | test/app/modules/modules_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586175162468: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/header/header_widget.dart 2 | test/app/modules/home/components/header/header_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586175398444: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/body/body_widget.dart 2 | test/app/modules/home/components/body/body_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586175431232: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/app_bar/app_bar_widget.dart 2 | test/app/modules/home/components/app_bar/app_bar_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586175461966: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/pokemon_list/pokemon_list_widget.dart 2 | test/app/modules/home/components/pokemon_list/pokemon_list_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586175875467: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/pokemon_list/card_pokemon/card_pokemon_widget.dart 2 | test/app/modules/home/components/pokemon_list/card_pokemon/card_pokemon_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586176021805: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/pokemon_list/card_list/card_list_widget.dart 2 | test/app/modules/home/components/pokemon_list/card_list/card_list_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586176094978: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/pokemon_list/card_list/card_item/card_item_widget.dart 2 | test/app/modules/home/components/pokemon_list/card_list/card_item/card_item_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586176682055: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/pokemon_list/card_list/card_item/pokemon/pokemon_widget.dart 2 | test/app/modules/home/components/pokemon_list/card_list/card_item/pokemon/pokemon_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586176829635: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/poke_background/poke_background_widget.dart 2 | test/app/modules/home/components/poke_background/poke_background_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586176942750: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/poke_image/poke_image_widget.dart 2 | test/app/modules/home/components/poke_image/poke_image_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586177196594: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/models/list_pokemon_model.dart -------------------------------------------------------------------------------- /.slidy/1586177204295: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/models/pokemon_model.dart -------------------------------------------------------------------------------- /.slidy/1586177364216: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/services/pokemon_service.dart 2 | test/app/modules/home/services/pokemon_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586177380060: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/repositories/pokemon_repository.dart 2 | test/app/modules/home/repositories/pokemon_repository_test.dart -------------------------------------------------------------------------------- /.slidy/1586179617247: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/pokemon_list/card_list/card_item_controller.dart 2 | test/app/modules/home/components/pokemon_list/card_list/card_item_controller_test.dart -------------------------------------------------------------------------------- /.slidy/1586179645638: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/body/pokemon_list/card_list/card_item_controller.dart 2 | test/app/modules/home/components/body/pokemon_list/card_list/card_item_controller_test.dart -------------------------------------------------------------------------------- /.slidy/1586179921947: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/components/body/pokemon_list/card_list/card_item_controller.dart 2 | test/app/modules/home/components/body/pokemon_list/card_list/card_item_controller_test.dart -------------------------------------------------------------------------------- /.slidy/1586195044620: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/poke_detail_page.dart 2 | test/app/modules/home/pages/poke_detail/poke_detail_page_test.dart 3 | lib/app/modules/home/pages/poke_detail/poke_detail_controller.dart 4 | test/app/modules/home/pages/poke_detail/poke_detail_controller_test.dart -------------------------------------------------------------------------------- /.slidy/1586197370772: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/app_bar_detail/app_bar_detail_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/app_bar_detail/app_bar_detail_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586197387951: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/poke_detail_header/poke_detail_header_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/poke_detail_header/poke_detail_header_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586197401328: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/power_info_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/power_info_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586197467154: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/image_detail/image_detail_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/image_detail/image_detail_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586197629324: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/about/about_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/about/about_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586914839228: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_widget_test.dart 3 | lib/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_controller.dart 4 | test/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_controller_test.dart -------------------------------------------------------------------------------- /.slidy/1586914862368: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586915085428: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586915094911: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/tabs/status/status_widget.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/tabs/status/status_widget_test.dart -------------------------------------------------------------------------------- /.slidy/1586916215829: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/tabs_controller.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/tabs_controller_test.dart -------------------------------------------------------------------------------- /.slidy/1586916593727: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/repositories/pokemon_species_repository.dart 2 | test/app/modules/home/repositories/pokemon_species_repository_test.dart -------------------------------------------------------------------------------- /.slidy/1586916796075: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/services/pokemon_species_service.dart 2 | test/app/modules/home/services/pokemon_species_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586957825998: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/repositories/evolution_chain_repository.dart 2 | test/app/modules/home/repositories/evolution_chain_repository_test.dart -------------------------------------------------------------------------------- /.slidy/1586957840433: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/repositories/evolution_chain_service.dart 2 | test/app/modules/home/repositories/evolution_chain_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586957876432: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/services/evolution_chain_service.dart 2 | test/app/modules/home/services/evolution_chain_service_test.dart -------------------------------------------------------------------------------- /.slidy/1586958495921: -------------------------------------------------------------------------------- 1 | lib/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller.dart 2 | test/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller_test.dart -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pokedex_modular 2 | 3 | 'A new Flutter project. Created by Slidy' 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.toshi.pokedex_modular" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/toshi/pokedex_modular/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.toshi.pokedex_modular 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/fonts/ProductSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/assets/fonts/ProductSans-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/ProductSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/assets/fonts/ProductSans-Regular.ttf -------------------------------------------------------------------------------- /assets/images/pokeball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/assets/images/pokeball.png -------------------------------------------------------------------------------- /assets/images/pokeball_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/assets/images/pokeball_dark.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | pokedex_modular 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/app/app_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:mobx/mobx.dart'; 2 | 3 | part 'app_controller.g.dart'; 4 | 5 | class AppController = _AppControllerBase with _$AppController; 6 | 7 | abstract class _AppControllerBase with Store { 8 | @observable 9 | int value = 0; 10 | 11 | @action 12 | void increment() { 13 | value++; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/app/app_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'app_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // StoreGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 10 | 11 | mixin _$AppController on _AppControllerBase, Store { 12 | final _$valueAtom = Atom(name: '_AppControllerBase.value'); 13 | 14 | @override 15 | int get value { 16 | _$valueAtom.context.enforceReadPolicy(_$valueAtom); 17 | _$valueAtom.reportObserved(); 18 | return super.value; 19 | } 20 | 21 | @override 22 | set value(int value) { 23 | _$valueAtom.context.conditionallyRunInAction(() { 24 | super.value = value; 25 | _$valueAtom.reportChanged(); 26 | }, _$valueAtom, name: '${_$valueAtom.name}_set'); 27 | } 28 | 29 | final _$_AppControllerBaseActionController = 30 | ActionController(name: '_AppControllerBase'); 31 | 32 | @override 33 | void increment() { 34 | final _$actionInfo = _$_AppControllerBaseActionController.startAction(); 35 | try { 36 | return super.increment(); 37 | } finally { 38 | _$_AppControllerBaseActionController.endAction(_$actionInfo); 39 | } 40 | } 41 | 42 | @override 43 | String toString() { 44 | final string = 'value: ${value.toString()}'; 45 | return '{$string}'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/app/app_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:pokedex_modular/app/app_controller.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:pokedex_modular/app/app_widget.dart'; 6 | import 'package:pokedex_modular/app/modules/home/home_module.dart'; 7 | 8 | import 'shared/custom_dio/custom_dio.dart'; 9 | import 'shared/utils/consts_app.dart'; 10 | 11 | class AppModule extends MainModule { 12 | @override 13 | List get binds => [ 14 | Bind((i) => AppController()), 15 | Bind((i) => Dio( 16 | BaseOptions( 17 | baseUrl: Constants.apiUrl, 18 | connectTimeout: 25000, 19 | ), 20 | )), 21 | Bind((i) => CustomDio(i.get())), 22 | ]; 23 | 24 | @override 25 | List get routers => [ 26 | Router(Modular.initialRoute, module: HomeModule()), 27 | ]; 28 | 29 | @override 30 | Widget get bootstrap => AppWidget(); 31 | 32 | static Inject get to => Inject.of(); 33 | } 34 | -------------------------------------------------------------------------------- /lib/app/app_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | 4 | class AppWidget extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MaterialApp( 8 | debugShowCheckedModeBanner: false, 9 | navigatorKey: Modular.navigatorKey, 10 | title: 'Flutter Slidy', 11 | theme: ThemeData( 12 | primarySwatch: Colors.blue, 13 | ), 14 | initialRoute: '/', 15 | onGenerateRoute: Modular.generateRoute, 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/app_bar/app_bar_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppBarWidget extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Container( 7 | height: 120, 8 | child: Column( 9 | children: [ 10 | Container( 11 | alignment: Alignment.topRight, 12 | child: Padding( 13 | padding: const EdgeInsets.only(top: 13, right: 5), 14 | child: IconButton( 15 | icon: Icon(Icons.menu), 16 | onPressed: () {}, 17 | ), 18 | ), 19 | ), 20 | Container( 21 | alignment: Alignment.topLeft, 22 | child: Padding( 23 | padding: const EdgeInsets.only(left: 20), 24 | child: Text( 25 | 'Pokedex', 26 | style: TextStyle( 27 | fontFamily: 'PokemonFont', 28 | fontWeight: FontWeight.bold, 29 | fontSize: 28), 30 | ), 31 | ), 32 | ), 33 | ], 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/body/body_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/components/app_bar/app_bar_widget.dart'; 3 | import 'package:pokedex_modular/app/modules/home/components/body/pokemon_list/pokemon_list_widget.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 5 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 6 | 7 | class BodyWidget extends StatelessWidget { 8 | final ListPokemonModel pokemon; 9 | final List pokemons; 10 | 11 | const BodyWidget({Key key, this.pokemon, this.pokemons}) : super(key: key); 12 | @override 13 | Widget build(BuildContext context) { 14 | return SafeArea( 15 | child: Container( 16 | child: Column( 17 | crossAxisAlignment: CrossAxisAlignment.end, 18 | children: [ 19 | AppBarWidget(), 20 | Container( 21 | child: Expanded( 22 | child: Container( 23 | child: 24 | PokemonListWidget(pokemon: pokemon, pokemons: pokemons), 25 | ), 26 | ), 27 | ), 28 | ], 29 | ), 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/body/pokemon_list/card_list/card_item/card_item_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_modular/flutter_modular.dart'; 3 | import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/pokedex_model.dart'; 5 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 6 | import 'package:pokedex_modular/app/shared/utils/utils.dart'; 7 | 8 | import 'pokemon/pokemon_widget.dart'; 9 | 10 | class CardItemWidget extends StatelessWidget { 11 | final int index; 12 | final PokemonEntry pokemon; 13 | final List pokemons; 14 | 15 | CardItemWidget({Key key, this.index, this.pokemon, this.pokemons}) 16 | : super(key: key); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | var poke = pokemons.firstWhere((element) => element.id == index); 21 | return AnimationConfiguration.staggeredGrid( 22 | position: index, 23 | duration: const Duration(milliseconds: 375), 24 | columnCount: 2, 25 | child: ScaleAnimation( 26 | child: GestureDetector( 27 | child: PokemonWidget( 28 | types: poke.types, 29 | index: index, 30 | name: poke.name, 31 | num: index.toString().padLeft(3, '0'), 32 | color: Utils.getColorType( 33 | type: poke.types.firstWhere((e) => e.slot == 1).type.name), 34 | ), 35 | onTap: () { 36 | Modular.to.pushNamed('/details/${index - 1}', arguments: pokemons); 37 | }, 38 | ), 39 | ), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/body/pokemon_list/card_list/card_item/pokemon/pokemon_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/components/poke_background/poke_background_widget.dart'; 3 | import 'package:pokedex_modular/app/modules/home/components/poke_image/poke_image_widget.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 5 | import 'package:pokedex_modular/app/shared/utils/utils.dart'; 6 | 7 | class PokemonWidget extends StatelessWidget { 8 | final String name; 9 | final int index; 10 | final Color color; 11 | final List types; 12 | final String num; 13 | 14 | const PokemonWidget( 15 | {this.name, this.index, this.color, this.types, this.num}); 16 | @override 17 | Widget build(BuildContext context) { 18 | return Padding( 19 | padding: const EdgeInsets.all(8.0), 20 | child: Container( 21 | decoration: BoxDecoration( 22 | gradient: LinearGradient( 23 | begin: Alignment.topCenter, 24 | end: Alignment.bottomCenter, 25 | colors: [ 26 | color.withOpacity(0.7), 27 | color, 28 | ], 29 | ), 30 | borderRadius: BorderRadius.all(Radius.circular(20)), 31 | ), 32 | child: Padding( 33 | padding: const EdgeInsets.all(4), 34 | child: Stack( 35 | children: [ 36 | Align( 37 | alignment: Alignment.bottomRight, 38 | child: PokeBackgroundWidget(num: num, width: 80, height: 80), 39 | ), 40 | Column( 41 | crossAxisAlignment: CrossAxisAlignment.start, 42 | children: [ 43 | Padding( 44 | padding: const EdgeInsets.only(left: 8, top: 8), 45 | child: Text( 46 | name, 47 | style: TextStyle( 48 | fontFamily: 'PokemonFont', 49 | fontSize: 18, 50 | fontWeight: FontWeight.bold, 51 | color: Colors.white), 52 | ), 53 | ), 54 | Padding( 55 | padding: const EdgeInsets.all(8.0), 56 | child: Column(children: Utils.setTipos(types: types)), 57 | ), 58 | ], 59 | ), 60 | Align( 61 | alignment: Alignment.bottomRight, 62 | child: PokeImageWidget( 63 | alignment: Alignment.bottomRight, 64 | num: num, 65 | width: 100, 66 | height: 100, 67 | ), 68 | ), 69 | ], 70 | ), 71 | ), 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/body/pokemon_list/card_list/card_list_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; 3 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 5 | 6 | import 'card_item/card_item_widget.dart'; 7 | 8 | class CardListWidget extends StatelessWidget { 9 | final List pokemons; 10 | 11 | const CardListWidget({Key key, this.pokemons}) : super(key: key); 12 | @override 13 | Widget build(BuildContext context) { 14 | return AnimationLimiter( 15 | child: GridView.builder( 16 | physics: BouncingScrollPhysics(), 17 | padding: EdgeInsets.all(12), 18 | addAutomaticKeepAlives: true, 19 | gridDelegate: 20 | new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), 21 | itemCount: pokemons.length, 22 | itemBuilder: (context, index) { 23 | return CardItemWidget( 24 | index: index + 1, 25 | pokemons: pokemons 26 | ); 27 | }, 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/body/pokemon_list/pokemon_list_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 4 | 5 | import 'card_list/card_list_widget.dart'; 6 | 7 | class PokemonListWidget extends StatelessWidget { 8 | final ListPokemonModel pokemon; 9 | final List pokemons; 10 | 11 | const PokemonListWidget({Key key, this.pokemon, this.pokemons}) 12 | : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return pokemon == null 17 | ? Center( 18 | child: CircularProgressIndicator(), 19 | ) 20 | : CardListWidget( 21 | pokemons: pokemons, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/header/header_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/shared/utils/consts_app.dart'; 3 | 4 | class HeaderWidget extends StatelessWidget { 5 | final double screenWidth; 6 | final double top; 7 | 8 | const HeaderWidget({Key key, this.screenWidth, this.top}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Positioned( 12 | top: top, 13 | left: screenWidth - (240 / 1.6), 14 | child: Opacity( 15 | child: Image.asset( 16 | Constants.blackPokeball, 17 | width: 240, 18 | height: 240, 19 | ), 20 | opacity: 0.1, 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/poke_background/poke_background_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/shared/utils/consts_app.dart'; 3 | 4 | class PokeBackgroundWidget extends StatelessWidget { 5 | final String num; 6 | final double width; 7 | final double height; 8 | 9 | const PokeBackgroundWidget({Key key, this.num, this.width, this.height}) 10 | : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Hero( 15 | child: Opacity( 16 | opacity: 0.2, 17 | child: Image.asset( 18 | Constants.whitePokeball, 19 | width: width, 20 | height: height, 21 | ), 22 | ), 23 | tag: '${num}_pokeball', 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/app/modules/home/components/poke_image/poke_image_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:pokedex_modular/app/shared/utils/consts_app.dart'; 4 | 5 | class PokeImageWidget extends StatelessWidget { 6 | final String num; 7 | final double width; 8 | final double height; 9 | final bool currentPosition; 10 | final Alignment alignment; 11 | 12 | const PokeImageWidget( 13 | {Key key, 14 | this.num, 15 | this.width, 16 | this.height, 17 | this.currentPosition = true, 18 | this.alignment}) 19 | : super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return CachedNetworkImage( 24 | alignment: alignment == null ? Alignment.center : alignment, 25 | height: height, 26 | width: width, 27 | color: currentPosition ? null : Colors.black.withOpacity(0.5), 28 | placeholder: (context, url) => new Container( 29 | color: Colors.transparent, 30 | ), 31 | imageUrl: Constants.pokeImgUrl(num), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:mobx/mobx.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 4 | import 'package:pokedex_modular/app/modules/home/services/interfaces/pokemon_service_interface.dart'; 5 | 6 | part 'home_controller.g.dart'; 7 | 8 | class HomeController = _HomeControllerBase with _$HomeController; 9 | 10 | abstract class _HomeControllerBase with Store { 11 | @observable 12 | Future listPokemon; 13 | @observable 14 | bool loading = true; 15 | @observable 16 | ObservableList infoPokemon = ObservableList(); 17 | final IPokemonService _pokemonService; 18 | 19 | ReactionDisposer listPokemonDispose; 20 | 21 | _HomeControllerBase(this._pokemonService) { 22 | listPokemonDispose = when( 23 | (_) => listPokemon != null, 24 | () => listPokemon 25 | .whenComplete(() => listPokemon.then((value) => getInfo(value))), 26 | ); 27 | } 28 | 29 | @computed 30 | double get percent => 31 | (infoPokemon.isEmpty) ? 0 : (infoPokemon.length / 151) * 100; 32 | 33 | @action 34 | getList() { 35 | loading = true; 36 | listPokemon = _pokemonService.getList(); 37 | } 38 | 39 | @action 40 | getInfo(ListPokemonModel p) async { 41 | for (var item in List.generate(p.results.length, (i) => i + 1)) { 42 | infoPokemon.add(await _pokemonService.get(item)); 43 | } 44 | loading = false; 45 | listPokemonDispose(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'home_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // StoreGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 10 | 11 | mixin _$HomeController on _HomeControllerBase, Store { 12 | Computed _$percentComputed; 13 | 14 | @override 15 | double get percent => 16 | (_$percentComputed ??= Computed(() => super.percent)).value; 17 | 18 | final _$listPokemonAtom = Atom(name: '_HomeControllerBase.listPokemon'); 19 | 20 | @override 21 | Future get listPokemon { 22 | _$listPokemonAtom.context.enforceReadPolicy(_$listPokemonAtom); 23 | _$listPokemonAtom.reportObserved(); 24 | return super.listPokemon; 25 | } 26 | 27 | @override 28 | set listPokemon(Future value) { 29 | _$listPokemonAtom.context.conditionallyRunInAction(() { 30 | super.listPokemon = value; 31 | _$listPokemonAtom.reportChanged(); 32 | }, _$listPokemonAtom, name: '${_$listPokemonAtom.name}_set'); 33 | } 34 | 35 | final _$loadingAtom = Atom(name: '_HomeControllerBase.loading'); 36 | 37 | @override 38 | bool get loading { 39 | _$loadingAtom.context.enforceReadPolicy(_$loadingAtom); 40 | _$loadingAtom.reportObserved(); 41 | return super.loading; 42 | } 43 | 44 | @override 45 | set loading(bool value) { 46 | _$loadingAtom.context.conditionallyRunInAction(() { 47 | super.loading = value; 48 | _$loadingAtom.reportChanged(); 49 | }, _$loadingAtom, name: '${_$loadingAtom.name}_set'); 50 | } 51 | 52 | final _$infoPokemonAtom = Atom(name: '_HomeControllerBase.infoPokemon'); 53 | 54 | @override 55 | ObservableList get infoPokemon { 56 | _$infoPokemonAtom.context.enforceReadPolicy(_$infoPokemonAtom); 57 | _$infoPokemonAtom.reportObserved(); 58 | return super.infoPokemon; 59 | } 60 | 61 | @override 62 | set infoPokemon(ObservableList value) { 63 | _$infoPokemonAtom.context.conditionallyRunInAction(() { 64 | super.infoPokemon = value; 65 | _$infoPokemonAtom.reportChanged(); 66 | }, _$infoPokemonAtom, name: '${_$infoPokemonAtom.name}_set'); 67 | } 68 | 69 | final _$getInfoAsyncAction = AsyncAction('getInfo'); 70 | 71 | @override 72 | Future getInfo(ListPokemonModel p) { 73 | return _$getInfoAsyncAction.run(() => super.getInfo(p)); 74 | } 75 | 76 | final _$_HomeControllerBaseActionController = 77 | ActionController(name: '_HomeControllerBase'); 78 | 79 | @override 80 | dynamic getList() { 81 | final _$actionInfo = _$_HomeControllerBaseActionController.startAction(); 82 | try { 83 | return super.getList(); 84 | } finally { 85 | _$_HomeControllerBaseActionController.endAction(_$actionInfo); 86 | } 87 | } 88 | 89 | @override 90 | String toString() { 91 | final string = 92 | 'listPokemon: ${listPokemon.toString()},loading: ${loading.toString()},infoPokemon: ${infoPokemon.toString()},percent: ${percent.toString()}'; 93 | return '{$string}'; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller.dart'; 2 | import 'package:pokedex_modular/app/modules/home/services/evolution_chain_service.dart'; 3 | import 'package:pokedex_modular/app/modules/home/repositories/evolution_chain_repository.dart'; 4 | import 'package:pokedex_modular/app/modules/home/services/pokemon_species_service.dart'; 5 | import 'package:pokedex_modular/app/modules/home/repositories/pokemon_species_repository.dart'; 6 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_controller.dart'; 7 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/poke_detail_controller.dart'; 8 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/poke_detail_page.dart'; 9 | import 'package:pokedex_modular/app/modules/home/repositories/pokemon_repository.dart'; 10 | import 'package:pokedex_modular/app/modules/home/services/pokemon_service.dart'; 11 | import 'package:pokedex_modular/app/modules/home/repositories/pokedex_repository.dart'; 12 | import 'package:pokedex_modular/app/modules/home/services/pokedex_service.dart'; 13 | import 'package:pokedex_modular/app/modules/home/home_controller.dart'; 14 | import 'package:flutter_modular/flutter_modular.dart'; 15 | import 'package:pokedex_modular/app/modules/home/home_page.dart'; 16 | import 'package:pokedex_modular/app/shared/custom_dio/custom_dio.dart'; 17 | 18 | import 'repositories/interfaces/evolution_chain_repository_interface.dart'; 19 | import 'repositories/interfaces/pokedex_repository_interface.dart'; 20 | import 'repositories/interfaces/pokemon_repository_interface.dart'; 21 | import 'repositories/interfaces/pokemon_species_repository_interface.dart'; 22 | import 'services/interfaces/evolution_chain_service_interface.dart'; 23 | import 'services/interfaces/pokedex_service_interface.dart'; 24 | import 'services/interfaces/pokemon_service_interface.dart'; 25 | import 'services/interfaces/pokemon_species_service_interface.dart'; 26 | 27 | class HomeModule extends ChildModule { 28 | @override 29 | List get binds => [ 30 | Bind((i) => EvolutionController( 31 | Modular.get(), 32 | Modular.get(), 33 | )), 34 | Bind((i) => 35 | EvolutionChainService(Modular.get())), 36 | Bind( 37 | (i) => EvolutionChainRepository(Modular.get())), 38 | Bind((i) => 39 | PokemonSpeciesService(Modular.get())), 40 | Bind( 41 | (i) => PokemonSpeciesRepository(Modular.get())), 42 | Bind((i) => TabsController(Modular.get())), 43 | Bind((i) => PokeDetailController()), 44 | Bind( 45 | (i) => PokemonRepository(Modular.get())), 46 | Bind( 47 | (i) => PokemonService(i.get())), 48 | Bind((i) => PokedexRepository(Modular.get())), 49 | Bind( 50 | (i) => PokedexService(i.get())), 51 | Bind((i) => HomeController(i.get())), 52 | ]; 53 | 54 | @override 55 | List get routers => [ 56 | Router(Modular.initialRoute, child: (_, args) => HomePage()), 57 | Router('details/:num', 58 | child: (_, args) => PokeDetailPage( 59 | lstPokemons: args.data, 60 | num: int.parse(args.params['num']), 61 | )) 62 | ]; 63 | 64 | static Inject get to => Inject.of(); 65 | } 66 | -------------------------------------------------------------------------------- /lib/app/modules/home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:pokedex_modular/app/modules/home/components/body/body_widget.dart'; 5 | import 'components/header/header_widget.dart'; 6 | import 'home_controller.dart'; 7 | 8 | class HomePage extends StatefulWidget { 9 | final String title; 10 | const HomePage({Key key, this.title = "Home"}) : super(key: key); 11 | 12 | @override 13 | _HomePageState createState() => _HomePageState(); 14 | } 15 | 16 | class _HomePageState extends ModularState { 17 | @override 18 | void initState() { 19 | super.initState(); 20 | controller.getList(); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | body: Stack( 27 | children: [ 28 | HeaderWidget( 29 | screenWidth: MediaQuery.of(context).size.width, 30 | top: MediaQuery.of(context).padding.top - (240 / 2.9), 31 | ), 32 | Observer(builder: (_) { 33 | if (controller.listPokemon == null || controller.loading) 34 | return Padding( 35 | padding: const EdgeInsets.symmetric(horizontal: 50), 36 | child: Center( 37 | child: LinearProgressIndicator( 38 | valueColor: AlwaysStoppedAnimation(Colors.green), 39 | ), 40 | ), 41 | ); 42 | return FutureBuilder( 43 | future: controller.listPokemon, 44 | builder: (context, snapshot) { 45 | return BodyWidget( 46 | pokemon: snapshot.data, 47 | pokemons: controller.infoPokemon, 48 | ); 49 | }); 50 | }) 51 | ], 52 | ), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/app/modules/home/models/evolution_chain_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final evolutionChain = evolutionChainFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | class EvolutionChain { 8 | final dynamic babyTriggerItem; 9 | final Chain chain; 10 | final int id; 11 | 12 | EvolutionChain({ 13 | this.babyTriggerItem, 14 | this.chain, 15 | this.id, 16 | }); 17 | 18 | factory EvolutionChain.fromJson(String str) => 19 | EvolutionChain.fromMap(json.decode(str)); 20 | 21 | String toJson() => json.encode(toMap()); 22 | 23 | factory EvolutionChain.fromMap(Map json) => EvolutionChain( 24 | babyTriggerItem: json["baby_trigger_item"], 25 | chain: Chain.fromMap(json["chain"]), 26 | id: json["id"], 27 | ); 28 | 29 | Map toMap() => { 30 | "baby_trigger_item": babyTriggerItem, 31 | "chain": chain.toMap(), 32 | "id": id, 33 | }; 34 | } 35 | 36 | class Chain { 37 | final List evolutionDetails; 38 | final List evolvesTo; 39 | final bool isBaby; 40 | final Species species; 41 | 42 | Chain({ 43 | this.evolutionDetails, 44 | this.evolvesTo, 45 | this.isBaby, 46 | this.species, 47 | }); 48 | 49 | factory Chain.fromJson(String str) => Chain.fromMap(json.decode(str)); 50 | 51 | String toJson() => json.encode(toMap()); 52 | 53 | factory Chain.fromMap(Map json) => Chain( 54 | evolutionDetails: List.from( 55 | json["evolution_details"].map((x) => EvolutionDetail.fromMap(x))), 56 | evolvesTo: 57 | List.from(json["evolves_to"].map((x) => Chain.fromMap(x))), 58 | isBaby: json["is_baby"], 59 | species: Species.fromMap(json["species"]), 60 | ); 61 | 62 | Map toMap() => { 63 | "evolution_details": 64 | List.from(evolutionDetails.map((x) => x.toMap())), 65 | "evolves_to": List.from(evolvesTo.map((x) => x.toMap())), 66 | "is_baby": isBaby, 67 | "species": species.toMap(), 68 | }; 69 | } 70 | 71 | class EvolutionDetail { 72 | final dynamic gender; 73 | final dynamic heldItem; 74 | final dynamic item; 75 | final dynamic knownMove; 76 | final dynamic knownMoveType; 77 | final dynamic location; 78 | final dynamic minAffection; 79 | final dynamic minBeauty; 80 | final dynamic minHappiness; 81 | final int minLevel; 82 | final bool needsOverworldRain; 83 | final dynamic partySpecies; 84 | final dynamic partyType; 85 | final dynamic relativePhysicalStats; 86 | final String timeOfDay; 87 | final dynamic tradeSpecies; 88 | final Species trigger; 89 | final bool turnUpsideDown; 90 | 91 | EvolutionDetail({ 92 | this.gender, 93 | this.heldItem, 94 | this.item, 95 | this.knownMove, 96 | this.knownMoveType, 97 | this.location, 98 | this.minAffection, 99 | this.minBeauty, 100 | this.minHappiness, 101 | this.minLevel, 102 | this.needsOverworldRain, 103 | this.partySpecies, 104 | this.partyType, 105 | this.relativePhysicalStats, 106 | this.timeOfDay, 107 | this.tradeSpecies, 108 | this.trigger, 109 | this.turnUpsideDown, 110 | }); 111 | 112 | factory EvolutionDetail.fromJson(String str) => 113 | EvolutionDetail.fromMap(json.decode(str)); 114 | 115 | String toJson() => json.encode(toMap()); 116 | 117 | factory EvolutionDetail.fromMap(Map json) => EvolutionDetail( 118 | gender: json["gender"], 119 | heldItem: json["held_item"], 120 | item: json["item"], 121 | knownMove: json["known_move"], 122 | knownMoveType: json["known_move_type"], 123 | location: json["location"], 124 | minAffection: json["min_affection"], 125 | minBeauty: json["min_beauty"], 126 | minHappiness: json["min_happiness"], 127 | minLevel: json["min_level"], 128 | needsOverworldRain: json["needs_overworld_rain"], 129 | partySpecies: json["party_species"], 130 | partyType: json["party_type"], 131 | relativePhysicalStats: json["relative_physical_stats"], 132 | timeOfDay: json["time_of_day"], 133 | tradeSpecies: json["trade_species"], 134 | trigger: Species.fromMap(json["trigger"]), 135 | turnUpsideDown: json["turn_upside_down"], 136 | ); 137 | 138 | Map toMap() => { 139 | "gender": gender, 140 | "held_item": heldItem, 141 | "item": item, 142 | "known_move": knownMove, 143 | "known_move_type": knownMoveType, 144 | "location": location, 145 | "min_affection": minAffection, 146 | "min_beauty": minBeauty, 147 | "min_happiness": minHappiness, 148 | "min_level": minLevel, 149 | "needs_overworld_rain": needsOverworldRain, 150 | "party_species": partySpecies, 151 | "party_type": partyType, 152 | "relative_physical_stats": relativePhysicalStats, 153 | "time_of_day": timeOfDay, 154 | "trade_species": tradeSpecies, 155 | "trigger": trigger.toMap(), 156 | "turn_upside_down": turnUpsideDown, 157 | }; 158 | } 159 | 160 | class Species { 161 | final String name; 162 | final String url; 163 | 164 | Species({ 165 | this.name, 166 | this.url, 167 | }); 168 | 169 | factory Species.fromJson(String str) => Species.fromMap(json.decode(str)); 170 | 171 | String toJson() => json.encode(toMap()); 172 | 173 | factory Species.fromMap(Map json) => Species( 174 | name: json["name"], 175 | url: json["url"], 176 | ); 177 | 178 | Map toMap() => { 179 | "name": name, 180 | "url": url, 181 | }; 182 | } 183 | -------------------------------------------------------------------------------- /lib/app/modules/home/models/list_pokemon_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final listPokemonModel = listPokemonModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | ListPokemonModel listPokemonModelFromJson(String str) => 8 | ListPokemonModel.fromJson(json.decode(str)); 9 | 10 | String listPokemonModelToJson(ListPokemonModel data) => 11 | json.encode(data.toJson()); 12 | 13 | class ListPokemonModel { 14 | int count; 15 | String next; 16 | String previous; 17 | List results; 18 | 19 | ListPokemonModel({ 20 | this.count, 21 | this.next, 22 | this.previous, 23 | this.results, 24 | }); 25 | 26 | factory ListPokemonModel.fromJson(Map json) => 27 | ListPokemonModel( 28 | count: json["count"], 29 | next: json["next"], 30 | previous: json["previous"], 31 | results: 32 | List.from(json["results"].map((x) => ResultPokemon.fromJson(x))), 33 | ); 34 | 35 | Map toJson() => { 36 | "count": count, 37 | "next": next, 38 | "previous": previous, 39 | "results": List.from(results.map((x) => x.toJson())), 40 | }; 41 | } 42 | 43 | class ResultPokemon { 44 | String name; 45 | String url; 46 | 47 | ResultPokemon({ 48 | this.name, 49 | this.url, 50 | }); 51 | 52 | factory ResultPokemon.fromJson(Map json) => ResultPokemon( 53 | name: json["name"], 54 | url: json["url"], 55 | ); 56 | 57 | Map toJson() => { 58 | "name": name, 59 | "url": url, 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /lib/app/modules/home/models/pokedex_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final pokedexModel = pokedexModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | PokedexModel pokedexModelFromJson(String str) => 8 | PokedexModel.fromJson(json.decode(str)); 9 | 10 | String pokedexModelToJson(PokedexModel data) => json.encode(data.toJson()); 11 | 12 | class PokedexModel { 13 | List descriptions; 14 | int id; 15 | bool isMainSeries; 16 | String name; 17 | List names; 18 | List pokemonEntries; 19 | Region region; 20 | List versionGroups; 21 | 22 | PokedexModel({ 23 | this.descriptions, 24 | this.id, 25 | this.isMainSeries, 26 | this.name, 27 | this.names, 28 | this.pokemonEntries, 29 | this.region, 30 | this.versionGroups, 31 | }); 32 | 33 | factory PokedexModel.fromJson(Map json) => PokedexModel( 34 | descriptions: List.from( 35 | json["descriptions"].map((x) => Description.fromJson(x))), 36 | id: json["id"], 37 | isMainSeries: json["is_main_series"], 38 | name: json["name"], 39 | names: List.from(json["names"].map((x) => Name.fromJson(x))), 40 | pokemonEntries: List.from( 41 | json["pokemon_entries"].map((x) => PokemonEntry.fromJson(x))), 42 | region: Region.fromJson(json["region"]), 43 | versionGroups: List.from( 44 | json["version_groups"].map((x) => Region.fromJson(x))), 45 | ); 46 | 47 | Map toJson() => { 48 | "descriptions": List.from(descriptions.map((x) => x.toJson())), 49 | "id": id, 50 | "is_main_series": isMainSeries, 51 | "name": name, 52 | "names": List.from(names.map((x) => x.toJson())), 53 | "pokemon_entries": 54 | List.from(pokemonEntries.map((x) => x.toJson())), 55 | "region": region.toJson(), 56 | "version_groups": 57 | List.from(versionGroups.map((x) => x.toJson())), 58 | }; 59 | } 60 | 61 | class Description { 62 | String description; 63 | Region language; 64 | 65 | Description({ 66 | this.description, 67 | this.language, 68 | }); 69 | 70 | factory Description.fromJson(Map json) => Description( 71 | description: json["description"], 72 | language: Region.fromJson(json["language"]), 73 | ); 74 | 75 | Map toJson() => { 76 | "description": description, 77 | "language": language.toJson(), 78 | }; 79 | } 80 | 81 | class Region { 82 | String name; 83 | String url; 84 | 85 | Region({ 86 | this.name, 87 | this.url, 88 | }); 89 | 90 | factory Region.fromJson(Map json) => Region( 91 | name: json["name"], 92 | url: json["url"], 93 | ); 94 | 95 | Map toJson() => { 96 | "name": name, 97 | "url": url, 98 | }; 99 | } 100 | 101 | class Name { 102 | Region language; 103 | String name; 104 | 105 | Name({ 106 | this.language, 107 | this.name, 108 | }); 109 | 110 | factory Name.fromJson(Map json) => Name( 111 | language: Region.fromJson(json["language"]), 112 | name: json["name"], 113 | ); 114 | 115 | Map toJson() => { 116 | "language": language.toJson(), 117 | "name": name, 118 | }; 119 | } 120 | 121 | class PokemonEntry { 122 | int entryNumber; 123 | Region pokemonSpecies; 124 | 125 | PokemonEntry({ 126 | this.entryNumber, 127 | this.pokemonSpecies, 128 | }); 129 | 130 | factory PokemonEntry.fromJson(Map json) => PokemonEntry( 131 | entryNumber: json["entry_number"], 132 | pokemonSpecies: Region.fromJson(json["pokemon_species"]), 133 | ); 134 | 135 | Map toJson() => { 136 | "entry_number": entryNumber, 137 | "pokemon_species": pokemonSpecies.toJson(), 138 | }; 139 | } 140 | -------------------------------------------------------------------------------- /lib/app/modules/home/models/pokemon_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final pokemonModel = pokemonModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | PokemonModel pokemonModelFromJson(String str) => 8 | PokemonModel.fromJson(json.decode(str)); 9 | 10 | String pokemonModelToJson(PokemonModel data) => json.encode(data.toJson()); 11 | 12 | class PokemonModel { 13 | List abilities; 14 | int baseExperience; 15 | List forms; 16 | List gameIndices; 17 | int height; 18 | List heldItems; 19 | int id; 20 | bool isDefault; 21 | String locationAreaEncounters; 22 | List moves; 23 | String name; 24 | int order; 25 | Species species; 26 | Sprites sprites; 27 | List stats; 28 | List types; 29 | int weight; 30 | 31 | PokemonModel({ 32 | this.abilities, 33 | this.baseExperience, 34 | this.forms, 35 | this.gameIndices, 36 | this.height, 37 | this.heldItems, 38 | this.id, 39 | this.isDefault, 40 | this.locationAreaEncounters, 41 | this.moves, 42 | this.name, 43 | this.order, 44 | this.species, 45 | this.sprites, 46 | this.stats, 47 | this.types, 48 | this.weight, 49 | }); 50 | 51 | factory PokemonModel.fromJson(Map json) => PokemonModel( 52 | abilities: List.from( 53 | json["abilities"].map((x) => Ability.fromJson(x))), 54 | baseExperience: json["base_experience"], 55 | forms: 56 | List.from(json["forms"].map((x) => Species.fromJson(x))), 57 | gameIndices: List.from( 58 | json["game_indices"].map((x) => GameIndex.fromJson(x))), 59 | height: json["height"], 60 | heldItems: List.from( 61 | json["held_items"].map((x) => HeldItem.fromJson(x))), 62 | id: json["id"], 63 | isDefault: json["is_default"], 64 | locationAreaEncounters: json["location_area_encounters"], 65 | moves: List.from(json["moves"].map((x) => Move.fromJson(x))), 66 | name: json["name"], 67 | order: json["order"], 68 | species: Species.fromJson(json["species"]), 69 | sprites: Sprites.fromJson(json["sprites"]), 70 | stats: List.from(json["stats"].map((x) => Stat.fromJson(x))), 71 | types: List.from(json["types"].map((x) => Type.fromJson(x))), 72 | weight: json["weight"], 73 | ); 74 | 75 | Map toJson() => { 76 | "abilities": List.from(abilities.map((x) => x.toJson())), 77 | "base_experience": baseExperience, 78 | "forms": List.from(forms.map((x) => x.toJson())), 79 | "game_indices": List.from(gameIndices.map((x) => x.toJson())), 80 | "height": height, 81 | "held_items": List.from(heldItems.map((x) => x.toJson())), 82 | "id": id, 83 | "is_default": isDefault, 84 | "location_area_encounters": locationAreaEncounters, 85 | "moves": List.from(moves.map((x) => x.toJson())), 86 | "name": name, 87 | "order": order, 88 | "species": species.toJson(), 89 | "sprites": sprites.toJson(), 90 | "stats": List.from(stats.map((x) => x.toJson())), 91 | "types": List.from(types.map((x) => x.toJson())), 92 | "weight": weight, 93 | }; 94 | } 95 | 96 | class Ability { 97 | Species ability; 98 | bool isHidden; 99 | int slot; 100 | 101 | Ability({ 102 | this.ability, 103 | this.isHidden, 104 | this.slot, 105 | }); 106 | 107 | factory Ability.fromJson(Map json) => Ability( 108 | ability: Species.fromJson(json["ability"]), 109 | isHidden: json["is_hidden"], 110 | slot: json["slot"], 111 | ); 112 | 113 | Map toJson() => { 114 | "ability": ability.toJson(), 115 | "is_hidden": isHidden, 116 | "slot": slot, 117 | }; 118 | } 119 | 120 | class Species { 121 | String name; 122 | String url; 123 | 124 | Species({ 125 | this.name, 126 | this.url, 127 | }); 128 | 129 | factory Species.fromJson(Map json) => Species( 130 | name: json["name"], 131 | url: json["url"], 132 | ); 133 | 134 | Map toJson() => { 135 | "name": name, 136 | "url": url, 137 | }; 138 | } 139 | 140 | class GameIndex { 141 | int gameIndex; 142 | Species version; 143 | 144 | GameIndex({ 145 | this.gameIndex, 146 | this.version, 147 | }); 148 | 149 | factory GameIndex.fromJson(Map json) => GameIndex( 150 | gameIndex: json["game_index"], 151 | version: Species.fromJson(json["version"]), 152 | ); 153 | 154 | Map toJson() => { 155 | "game_index": gameIndex, 156 | "version": version.toJson(), 157 | }; 158 | } 159 | 160 | class HeldItem { 161 | Species item; 162 | List versionDetails; 163 | 164 | HeldItem({ 165 | this.item, 166 | this.versionDetails, 167 | }); 168 | 169 | factory HeldItem.fromJson(Map json) => HeldItem( 170 | item: Species.fromJson(json["item"]), 171 | versionDetails: List.from( 172 | json["version_details"].map((x) => VersionDetail.fromJson(x))), 173 | ); 174 | 175 | Map toJson() => { 176 | "item": item.toJson(), 177 | "version_details": 178 | List.from(versionDetails.map((x) => x.toJson())), 179 | }; 180 | } 181 | 182 | class VersionDetail { 183 | int rarity; 184 | Species version; 185 | 186 | VersionDetail({ 187 | this.rarity, 188 | this.version, 189 | }); 190 | 191 | factory VersionDetail.fromJson(Map json) => VersionDetail( 192 | rarity: json["rarity"], 193 | version: Species.fromJson(json["version"]), 194 | ); 195 | 196 | Map toJson() => { 197 | "rarity": rarity, 198 | "version": version.toJson(), 199 | }; 200 | } 201 | 202 | class Move { 203 | Species move; 204 | List versionGroupDetails; 205 | 206 | Move({ 207 | this.move, 208 | this.versionGroupDetails, 209 | }); 210 | 211 | factory Move.fromJson(Map json) => Move( 212 | move: Species.fromJson(json["move"]), 213 | versionGroupDetails: List.from( 214 | json["version_group_details"] 215 | .map((x) => VersionGroupDetail.fromJson(x))), 216 | ); 217 | 218 | Map toJson() => { 219 | "move": move.toJson(), 220 | "version_group_details": 221 | List.from(versionGroupDetails.map((x) => x.toJson())), 222 | }; 223 | } 224 | 225 | class VersionGroupDetail { 226 | int levelLearnedAt; 227 | Species moveLearnMethod; 228 | Species versionGroup; 229 | 230 | VersionGroupDetail({ 231 | this.levelLearnedAt, 232 | this.moveLearnMethod, 233 | this.versionGroup, 234 | }); 235 | 236 | factory VersionGroupDetail.fromJson(Map json) => 237 | VersionGroupDetail( 238 | levelLearnedAt: json["level_learned_at"], 239 | moveLearnMethod: Species.fromJson(json["move_learn_method"]), 240 | versionGroup: Species.fromJson(json["version_group"]), 241 | ); 242 | 243 | Map toJson() => { 244 | "level_learned_at": levelLearnedAt, 245 | "move_learn_method": moveLearnMethod.toJson(), 246 | "version_group": versionGroup.toJson(), 247 | }; 248 | } 249 | 250 | class Sprites { 251 | String backDefault; 252 | String backFemale; 253 | String backShiny; 254 | String backShinyFemale; 255 | String frontDefault; 256 | String frontFemale; 257 | String frontShiny; 258 | String frontShinyFemale; 259 | 260 | Sprites({ 261 | this.backDefault, 262 | this.backFemale, 263 | this.backShiny, 264 | this.backShinyFemale, 265 | this.frontDefault, 266 | this.frontFemale, 267 | this.frontShiny, 268 | this.frontShinyFemale, 269 | }); 270 | 271 | factory Sprites.fromJson(Map json) => Sprites( 272 | backDefault: json["back_default"], 273 | backFemale: json["back_female"], 274 | backShiny: json["back_shiny"], 275 | backShinyFemale: json["back_shiny_female"], 276 | frontDefault: json["front_default"], 277 | frontFemale: json["front_female"], 278 | frontShiny: json["front_shiny"], 279 | frontShinyFemale: json["front_shiny_female"], 280 | ); 281 | 282 | Map toJson() => { 283 | "back_default": backDefault, 284 | "back_female": backFemale, 285 | "back_shiny": backShiny, 286 | "back_shiny_female": backShinyFemale, 287 | "front_default": frontDefault, 288 | "front_female": frontFemale, 289 | "front_shiny": frontShiny, 290 | "front_shiny_female": frontShinyFemale, 291 | }; 292 | } 293 | 294 | class Stat { 295 | int baseStat; 296 | int effort; 297 | Species stat; 298 | 299 | Stat({ 300 | this.baseStat, 301 | this.effort, 302 | this.stat, 303 | }); 304 | 305 | factory Stat.fromJson(Map json) => Stat( 306 | baseStat: json["base_stat"], 307 | effort: json["effort"], 308 | stat: Species.fromJson(json["stat"]), 309 | ); 310 | 311 | Map toJson() => { 312 | "base_stat": baseStat, 313 | "effort": effort, 314 | "stat": stat.toJson(), 315 | }; 316 | } 317 | 318 | class Type { 319 | int slot; 320 | Species type; 321 | 322 | Type({ 323 | this.slot, 324 | this.type, 325 | }); 326 | 327 | factory Type.fromJson(Map json) => Type( 328 | slot: json["slot"], 329 | type: Species.fromJson(json["type"]), 330 | ); 331 | 332 | Map toJson() => { 333 | "slot": slot, 334 | "type": type.toJson(), 335 | }; 336 | } 337 | -------------------------------------------------------------------------------- /lib/app/modules/home/models/pokemon_species_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class PokemonSpecies { 4 | final int baseHappiness; 5 | final int captureRate; 6 | final CorPokemon color; 7 | final List eggGroups; 8 | final EvolutionChainPokemon evolutionChain; 9 | final dynamic evolvesFromSpecies; 10 | final List flavorTextEntries; 11 | final List formDescriptions; 12 | final bool formsSwitchable; 13 | final int genderRate; 14 | final List genera; 15 | final CorPokemon generation; 16 | final CorPokemon growthRate; 17 | final CorPokemon habitat; 18 | final bool hasGenderDifferences; 19 | final int hatchCounter; 20 | final int id; 21 | final bool isBaby; 22 | final String name; 23 | final List names; 24 | final int order; 25 | final List palParkEncounters; 26 | final List pokedexNumbers; 27 | final CorPokemon shape; 28 | final List varieties; 29 | 30 | PokemonSpecies({ 31 | this.baseHappiness, 32 | this.captureRate, 33 | this.color, 34 | this.eggGroups, 35 | this.evolutionChain, 36 | this.evolvesFromSpecies, 37 | this.flavorTextEntries, 38 | this.formDescriptions, 39 | this.formsSwitchable, 40 | this.genderRate, 41 | this.genera, 42 | this.generation, 43 | this.growthRate, 44 | this.habitat, 45 | this.hasGenderDifferences, 46 | this.hatchCounter, 47 | this.id, 48 | this.isBaby, 49 | this.name, 50 | this.names, 51 | this.order, 52 | this.palParkEncounters, 53 | this.pokedexNumbers, 54 | this.shape, 55 | this.varieties, 56 | }); 57 | 58 | factory PokemonSpecies.fromJson(String str) => 59 | PokemonSpecies.fromMap(json.decode(str)); 60 | 61 | String toJson() => json.encode(toMap()); 62 | 63 | factory PokemonSpecies.fromMap(Map json) => PokemonSpecies( 64 | baseHappiness: json["base_happiness"], 65 | captureRate: json["capture_rate"], 66 | color: CorPokemon.fromMap(json["color"]), 67 | eggGroups: List.from( 68 | json["egg_groups"].map((x) => CorPokemon.fromMap(x))), 69 | evolutionChain: EvolutionChainPokemon.fromMap(json["evolution_chain"]), 70 | evolvesFromSpecies: json["evolves_from_species"], 71 | flavorTextEntries: List.from( 72 | json["flavor_text_entries"].map((x) => FlavorTextEntry.fromMap(x))), 73 | formDescriptions: 74 | List.from(json["form_descriptions"].map((x) => x)), 75 | formsSwitchable: json["forms_switchable"], 76 | genderRate: json["gender_rate"], 77 | genera: List.from(json["genera"].map((x) => Genus.fromMap(x))), 78 | generation: CorPokemon.fromMap(json["generation"]), 79 | growthRate: CorPokemon.fromMap(json["growth_rate"]), 80 | habitat: CorPokemon.fromMap(json["habitat"]), 81 | hasGenderDifferences: json["has_gender_differences"], 82 | hatchCounter: json["hatch_counter"], 83 | id: json["id"], 84 | isBaby: json["is_baby"], 85 | name: json["name"], 86 | names: List.from(json["names"].map((x) => Name.fromMap(x))), 87 | order: json["order"], 88 | palParkEncounters: List.from( 89 | json["pal_park_encounters"] 90 | .map((x) => PalParkEncounter.fromMap(x))), 91 | pokedexNumbers: List.from( 92 | json["pokedex_numbers"].map((x) => PokedexNumber.fromMap(x))), 93 | shape: CorPokemon.fromMap(json["shape"]), 94 | varieties: List.from( 95 | json["varieties"].map((x) => Variety.fromMap(x))), 96 | ); 97 | 98 | Map toMap() => { 99 | "base_happiness": baseHappiness, 100 | "capture_rate": captureRate, 101 | "color": color.toMap(), 102 | "egg_groups": List.from(eggGroups.map((x) => x.toMap())), 103 | "evolution_chain": evolutionChain.toMap(), 104 | "evolves_from_species": evolvesFromSpecies, 105 | "flavor_text_entries": 106 | List.from(flavorTextEntries.map((x) => x.toMap())), 107 | "form_descriptions": List.from(formDescriptions.map((x) => x)), 108 | "forms_switchable": formsSwitchable, 109 | "gender_rate": genderRate, 110 | "genera": List.from(genera.map((x) => x.toMap())), 111 | "generation": generation.toMap(), 112 | "growth_rate": growthRate.toMap(), 113 | "habitat": habitat.toMap(), 114 | "has_gender_differences": hasGenderDifferences, 115 | "hatch_counter": hatchCounter, 116 | "id": id, 117 | "is_baby": isBaby, 118 | "name": name, 119 | "names": List.from(names.map((x) => x.toMap())), 120 | "order": order, 121 | "pal_park_encounters": 122 | List.from(palParkEncounters.map((x) => x.toMap())), 123 | "pokedex_numbers": 124 | List.from(pokedexNumbers.map((x) => x.toMap())), 125 | "shape": shape.toMap(), 126 | "varieties": List.from(varieties.map((x) => x.toMap())), 127 | }; 128 | } 129 | 130 | class CorPokemon { 131 | final String name; 132 | final String url; 133 | 134 | CorPokemon({ 135 | this.name, 136 | this.url, 137 | }); 138 | 139 | factory CorPokemon.fromJson(String str) => 140 | CorPokemon.fromMap(json.decode(str)); 141 | 142 | String toJson() => json.encode(toMap()); 143 | 144 | factory CorPokemon.fromMap(Map json) => CorPokemon( 145 | name: json["name"], 146 | url: json["url"], 147 | ); 148 | 149 | Map toMap() => { 150 | "name": name, 151 | "url": url, 152 | }; 153 | } 154 | 155 | class EvolutionChainPokemon { 156 | final String url; 157 | 158 | EvolutionChainPokemon({ 159 | this.url, 160 | }); 161 | 162 | factory EvolutionChainPokemon.fromJson(String str) => 163 | EvolutionChainPokemon.fromMap(json.decode(str)); 164 | 165 | String toJson() => json.encode(toMap()); 166 | 167 | factory EvolutionChainPokemon.fromMap(Map json) => 168 | EvolutionChainPokemon( 169 | url: json["url"], 170 | ); 171 | 172 | Map toMap() => { 173 | "url": url, 174 | }; 175 | } 176 | 177 | class FlavorTextEntry { 178 | final String flavorText; 179 | final CorPokemon language; 180 | final CorPokemon version; 181 | 182 | FlavorTextEntry({ 183 | this.flavorText, 184 | this.language, 185 | this.version, 186 | }); 187 | 188 | factory FlavorTextEntry.fromJson(String str) => 189 | FlavorTextEntry.fromMap(json.decode(str)); 190 | 191 | String toJson() => json.encode(toMap()); 192 | 193 | factory FlavorTextEntry.fromMap(Map json) => FlavorTextEntry( 194 | flavorText: json["flavor_text"], 195 | language: CorPokemon.fromMap(json["language"]), 196 | version: CorPokemon.fromMap(json["version"]), 197 | ); 198 | 199 | Map toMap() => { 200 | "flavor_text": flavorText, 201 | "language": language.toMap(), 202 | "version": version.toMap(), 203 | }; 204 | } 205 | 206 | class Genus { 207 | final String genus; 208 | final CorPokemon language; 209 | 210 | Genus({ 211 | this.genus, 212 | this.language, 213 | }); 214 | 215 | factory Genus.fromJson(String str) => Genus.fromMap(json.decode(str)); 216 | 217 | String toJson() => json.encode(toMap()); 218 | 219 | factory Genus.fromMap(Map json) => Genus( 220 | genus: json["genus"], 221 | language: CorPokemon.fromMap(json["language"]), 222 | ); 223 | 224 | Map toMap() => { 225 | "genus": genus, 226 | "language": language.toMap(), 227 | }; 228 | } 229 | 230 | class Name { 231 | final CorPokemon language; 232 | final String name; 233 | 234 | Name({ 235 | this.language, 236 | this.name, 237 | }); 238 | 239 | factory Name.fromJson(String str) => Name.fromMap(json.decode(str)); 240 | 241 | String toJson() => json.encode(toMap()); 242 | 243 | factory Name.fromMap(Map json) => Name( 244 | language: CorPokemon.fromMap(json["language"]), 245 | name: json["name"], 246 | ); 247 | 248 | Map toMap() => { 249 | "language": language.toMap(), 250 | "name": name, 251 | }; 252 | } 253 | 254 | class PalParkEncounter { 255 | final CorPokemon area; 256 | final int baseScore; 257 | final int rate; 258 | 259 | PalParkEncounter({ 260 | this.area, 261 | this.baseScore, 262 | this.rate, 263 | }); 264 | 265 | factory PalParkEncounter.fromJson(String str) => 266 | PalParkEncounter.fromMap(json.decode(str)); 267 | 268 | String toJson() => json.encode(toMap()); 269 | 270 | factory PalParkEncounter.fromMap(Map json) => 271 | PalParkEncounter( 272 | area: CorPokemon.fromMap(json["area"]), 273 | baseScore: json["base_score"], 274 | rate: json["rate"], 275 | ); 276 | 277 | Map toMap() => { 278 | "area": area.toMap(), 279 | "base_score": baseScore, 280 | "rate": rate, 281 | }; 282 | } 283 | 284 | class PokedexNumber { 285 | final int entryNumber; 286 | final CorPokemon pokedex; 287 | 288 | PokedexNumber({ 289 | this.entryNumber, 290 | this.pokedex, 291 | }); 292 | 293 | factory PokedexNumber.fromJson(String str) => 294 | PokedexNumber.fromMap(json.decode(str)); 295 | 296 | String toJson() => json.encode(toMap()); 297 | 298 | factory PokedexNumber.fromMap(Map json) => PokedexNumber( 299 | entryNumber: json["entry_number"], 300 | pokedex: CorPokemon.fromMap(json["pokedex"]), 301 | ); 302 | 303 | Map toMap() => { 304 | "entry_number": entryNumber, 305 | "pokedex": pokedex.toMap(), 306 | }; 307 | } 308 | 309 | class Variety { 310 | final bool isDefault; 311 | final CorPokemon pokemon; 312 | 313 | Variety({ 314 | this.isDefault, 315 | this.pokemon, 316 | }); 317 | 318 | factory Variety.fromJson(String str) => Variety.fromMap(json.decode(str)); 319 | 320 | String toJson() => json.encode(toMap()); 321 | 322 | factory Variety.fromMap(Map json) => Variety( 323 | isDefault: json["is_default"], 324 | pokemon: CorPokemon.fromMap(json["pokemon"]), 325 | ); 326 | 327 | Map toMap() => { 328 | "is_default": isDefault, 329 | "pokemon": pokemon.toMap(), 330 | }; 331 | } 332 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/app_bar_detail/app_bar_detail_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/components/poke_background/poke_background_widget.dart'; 3 | import 'package:simple_animations/simple_animations/controlled_animation.dart'; 4 | import 'package:simple_animations/simple_animations/multi_track_tween.dart'; 5 | 6 | class AppBarDetailWidget extends StatelessWidget { 7 | final double opacity; 8 | final MultiTrackTween tween; 9 | 10 | const AppBarDetailWidget({ 11 | Key key, 12 | this.opacity, 13 | this.tween, 14 | }) : super(key: key); 15 | @override 16 | Widget build(BuildContext context) { 17 | return AppBar( 18 | centerTitle: true, 19 | elevation: 0, 20 | backgroundColor: Colors.transparent, 21 | actions: [ 22 | Align( 23 | alignment: Alignment.center, 24 | child: Stack( 25 | alignment: Alignment.centerRight, 26 | children: [ 27 | Opacity( 28 | opacity: opacity, 29 | child: ControlledAnimation( 30 | playback: Playback.LOOP, 31 | duration: tween.duration, 32 | tween: tween, 33 | builder: (context, animation) { 34 | return Transform.rotate( 35 | child: PokeBackgroundWidget( 36 | num: 'appbar_pokeballwhite', 37 | width: 48, 38 | height: 48, 39 | ), 40 | angle: animation['rotation'], 41 | ); 42 | }, 43 | ), 44 | ), 45 | IconButton( 46 | icon: Icon(Icons.favorite_border), 47 | onPressed: () {}, 48 | ), 49 | ], 50 | ), 51 | ), 52 | ], 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/image_detail/image_detail_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:pokedex_modular/app/modules/home/components/poke_background/poke_background_widget.dart'; 4 | import 'package:pokedex_modular/app/modules/home/components/poke_image/poke_image_widget.dart'; 5 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 6 | import 'package:simple_animations/simple_animations/controlled_animation.dart'; 7 | import 'package:simple_animations/simple_animations/multi_track_tween.dart'; 8 | 9 | class ImageDetailWidget extends StatelessWidget { 10 | final PageController pageController; 11 | final int index; 12 | final List pokemons; 13 | final Function onPageChanged; 14 | final Function getCurrentPokemon; 15 | final int pokemonLenght; 16 | final double progress; 17 | final double opacity; 18 | final MultiTrackTween tween; 19 | final double paddingTop; 20 | 21 | ImageDetailWidget({ 22 | Key key, 23 | this.index, 24 | this.pokemons, 25 | this.onPageChanged, 26 | this.pokemonLenght, 27 | this.pageController, 28 | this.getCurrentPokemon, 29 | this.progress, 30 | this.opacity, 31 | this.tween, 32 | this.paddingTop, 33 | }) : super(key: key); 34 | @override 35 | Widget build(BuildContext context) { 36 | return Positioned( 37 | child: Opacity( 38 | opacity: opacity, 39 | child: Padding( 40 | padding: EdgeInsets.only(top: paddingTop), 41 | child: SizedBox( 42 | height: 200, 43 | child: PageView.builder( 44 | controller: pageController, 45 | onPageChanged: onPageChanged, 46 | itemCount: pokemonLenght, 47 | itemBuilder: (_, index) { 48 | return Observer(builder: (_) { 49 | var _pokemon = pokemons[index]; 50 | bool currentPosition = _pokemon.id == getCurrentPokemon(); 51 | 52 | return Stack( 53 | alignment: Alignment.center, 54 | children: [ 55 | !currentPosition 56 | ? Container() 57 | : ControlledAnimation( 58 | playback: Playback.LOOP, 59 | duration: tween.duration, 60 | tween: tween, 61 | builder: (context, animation) { 62 | return Transform.rotate( 63 | child: PokeBackgroundWidget( 64 | num: _pokemon.id.toString(), 65 | width: 200, 66 | height: 200, 67 | ), 68 | angle: animation['rotation'], 69 | ); 70 | }, 71 | ), 72 | AnimatedPadding( 73 | duration: Duration(milliseconds: 500), 74 | curve: Curves.bounceInOut, 75 | padding: EdgeInsets.all(currentPosition ? 0 : 60), 76 | child: PokeImageWidget( 77 | num: _pokemon.id.toString(), 78 | width: 160, 79 | height: 160, 80 | currentPosition: currentPosition), 81 | ), 82 | ], 83 | ); 84 | }); 85 | }, 86 | ), 87 | ), 88 | ), 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/poke_detail_header/poke_detail_header_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 3 | import 'package:pokedex_modular/app/shared/utils/utils.dart'; 4 | 5 | class PokeDetailHeaderWidget extends StatelessWidget { 6 | final double positionTop; 7 | final double positionLeft; 8 | final String name; 9 | final double nameFontSize; 10 | final int num; 11 | final List type; 12 | 13 | const PokeDetailHeaderWidget( 14 | {Key key, 15 | this.positionTop, 16 | this.positionLeft, 17 | this.name, 18 | this.nameFontSize, 19 | this.num, 20 | this.type}) 21 | : super(key: key); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Positioned( 26 | top: positionTop, 27 | left: positionLeft, 28 | child: Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | Row( 32 | children: [ 33 | Text( 34 | name, 35 | style: TextStyle( 36 | fontFamily: 'PokemonFont', 37 | fontSize: nameFontSize, 38 | fontWeight: FontWeight.bold, 39 | color: Colors.white), 40 | ), 41 | SizedBox(width: 50), 42 | Text( 43 | '#${num.toString().padLeft(3, '0')}', 44 | textAlign: TextAlign.end, 45 | style: TextStyle( 46 | fontFamily: 'PokemonFont', 47 | fontSize: 26, 48 | fontWeight: FontWeight.bold, 49 | color: Colors.white), 50 | ), 51 | ], 52 | ), 53 | Padding( 54 | padding: const EdgeInsets.only(top: 10), 55 | child: Row( 56 | children: Utils.setTipos( 57 | types: type, 58 | fontsize: 16, 59 | ), 60 | ), 61 | ), 62 | ], 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/power_info_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_widget.dart'; 3 | import 'package:sliding_sheet/sliding_sheet.dart'; 4 | 5 | import '../../../../models/pokemon_model.dart'; 6 | 7 | class PowerInfoWidget extends StatelessWidget { 8 | final Function(SheetState controller) listener; 9 | final Color corPokemon; 10 | final PokemonModel pokemon; 11 | 12 | const PowerInfoWidget({Key key, this.listener, this.corPokemon, this.pokemon}) 13 | : super(key: key); 14 | @override 15 | Widget build(BuildContext context) { 16 | return SlidingSheet( 17 | listener: listener, 18 | elevation: 0, 19 | cornerRadius: 30, 20 | snapSpec: const SnapSpec( 21 | snap: true, 22 | snappings: [0.6, 0.89], 23 | positioning: SnapPositioning.relativeToAvailableSpace, 24 | ), 25 | builder: (context, state) { 26 | return Container( 27 | height: MediaQuery.of(context).size.height - 28 | MediaQuery.of(context).size.height * 0.12, 29 | child: TabsWidget( 30 | corPokemon: corPokemon, 31 | pokemon: pokemon 32 | ), 33 | ); 34 | }, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/about/about_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AboutWidget extends StatelessWidget { 4 | final int height; 5 | final int weight; 6 | final String description; 7 | 8 | const AboutWidget( 9 | {Key key, @required this.height, @required this.weight, this.description}) 10 | : super(key: key); 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | child: Padding( 15 | padding: EdgeInsets.symmetric(horizontal: 30, vertical: 15), 16 | child: Column( 17 | crossAxisAlignment: CrossAxisAlignment.start, 18 | children: [ 19 | Text( 20 | 'Descrição', 21 | style: TextStyle( 22 | fontSize: 16, 23 | fontWeight: FontWeight.bold, 24 | ), 25 | ), 26 | SizedBox( 27 | height: 10, 28 | ), 29 | SizedBox( 30 | height: 70, 31 | child: SingleChildScrollView( 32 | child: Text( 33 | description, 34 | style: TextStyle( 35 | fontSize: 14, 36 | ), 37 | ), 38 | ), 39 | ), 40 | SizedBox( 41 | height: 10, 42 | ), 43 | Text( 44 | 'Biologia', 45 | style: TextStyle( 46 | fontSize: 16, 47 | fontWeight: FontWeight.bold, 48 | ), 49 | ), 50 | SizedBox( 51 | height: 10, 52 | ), 53 | Table( 54 | children: [ 55 | TableRow( 56 | children: [ 57 | Text( 58 | 'Altura', 59 | style: TextStyle( 60 | fontSize: 14, 61 | fontWeight: FontWeight.bold, 62 | color: Colors.black54, 63 | ), 64 | ), 65 | Text( 66 | '${height * 2.54} cm', 67 | style: TextStyle( 68 | fontSize: 14, 69 | color: Colors.black, 70 | ), 71 | ), 72 | ], 73 | ), 74 | TableRow( 75 | children: [ 76 | Text( 77 | 'Peso', 78 | style: TextStyle( 79 | fontSize: 14, 80 | fontWeight: FontWeight.bold, 81 | color: Colors.black54, 82 | ), 83 | ), 84 | Text( 85 | '${(weight / 2.205).toStringAsPrecision(4)} Kg', 86 | style: TextStyle( 87 | fontSize: 14, 88 | color: Colors.black, 89 | ), 90 | ), 91 | ], 92 | ), 93 | ], 94 | ), 95 | ], 96 | ), 97 | ), 98 | ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:mobx/mobx.dart'; 3 | import 'package:pokedex_modular/app/modules/home/models/evolution_chain_model.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 5 | import 'package:pokedex_modular/app/modules/home/services/interfaces/evolution_chain_service_interface.dart'; 6 | import 'package:pokedex_modular/app/modules/home/services/interfaces/pokemon_species_service_interface.dart'; 7 | 8 | import '../../../../../../components/poke_image/poke_image_widget.dart'; 9 | 10 | part 'evolution_controller.g.dart'; 11 | 12 | class EvolutionController = _EvolutionControllerBase with _$EvolutionController; 13 | 14 | abstract class _EvolutionControllerBase with Store { 15 | final IEvolutionChainService _evolutionChainService; 16 | final IPokemonSpeciesService _pokemonSpeciesService; 17 | _EvolutionControllerBase( 18 | this._evolutionChainService, this._pokemonSpeciesService); 19 | @observable 20 | ObservableFuture evolution; 21 | @observable 22 | ObservableFuture> listEvolutions; 23 | @action 24 | get(String url) { 25 | evolution = _evolutionChainService.get(url).asObservable(); 26 | } 27 | 28 | Future getPokemon(String url) async { 29 | return await _pokemonSpeciesService.getByUrl(url); 30 | } 31 | 32 | Future> getEvolucao(List pokemon) async { 33 | List _list = []; 34 | if (pokemon != null && pokemon.length > 0) { 35 | for (var f in pokemon) { 36 | if (f.evolvesTo.length > 0) 37 | _list.addAll(await getEvolucao(f.evolvesTo)); 38 | var p = await getPokemon(f.species.url); 39 | _list.add(p.id); 40 | } 41 | } 42 | 43 | return _list; 44 | } 45 | 46 | Future> getPokemonEvolution(Chain chain) async { 47 | List evolution = List(); 48 | var p = await getPokemon(chain.species.url); 49 | evolution.add(PokeImageWidget( 50 | num: p.id.toString(), 51 | height: 100, 52 | width: 100, 53 | )); 54 | var c = await getEvolucao(chain.evolvesTo) 55 | ..sort(); 56 | for (var item in c) { 57 | evolution.add(PokeImageWidget( 58 | num: item.toString(), 59 | height: 100, 60 | width: 100, 61 | )); 62 | } 63 | return evolution; 64 | } 65 | 66 | @action 67 | setEvolutions(Chain chain) { 68 | listEvolutions = null; 69 | listEvolutions = getPokemonEvolution(chain).asObservable(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'evolution_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // StoreGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 10 | 11 | mixin _$EvolutionController on _EvolutionControllerBase, Store { 12 | final _$evolutionAtom = Atom(name: '_EvolutionControllerBase.evolution'); 13 | 14 | @override 15 | ObservableFuture get evolution { 16 | _$evolutionAtom.context.enforceReadPolicy(_$evolutionAtom); 17 | _$evolutionAtom.reportObserved(); 18 | return super.evolution; 19 | } 20 | 21 | @override 22 | set evolution(ObservableFuture value) { 23 | _$evolutionAtom.context.conditionallyRunInAction(() { 24 | super.evolution = value; 25 | _$evolutionAtom.reportChanged(); 26 | }, _$evolutionAtom, name: '${_$evolutionAtom.name}_set'); 27 | } 28 | 29 | final _$listEvolutionsAtom = 30 | Atom(name: '_EvolutionControllerBase.listEvolutions'); 31 | 32 | @override 33 | ObservableFuture> get listEvolutions { 34 | _$listEvolutionsAtom.context.enforceReadPolicy(_$listEvolutionsAtom); 35 | _$listEvolutionsAtom.reportObserved(); 36 | return super.listEvolutions; 37 | } 38 | 39 | @override 40 | set listEvolutions(ObservableFuture> value) { 41 | _$listEvolutionsAtom.context.conditionallyRunInAction(() { 42 | super.listEvolutions = value; 43 | _$listEvolutionsAtom.reportChanged(); 44 | }, _$listEvolutionsAtom, name: '${_$listEvolutionsAtom.name}_set'); 45 | } 46 | 47 | final _$_EvolutionControllerBaseActionController = 48 | ActionController(name: '_EvolutionControllerBase'); 49 | 50 | @override 51 | dynamic get(String url) { 52 | final _$actionInfo = 53 | _$_EvolutionControllerBaseActionController.startAction(); 54 | try { 55 | return super.get(url); 56 | } finally { 57 | _$_EvolutionControllerBaseActionController.endAction(_$actionInfo); 58 | } 59 | } 60 | 61 | @override 62 | dynamic setEvolutions(Chain chain) { 63 | final _$actionInfo = 64 | _$_EvolutionControllerBaseActionController.startAction(); 65 | try { 66 | return super.setEvolutions(chain); 67 | } finally { 68 | _$_EvolutionControllerBaseActionController.endAction(_$actionInfo); 69 | } 70 | } 71 | 72 | @override 73 | String toString() { 74 | final string = 75 | 'evolution: ${evolution.toString()},listEvolutions: ${listEvolutions.toString()}'; 76 | return '{$string}'; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | import 'package:flutter_mobx/flutter_mobx.dart'; 4 | import 'package:flutter_modular/flutter_modular.dart'; 5 | import 'package:mobx/mobx.dart'; 6 | 7 | import 'package:pokedex_modular/app/modules/home/models/evolution_chain_model.dart'; 8 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller.dart'; 9 | 10 | class EvolutionWidget extends StatefulWidget { 11 | final String url; 12 | final Color corPokemon; 13 | 14 | const EvolutionWidget({ 15 | Key key, 16 | this.url, 17 | this.corPokemon, 18 | }) : super(key: key); 19 | @override 20 | _EvolutionWidgetState createState() => _EvolutionWidgetState(); 21 | } 22 | 23 | class _EvolutionWidgetState 24 | extends ModularState { 25 | @override 26 | Widget build(BuildContext context) { 27 | controller.get(widget.url); 28 | return FutureBuilder( 29 | future: controller.evolution, 30 | builder: (_, snapshot) { 31 | if (snapshot.data == null || !snapshot.hasData) 32 | return CircularProgressIndicator( 33 | valueColor: AlwaysStoppedAnimation(widget.corPokemon), 34 | ); 35 | else { 36 | controller.setEvolutions(snapshot.data.chain); 37 | return Observer(builder: (_) { 38 | if (controller.listEvolutions.status == FutureStatus.pending) 39 | return CircularProgressIndicator( 40 | valueColor: AlwaysStoppedAnimation(widget.corPokemon), 41 | ); 42 | return FutureBuilder>( 43 | future: controller.listEvolutions, 44 | builder: (_, s) { 45 | if (s.data == null || !s.hasData) 46 | return CircularProgressIndicator( 47 | valueColor: AlwaysStoppedAnimation(widget.corPokemon), 48 | ); 49 | return ListView.builder( 50 | itemCount: s.data.length, 51 | scrollDirection: Axis.vertical, 52 | itemBuilder: (_, index) { 53 | return Padding( 54 | padding: const EdgeInsets.all(20), 55 | child: Center( 56 | child: s.data[index], 57 | ), 58 | ); 59 | }, 60 | ); 61 | }, 62 | ); 63 | }); 64 | } 65 | }, 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/status/status_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class StatusWidget extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Center( 7 | child: Text("textFinder"), 8 | ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:mobx/mobx.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/services/interfaces/pokemon_species_service_interface.dart'; 4 | 5 | part 'tabs_controller.g.dart'; 6 | 7 | class TabsController = _TabsControllerBase with _$TabsController; 8 | 9 | abstract class _TabsControllerBase with Store { 10 | final IPokemonSpeciesService _pokemonSpeciesService; 11 | _TabsControllerBase(this._pokemonSpeciesService); 12 | @observable 13 | ObservableFuture pokemon; 14 | 15 | @action 16 | get(int id) { 17 | pokemon = (_pokemonSpeciesService.get(id)).asObservable(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'tabs_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // StoreGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 10 | 11 | mixin _$TabsController on _TabsControllerBase, Store { 12 | final _$pokemonAtom = Atom(name: '_TabsControllerBase.pokemon'); 13 | 14 | @override 15 | ObservableFuture get pokemon { 16 | _$pokemonAtom.context.enforceReadPolicy(_$pokemonAtom); 17 | _$pokemonAtom.reportObserved(); 18 | return super.pokemon; 19 | } 20 | 21 | @override 22 | set pokemon(ObservableFuture value) { 23 | _$pokemonAtom.context.conditionallyRunInAction(() { 24 | super.pokemon = value; 25 | _$pokemonAtom.reportChanged(); 26 | }, _$pokemonAtom, name: '${_$pokemonAtom.name}_set'); 27 | } 28 | 29 | final _$_TabsControllerBaseActionController = 30 | ActionController(name: '_TabsControllerBase'); 31 | 32 | @override 33 | dynamic get(int id) { 34 | final _$actionInfo = _$_TabsControllerBaseActionController.startAction(); 35 | try { 36 | return super.get(id); 37 | } finally { 38 | _$_TabsControllerBaseActionController.endAction(_$actionInfo); 39 | } 40 | } 41 | 42 | @override 43 | String toString() { 44 | final string = 'pokemon: ${pokemon.toString()}'; 45 | return '{$string}'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:md2_tab_indicator/md2_tab_indicator.dart'; 5 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 6 | 7 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/about/about_widget.dart'; 8 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_widget.dart'; 9 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/status/status_widget.dart'; 10 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_controller.dart'; 11 | 12 | import '../../../../../models/pokemon_model.dart'; 13 | 14 | class TabsWidget extends StatefulWidget { 15 | final Color corPokemon; 16 | final PokemonModel pokemon; 17 | 18 | const TabsWidget({ 19 | Key key, 20 | this.corPokemon, 21 | this.pokemon, 22 | }) : super(key: key); 23 | @override 24 | _TabsWidgetState createState() => _TabsWidgetState(); 25 | } 26 | 27 | class _TabsWidgetState extends ModularState 28 | with SingleTickerProviderStateMixin { 29 | TabController _tabController; 30 | 31 | @override 32 | void initState() { 33 | super.initState(); 34 | _tabController = TabController(length: 3, vsync: this); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | controller.get(widget.pokemon.id); 40 | return Scaffold( 41 | appBar: AppBar( 42 | backgroundColor: Colors.white, 43 | bottom: PreferredSize( 44 | preferredSize: Size.fromHeight(40), 45 | child: TabBar( 46 | controller: _tabController, 47 | labelStyle: TextStyle( 48 | fontWeight: FontWeight.w700, 49 | ), 50 | indicatorSize: TabBarIndicatorSize.label, 51 | labelColor: widget.corPokemon, 52 | unselectedLabelColor: Color(0xff5f6368), 53 | indicator: MD2Indicator( 54 | indicatorHeight: 3, 55 | indicatorColor: widget.corPokemon, 56 | indicatorSize: MD2IndicatorSize.normal), 57 | isScrollable: true, 58 | tabs: [ 59 | Tab( 60 | text: 'Sobre', 61 | ), 62 | Tab( 63 | text: 'Evolução', 64 | ), 65 | Tab( 66 | text: 'Status', 67 | ), 68 | ], 69 | ), 70 | ), 71 | ), 72 | body: Observer(builder: (_) { 73 | return FutureBuilder( 74 | future: controller.pokemon, 75 | builder: (context, snapshot) { 76 | if (snapshot.data == null || !snapshot.hasData) 77 | return CircularProgressIndicator( 78 | valueColor: AlwaysStoppedAnimation(widget.corPokemon), 79 | ); 80 | else 81 | return TabBarView( 82 | controller: _tabController, 83 | children: [ 84 | AboutWidget( 85 | weight: widget.pokemon.weight, 86 | height: widget.pokemon.height, 87 | description: snapshot.data.flavorTextEntries 88 | .where((item) => item.language.name == 'en') 89 | .first 90 | .flavorText, 91 | ), 92 | EvolutionWidget( 93 | url: snapshot.data.evolutionChain.url, 94 | corPokemon: widget.corPokemon, 95 | ), 96 | StatusWidget(), 97 | ], 98 | ); 99 | }); 100 | }), 101 | ); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/poke_detail_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/animation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:mobx/mobx.dart'; 6 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 7 | import 'package:pokedex_modular/app/shared/utils/utils.dart'; 8 | import 'package:simple_animations/simple_animations/multi_track_tween.dart'; 9 | import 'package:sliding_sheet/sliding_sheet.dart'; 10 | 11 | part 'poke_detail_controller.g.dart'; 12 | 13 | class PokeDetailController = _PokeDetailControllerBase 14 | with _$PokeDetailController; 15 | 16 | abstract class _PokeDetailControllerBase with Store { 17 | _PokeDetailControllerBase(); 18 | @observable 19 | PokemonModel pokemon = PokemonModel(); 20 | @computed 21 | Species get getMainType => (pokemon == null) 22 | ? null 23 | : pokemon.types.firstWhere((e) => e.slot == 1).type; 24 | @computed 25 | Color get getColorCurrentPokemon => (pokemon == null) 26 | ? Colors.blue 27 | : Utils.getColorType(type: getMainType.name); 28 | @observable 29 | double opacity = 1; 30 | @observable 31 | double opacityTitle = 0; 32 | @observable 33 | double progress = 0; 34 | @observable 35 | double multiple = 1; 36 | @observable 37 | MultiTrackTween tween = MultiTrackTween([ 38 | Track("rotation").add(Duration(seconds: 5), Tween(begin: 0.0, end: 6), 39 | curve: Curves.linear) 40 | ]); 41 | List lstPokemons; 42 | PokemonModel getPokemon({int num}) => 43 | (lstPokemons == null) ? null : lstPokemons[num]; 44 | setListPokemon(List v) => lstPokemons = v; 45 | 46 | @action 47 | setCurrentPokemon({int num}) { 48 | pokemon = getPokemon(num: num); 49 | } 50 | 51 | double interval(double lower, double upper, double progress) { 52 | assert(lower < upper); 53 | if (progress > upper) 54 | return 1; 55 | else if (progress < lower) return 0; 56 | 57 | return ((progress - lower) / (upper - lower)).clamp(0, 1); 58 | } 59 | 60 | @action 61 | listener(SheetState state) { 62 | progress = state.progress; 63 | multiple = 1 - interval(0.6, 0.87, progress); 64 | opacity = multiple; 65 | opacityTitle = multiple = interval(0.6, 0.87, progress); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/poke_detail_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'poke_detail_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // StoreGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic 10 | 11 | mixin _$PokeDetailController on _PokeDetailControllerBase, Store { 12 | Computed _$getMainTypeComputed; 13 | 14 | @override 15 | Species get getMainType => 16 | (_$getMainTypeComputed ??= Computed(() => super.getMainType)) 17 | .value; 18 | Computed _$getColorCurrentPokemonComputed; 19 | 20 | @override 21 | Color get getColorCurrentPokemon => (_$getColorCurrentPokemonComputed ??= 22 | Computed(() => super.getColorCurrentPokemon)) 23 | .value; 24 | 25 | final _$pokemonAtom = Atom(name: '_PokeDetailControllerBase.pokemon'); 26 | 27 | @override 28 | PokemonModel get pokemon { 29 | _$pokemonAtom.context.enforceReadPolicy(_$pokemonAtom); 30 | _$pokemonAtom.reportObserved(); 31 | return super.pokemon; 32 | } 33 | 34 | @override 35 | set pokemon(PokemonModel value) { 36 | _$pokemonAtom.context.conditionallyRunInAction(() { 37 | super.pokemon = value; 38 | _$pokemonAtom.reportChanged(); 39 | }, _$pokemonAtom, name: '${_$pokemonAtom.name}_set'); 40 | } 41 | 42 | final _$opacityAtom = Atom(name: '_PokeDetailControllerBase.opacity'); 43 | 44 | @override 45 | double get opacity { 46 | _$opacityAtom.context.enforceReadPolicy(_$opacityAtom); 47 | _$opacityAtom.reportObserved(); 48 | return super.opacity; 49 | } 50 | 51 | @override 52 | set opacity(double value) { 53 | _$opacityAtom.context.conditionallyRunInAction(() { 54 | super.opacity = value; 55 | _$opacityAtom.reportChanged(); 56 | }, _$opacityAtom, name: '${_$opacityAtom.name}_set'); 57 | } 58 | 59 | final _$opacityTitleAtom = 60 | Atom(name: '_PokeDetailControllerBase.opacityTitle'); 61 | 62 | @override 63 | double get opacityTitle { 64 | _$opacityTitleAtom.context.enforceReadPolicy(_$opacityTitleAtom); 65 | _$opacityTitleAtom.reportObserved(); 66 | return super.opacityTitle; 67 | } 68 | 69 | @override 70 | set opacityTitle(double value) { 71 | _$opacityTitleAtom.context.conditionallyRunInAction(() { 72 | super.opacityTitle = value; 73 | _$opacityTitleAtom.reportChanged(); 74 | }, _$opacityTitleAtom, name: '${_$opacityTitleAtom.name}_set'); 75 | } 76 | 77 | final _$progressAtom = Atom(name: '_PokeDetailControllerBase.progress'); 78 | 79 | @override 80 | double get progress { 81 | _$progressAtom.context.enforceReadPolicy(_$progressAtom); 82 | _$progressAtom.reportObserved(); 83 | return super.progress; 84 | } 85 | 86 | @override 87 | set progress(double value) { 88 | _$progressAtom.context.conditionallyRunInAction(() { 89 | super.progress = value; 90 | _$progressAtom.reportChanged(); 91 | }, _$progressAtom, name: '${_$progressAtom.name}_set'); 92 | } 93 | 94 | final _$multipleAtom = Atom(name: '_PokeDetailControllerBase.multiple'); 95 | 96 | @override 97 | double get multiple { 98 | _$multipleAtom.context.enforceReadPolicy(_$multipleAtom); 99 | _$multipleAtom.reportObserved(); 100 | return super.multiple; 101 | } 102 | 103 | @override 104 | set multiple(double value) { 105 | _$multipleAtom.context.conditionallyRunInAction(() { 106 | super.multiple = value; 107 | _$multipleAtom.reportChanged(); 108 | }, _$multipleAtom, name: '${_$multipleAtom.name}_set'); 109 | } 110 | 111 | final _$tweenAtom = Atom(name: '_PokeDetailControllerBase.tween'); 112 | 113 | @override 114 | MultiTrackTween get tween { 115 | _$tweenAtom.context.enforceReadPolicy(_$tweenAtom); 116 | _$tweenAtom.reportObserved(); 117 | return super.tween; 118 | } 119 | 120 | @override 121 | set tween(MultiTrackTween value) { 122 | _$tweenAtom.context.conditionallyRunInAction(() { 123 | super.tween = value; 124 | _$tweenAtom.reportChanged(); 125 | }, _$tweenAtom, name: '${_$tweenAtom.name}_set'); 126 | } 127 | 128 | final _$_PokeDetailControllerBaseActionController = 129 | ActionController(name: '_PokeDetailControllerBase'); 130 | 131 | @override 132 | dynamic setCurrentPokemon({int num}) { 133 | final _$actionInfo = 134 | _$_PokeDetailControllerBaseActionController.startAction(); 135 | try { 136 | return super.setCurrentPokemon(num: num); 137 | } finally { 138 | _$_PokeDetailControllerBaseActionController.endAction(_$actionInfo); 139 | } 140 | } 141 | 142 | @override 143 | dynamic listener(SheetState state) { 144 | final _$actionInfo = 145 | _$_PokeDetailControllerBaseActionController.startAction(); 146 | try { 147 | return super.listener(state); 148 | } finally { 149 | _$_PokeDetailControllerBaseActionController.endAction(_$actionInfo); 150 | } 151 | } 152 | 153 | @override 154 | String toString() { 155 | final string = 156 | 'pokemon: ${pokemon.toString()},opacity: ${opacity.toString()},opacityTitle: ${opacityTitle.toString()},progress: ${progress.toString()},multiple: ${multiple.toString()},tween: ${tween.toString()},getMainType: ${getMainType.toString()},getColorCurrentPokemon: ${getColorCurrentPokemon.toString()}'; 157 | return '{$string}'; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /lib/app/modules/home/pages/poke_detail/poke_detail_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_mobx/flutter_mobx.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/poke_detail_controller.dart'; 6 | 7 | import 'components/app_bar_detail/app_bar_detail_widget.dart'; 8 | import 'components/poke_detail_header/poke_detail_header_widget.dart'; 9 | import 'components/power_info/power_info_widget.dart'; 10 | import 'components/image_detail/image_detail_widget.dart'; 11 | 12 | class PokeDetailPage extends StatefulWidget { 13 | final String title; 14 | final List lstPokemons; 15 | final int num; 16 | const PokeDetailPage( 17 | {Key key, this.title = "PokeDetail", this.lstPokemons, this.num}) 18 | : super(key: key); 19 | 20 | @override 21 | _PokeDetailPageState createState() => _PokeDetailPageState(); 22 | } 23 | 24 | class _PokeDetailPageState 25 | extends ModularState { 26 | @override 27 | void initState() { 28 | super.initState(); 29 | controller.setListPokemon(widget.lstPokemons); 30 | controller.setCurrentPokemon(num: widget.num); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Observer(builder: (_) { 36 | return Scaffold( 37 | body: Stack( 38 | children: [ 39 | AnimatedContainer( 40 | decoration: BoxDecoration( 41 | gradient: LinearGradient( 42 | begin: Alignment.topCenter, 43 | end: Alignment.bottomCenter, 44 | colors: [ 45 | controller.getColorCurrentPokemon, 46 | controller.getColorCurrentPokemon.withOpacity(0.7), 47 | ], 48 | ), 49 | borderRadius: BorderRadius.all(Radius.circular(20)), 50 | ), 51 | duration: Duration(microseconds: 300), 52 | ), 53 | AppBarDetailWidget( 54 | tween: controller.tween, 55 | opacity: controller.opacityTitle, 56 | ), 57 | PokeDetailHeaderWidget( 58 | positionTop: (MediaQuery.of(context).size.height * 0.12) - 59 | controller.progress * 60 | MediaQuery.of(context).size.height * 61 | 0.06, 62 | positionLeft: 20 + 63 | controller.progress * 64 | MediaQuery.of(context).size.height * 65 | 0.06, 66 | name: controller.pokemon?.name ?? '', 67 | nameFontSize: 30 - 68 | controller.progress * 69 | MediaQuery.of(context).size.height * 70 | 0.011, 71 | num: controller.pokemon?.id, 72 | type: controller.pokemon?.types, 73 | ), 74 | PowerInfoWidget( 75 | listener: controller.listener, 76 | pokemon: controller.pokemon, 77 | corPokemon: controller.getColorCurrentPokemon, 78 | ), 79 | controller.opacityTitle == 1 80 | ? Container() 81 | : ImageDetailWidget( 82 | paddingTop: (MediaQuery.of(context).size.height * 0.25) - 83 | controller.progress * 84 | MediaQuery.of(context).size.height * 85 | 0.1, 86 | tween: controller.tween, 87 | progress: controller.progress, 88 | opacity: controller.opacity, 89 | getCurrentPokemon: () => controller.pokemon?.id, 90 | index: controller.pokemon?.id ?? 1, 91 | pokemons: widget.lstPokemons, 92 | onPageChanged: (int index) => 93 | controller.setCurrentPokemon(num: index), 94 | pokemonLenght: widget.lstPokemons.length, 95 | pageController: PageController( 96 | initialPage: controller.pokemon.id - 1, 97 | viewportFraction: 0.5), 98 | ), 99 | ], 100 | ), 101 | ); 102 | }); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/evolution_chain_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/evolution_chain_model.dart'; 3 | 4 | import '../../../shared/custom_dio/custom_dio.dart'; 5 | import 'interfaces/evolution_chain_repository_interface.dart'; 6 | 7 | class EvolutionChainRepository extends Disposable 8 | implements IEvolutionChainRepository { 9 | final CustomDio _dio; 10 | 11 | EvolutionChainRepository(this._dio); 12 | 13 | @override 14 | void dispose() {} 15 | 16 | @override 17 | Future get(String url) async { 18 | var response = await _dio.client.get(url); 19 | 20 | return EvolutionChain.fromMap(response.data); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/interfaces/evolution_chain_repository_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/evolution_chain_model.dart'; 2 | 3 | abstract class IEvolutionChainRepository { 4 | Future get(String url); 5 | } 6 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/interfaces/pokedex_repository_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/pokedex_model.dart'; 2 | 3 | abstract class IPokedexRepository { 4 | Future get(); 5 | } 6 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/interfaces/pokemon_repository_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 3 | 4 | abstract class IPokemonRepository { 5 | Future getList(); 6 | Future get(int num); 7 | } 8 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/interfaces/pokemon_species_repository_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 2 | 3 | abstract class IPokemonSpeciesRepository { 4 | Future get(int id); 5 | Future getByUrl(String url); 6 | } 7 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/pokedex_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | import 'package:pokedex_modular/app/modules/home/models/pokedex_model.dart'; 5 | import 'package:pokedex_modular/app/shared/custom_dio/custom_dio.dart'; 6 | 7 | import 'interfaces/pokedex_repository_interface.dart'; 8 | 9 | class PokedexRepository extends Disposable implements IPokedexRepository { 10 | final CustomDio _dio; 11 | 12 | PokedexRepository(this._dio); 13 | @override 14 | void dispose() {} 15 | 16 | @override 17 | Future get() async { 18 | //Kanto 19 | var response = await _dio.client.get('/pokedex/2/'); 20 | 21 | var responseJson = json.decode(response.data); 22 | return PokedexModel.fromJson(responseJson); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/pokemon_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 4 | import 'package:pokedex_modular/app/shared/custom_dio/custom_dio.dart'; 5 | 6 | import 'interfaces/pokemon_repository_interface.dart'; 7 | 8 | class PokemonRepository extends Disposable implements IPokemonRepository { 9 | final CustomDio _dio; 10 | 11 | PokemonRepository(this._dio); 12 | @override 13 | void dispose() {} 14 | 15 | @override 16 | Future get(int num) async { 17 | var response = await _dio.client.get('/pokemon/$num/'); 18 | 19 | return PokemonModel.fromJson(response.data); 20 | } 21 | 22 | @override 23 | Future getList() async { 24 | var response = await _dio.client.get('/pokemon?offset=0&limit=151'); 25 | 26 | return ListPokemonModel.fromJson(response.data); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/app/modules/home/repositories/pokemon_species_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 3 | 4 | import '../../../shared/custom_dio/custom_dio.dart'; 5 | import 'interfaces/pokemon_species_repository_interface.dart'; 6 | 7 | class PokemonSpeciesRepository extends Disposable 8 | implements IPokemonSpeciesRepository { 9 | final CustomDio _dio; 10 | 11 | PokemonSpeciesRepository(this._dio); 12 | @override 13 | void dispose() {} 14 | 15 | @override 16 | Future get(int id) async { 17 | var response = await _dio.client.get('/pokemon-species/$id/'); 18 | 19 | return PokemonSpecies.fromMap(response.data); 20 | } 21 | 22 | @override 23 | Future getByUrl(String url) async { 24 | var response = await _dio.client.get(url); 25 | 26 | return PokemonSpecies.fromMap(response.data); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/evolution_chain_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/evolution_chain_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/repositories/interfaces/evolution_chain_repository_interface.dart'; 4 | 5 | import '../../../shared/utils/consts_app.dart'; 6 | import 'interfaces/evolution_chain_service_interface.dart'; 7 | 8 | class EvolutionChainService extends Disposable 9 | implements IEvolutionChainService { 10 | final IEvolutionChainRepository _evolutionChainRepository; 11 | EvolutionChainService(this._evolutionChainRepository); 12 | @override 13 | void dispose() {} 14 | 15 | @override 16 | Future get(String url) { 17 | url = url.replaceAll(Constants.apiUrl, ''); 18 | 19 | return _evolutionChainRepository.get(url); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/interfaces/evolution_chain_service_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/evolution_chain_model.dart'; 2 | 3 | abstract class IEvolutionChainService { 4 | Future get(String url); 5 | } 6 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/interfaces/pokedex_service_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/pokedex_model.dart'; 2 | 3 | abstract class IPokedexService { 4 | Future get(); 5 | } 6 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/interfaces/pokemon_service_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 3 | 4 | abstract class IPokemonService { 5 | Future getList(); 6 | Future get(int num); 7 | } 8 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/interfaces/pokemon_species_service_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 2 | 3 | abstract class IPokemonSpeciesService { 4 | Future get(int id); 5 | Future getByUrl(String url); 6 | } 7 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/pokedex_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokedex_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/repositories/interfaces/pokedex_repository_interface.dart'; 4 | 5 | import 'interfaces/pokedex_service_interface.dart'; 6 | 7 | class PokedexService extends Disposable implements IPokedexService { 8 | final IPokedexRepository _pokdexRepository; 9 | PokedexService(this._pokdexRepository); 10 | @override 11 | void dispose() {} 12 | 13 | @override 14 | Future get() { 15 | return _pokdexRepository.get(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/pokemon_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/models/list_pokemon_model.dart'; 4 | import 'package:pokedex_modular/app/modules/home/repositories/interfaces/pokemon_repository_interface.dart'; 5 | 6 | import 'interfaces/pokemon_service_interface.dart'; 7 | 8 | class PokemonService extends Disposable implements IPokemonService { 9 | final IPokemonRepository _pokemonRepository; 10 | PokemonService(this._pokemonRepository); 11 | @override 12 | void dispose() {} 13 | 14 | @override 15 | Future get(int num) { 16 | return _pokemonRepository.get(num); 17 | } 18 | 19 | @override 20 | Future getList() { 21 | return _pokemonRepository.getList(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/home/services/pokemon_species_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_species_model.dart'; 3 | import 'package:pokedex_modular/app/modules/home/repositories/interfaces/pokemon_species_repository_interface.dart'; 4 | 5 | import '../../../shared/utils/consts_app.dart'; 6 | import 'interfaces/pokemon_species_service_interface.dart'; 7 | 8 | class PokemonSpeciesService extends Disposable 9 | implements IPokemonSpeciesService { 10 | final IPokemonSpeciesRepository _pokemonSpeciesRepository; 11 | PokemonSpeciesService(this._pokemonSpeciesRepository); 12 | @override 13 | void dispose() {} 14 | 15 | @override 16 | Future get(int id) { 17 | return _pokemonSpeciesRepository.get(id); 18 | } 19 | 20 | @override 21 | Future getByUrl(String url) { 22 | url = url.replaceAll(Constants.apiUrl, ''); 23 | 24 | return _pokemonSpeciesRepository.getByUrl(url); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/app/shared/custom_dio/custom_dio.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | import 'interceptor.dart'; 4 | 5 | class CustomDio { 6 | final Dio client; 7 | 8 | CustomDio(this.client) { 9 | client.interceptors.add(CustomInterceptors()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/app/shared/custom_dio/interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | class CustomInterceptors extends InterceptorsWrapper { 4 | @override 5 | Future onRequest(RequestOptions options) async { 6 | print( 7 | 'URL ${options.baseUrl} - Request[${options.method}] => PATH: ${options.path} : '); 8 | if (options.data != null) print(options.data.toJson()); 9 | print('Authorization: ${options.headers['Authorization']}'); 10 | 11 | // TODO: implement onRequest 12 | return super.onRequest(options); 13 | } 14 | 15 | @override 16 | Future onResponse(Response response) { 17 | print('Response[${response.statusCode}] => PATH: ${response.request.path}'); 18 | 19 | // TODO: implement onResponse 20 | return super.onResponse(response); 21 | } 22 | 23 | @override 24 | Future onError(DioError e) async { 25 | // TODO: implement onError 26 | return super.onError(e); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/app/shared/utils/consts_app.dart: -------------------------------------------------------------------------------- 1 | class Constants { 2 | static const whitePokeball = 'assets/images/pokeball.png'; 3 | static const blackPokeball = 'assets/images/pokeball_dark.png'; 4 | static const apiUrl = 'https://pokeapi.co/api/v2/'; 5 | static pokeImgUrl(String num) => 6 | 'https://raw.githubusercontent.com/fanzeyi/pokemon.json/master/images/${num.padLeft(3, '0')}.png'; 7 | } 8 | -------------------------------------------------------------------------------- /lib/app/shared/utils/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/modules/home/models/pokemon_model.dart'; 3 | 4 | class Utils { 5 | static Color getColorType({String type}) { 6 | if (type == null) 7 | return Colors.blue; 8 | else 9 | switch (type) { 10 | case 'normal': 11 | return Colors.brown[400]; 12 | break; 13 | case 'fire': 14 | return Colors.red; 15 | break; 16 | case 'water': 17 | return Colors.blue; 18 | break; 19 | case 'grass': 20 | return Colors.green; 21 | break; 22 | case 'electric': 23 | return Colors.amber; 24 | break; 25 | case 'ice': 26 | return Colors.cyanAccent[400]; 27 | break; 28 | case 'fighting': 29 | return Colors.orange; 30 | break; 31 | case 'poison': 32 | return Colors.purple; 33 | break; 34 | case 'ground': 35 | return Colors.orange[300]; 36 | break; 37 | case 'flying': 38 | return Colors.indigo[200]; 39 | break; 40 | case 'psychic': 41 | return Colors.pink; 42 | break; 43 | case 'bug': 44 | return Colors.lightGreen[500]; 45 | break; 46 | case 'rock': 47 | return Colors.grey; 48 | break; 49 | case 'ghost': 50 | return Colors.indigo[400]; 51 | break; 52 | case 'dark': 53 | return Colors.brown; 54 | break; 55 | case 'dragon': 56 | return Colors.indigo[800]; 57 | break; 58 | case 'steel': 59 | return Colors.blueGrey; 60 | break; 61 | case 'fairy': 62 | return Colors.pinkAccent[100]; 63 | break; 64 | default: 65 | return Colors.grey; 66 | break; 67 | } 68 | } 69 | 70 | static List setTipos({List types, double fontsize = 12}) { 71 | List lista = []; 72 | if (types == null) return lista; 73 | types 74 | ..sort((a, b) => a.slot.compareTo(b.slot)) 75 | ..forEach((t) { 76 | lista.add( 77 | Container( 78 | margin: EdgeInsets.only(bottom: 5, left: 8), 79 | padding: EdgeInsets.all(0), 80 | decoration: BoxDecoration( 81 | borderRadius: BorderRadius.circular(20), 82 | color: Color.fromARGB(80, 255, 255, 255)), 83 | child: Padding( 84 | padding: const EdgeInsets.all(6.0), 85 | child: Text( 86 | t.type.name.trim(), 87 | style: TextStyle( 88 | fontFamily: 'PokemonFont', 89 | fontSize: fontsize, 90 | fontWeight: FontWeight.bold, 91 | color: Colors.white), 92 | ), 93 | ), 94 | ), 95 | ); 96 | }); 97 | 98 | return lista; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:pokedex_modular/app/app_module.dart'; 3 | import 'package:flutter_modular/flutter_modular.dart'; 4 | 5 | void main() => runApp(ModularApp(module: AppModule())); 6 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.39.5" 18 | archive: 19 | dependency: transitive 20 | description: 21 | name: archive 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.0.11" 25 | args: 26 | dependency: transitive 27 | description: 28 | name: args 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.5.2" 32 | async: 33 | dependency: transitive 34 | description: 35 | name: async 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.4.0" 39 | boolean_selector: 40 | dependency: transitive 41 | description: 42 | name: boolean_selector 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.0.5" 46 | build: 47 | dependency: transitive 48 | description: 49 | name: build 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.2.2" 53 | build_config: 54 | dependency: transitive 55 | description: 56 | name: build_config 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.4.2" 60 | build_daemon: 61 | dependency: transitive 62 | description: 63 | name: build_daemon 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.4" 67 | build_resolvers: 68 | dependency: transitive 69 | description: 70 | name: build_resolvers 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.3.3" 74 | build_runner: 75 | dependency: "direct dev" 76 | description: 77 | name: build_runner 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.8.1" 81 | build_runner_core: 82 | dependency: transitive 83 | description: 84 | name: build_runner_core 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "5.0.0" 88 | built_collection: 89 | dependency: transitive 90 | description: 91 | name: built_collection 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "4.3.2" 95 | built_value: 96 | dependency: transitive 97 | description: 98 | name: built_value 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "7.0.9" 102 | cached_network_image: 103 | dependency: "direct main" 104 | description: 105 | name: cached_network_image 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "2.0.0" 109 | charcode: 110 | dependency: transitive 111 | description: 112 | name: charcode 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.1.2" 116 | checked_yaml: 117 | dependency: transitive 118 | description: 119 | name: checked_yaml 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.0.2" 123 | code_builder: 124 | dependency: transitive 125 | description: 126 | name: code_builder 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "3.2.1" 130 | collection: 131 | dependency: transitive 132 | description: 133 | name: collection 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.14.11" 137 | convert: 138 | dependency: transitive 139 | description: 140 | name: convert 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "2.1.1" 144 | crypto: 145 | dependency: transitive 146 | description: 147 | name: crypto 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "2.1.3" 151 | csslib: 152 | dependency: transitive 153 | description: 154 | name: csslib 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "0.16.1" 158 | dart_style: 159 | dependency: transitive 160 | description: 161 | name: dart_style 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "1.3.3" 165 | dio: 166 | dependency: "direct main" 167 | description: 168 | name: dio 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "3.0.9" 172 | fixnum: 173 | dependency: transitive 174 | description: 175 | name: fixnum 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "0.10.11" 179 | flutter: 180 | dependency: "direct main" 181 | description: flutter 182 | source: sdk 183 | version: "0.0.0" 184 | flutter_cache_manager: 185 | dependency: transitive 186 | description: 187 | name: flutter_cache_manager 188 | url: "https://pub.dartlang.org" 189 | source: hosted 190 | version: "1.1.3" 191 | flutter_mobx: 192 | dependency: "direct main" 193 | description: 194 | name: flutter_mobx 195 | url: "https://pub.dartlang.org" 196 | source: hosted 197 | version: "1.1.0" 198 | flutter_modular: 199 | dependency: "direct main" 200 | description: 201 | name: flutter_modular 202 | url: "https://pub.dartlang.org" 203 | source: hosted 204 | version: "1.0.0" 205 | flutter_staggered_animations: 206 | dependency: "direct main" 207 | description: 208 | name: flutter_staggered_animations 209 | url: "https://pub.dartlang.org" 210 | source: hosted 211 | version: "0.1.2" 212 | flutter_test: 213 | dependency: "direct dev" 214 | description: flutter 215 | source: sdk 216 | version: "0.0.0" 217 | glob: 218 | dependency: transitive 219 | description: 220 | name: glob 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "1.2.0" 224 | graphs: 225 | dependency: transitive 226 | description: 227 | name: graphs 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "0.2.0" 231 | html: 232 | dependency: transitive 233 | description: 234 | name: html 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "0.14.0+3" 238 | http: 239 | dependency: transitive 240 | description: 241 | name: http 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "0.12.0+4" 245 | http_multi_server: 246 | dependency: transitive 247 | description: 248 | name: http_multi_server 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "2.2.0" 252 | http_parser: 253 | dependency: transitive 254 | description: 255 | name: http_parser 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "3.1.4" 259 | image: 260 | dependency: transitive 261 | description: 262 | name: image 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "2.1.4" 266 | io: 267 | dependency: transitive 268 | description: 269 | name: io 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "0.3.4" 273 | js: 274 | dependency: transitive 275 | description: 276 | name: js 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "0.6.1+1" 280 | json_annotation: 281 | dependency: transitive 282 | description: 283 | name: json_annotation 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "3.0.1" 287 | logging: 288 | dependency: transitive 289 | description: 290 | name: logging 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "0.11.4" 294 | matcher: 295 | dependency: transitive 296 | description: 297 | name: matcher 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "0.12.6" 301 | md2_tab_indicator: 302 | dependency: "direct main" 303 | description: 304 | name: md2_tab_indicator 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "1.0.2" 308 | meta: 309 | dependency: transitive 310 | description: 311 | name: meta 312 | url: "https://pub.dartlang.org" 313 | source: hosted 314 | version: "1.1.8" 315 | mime: 316 | dependency: transitive 317 | description: 318 | name: mime 319 | url: "https://pub.dartlang.org" 320 | source: hosted 321 | version: "0.9.6+3" 322 | mobx: 323 | dependency: "direct main" 324 | description: 325 | name: mobx 326 | url: "https://pub.dartlang.org" 327 | source: hosted 328 | version: "1.1.1" 329 | mobx_codegen: 330 | dependency: "direct dev" 331 | description: 332 | name: mobx_codegen 333 | url: "https://pub.dartlang.org" 334 | source: hosted 335 | version: "1.0.3" 336 | mockito: 337 | dependency: "direct dev" 338 | description: 339 | name: mockito 340 | url: "https://pub.dartlang.org" 341 | source: hosted 342 | version: "4.1.1" 343 | node_interop: 344 | dependency: transitive 345 | description: 346 | name: node_interop 347 | url: "https://pub.dartlang.org" 348 | source: hosted 349 | version: "1.0.3" 350 | node_io: 351 | dependency: transitive 352 | description: 353 | name: node_io 354 | url: "https://pub.dartlang.org" 355 | source: hosted 356 | version: "1.0.1+2" 357 | package_config: 358 | dependency: transitive 359 | description: 360 | name: package_config 361 | url: "https://pub.dartlang.org" 362 | source: hosted 363 | version: "1.9.3" 364 | package_resolver: 365 | dependency: transitive 366 | description: 367 | name: package_resolver 368 | url: "https://pub.dartlang.org" 369 | source: hosted 370 | version: "1.0.10" 371 | path: 372 | dependency: transitive 373 | description: 374 | name: path 375 | url: "https://pub.dartlang.org" 376 | source: hosted 377 | version: "1.6.4" 378 | path_provider: 379 | dependency: transitive 380 | description: 381 | name: path_provider 382 | url: "https://pub.dartlang.org" 383 | source: hosted 384 | version: "1.6.5" 385 | path_provider_macos: 386 | dependency: transitive 387 | description: 388 | name: path_provider_macos 389 | url: "https://pub.dartlang.org" 390 | source: hosted 391 | version: "0.0.4" 392 | path_provider_platform_interface: 393 | dependency: transitive 394 | description: 395 | name: path_provider_platform_interface 396 | url: "https://pub.dartlang.org" 397 | source: hosted 398 | version: "1.0.1" 399 | pedantic: 400 | dependency: transitive 401 | description: 402 | name: pedantic 403 | url: "https://pub.dartlang.org" 404 | source: hosted 405 | version: "1.8.0+1" 406 | petitparser: 407 | dependency: transitive 408 | description: 409 | name: petitparser 410 | url: "https://pub.dartlang.org" 411 | source: hosted 412 | version: "2.4.0" 413 | platform: 414 | dependency: transitive 415 | description: 416 | name: platform 417 | url: "https://pub.dartlang.org" 418 | source: hosted 419 | version: "2.2.1" 420 | plugin_platform_interface: 421 | dependency: transitive 422 | description: 423 | name: plugin_platform_interface 424 | url: "https://pub.dartlang.org" 425 | source: hosted 426 | version: "1.0.2" 427 | pool: 428 | dependency: transitive 429 | description: 430 | name: pool 431 | url: "https://pub.dartlang.org" 432 | source: hosted 433 | version: "1.4.0" 434 | pub_semver: 435 | dependency: transitive 436 | description: 437 | name: pub_semver 438 | url: "https://pub.dartlang.org" 439 | source: hosted 440 | version: "1.4.4" 441 | pubspec_parse: 442 | dependency: transitive 443 | description: 444 | name: pubspec_parse 445 | url: "https://pub.dartlang.org" 446 | source: hosted 447 | version: "0.1.5" 448 | quiver: 449 | dependency: transitive 450 | description: 451 | name: quiver 452 | url: "https://pub.dartlang.org" 453 | source: hosted 454 | version: "2.0.5" 455 | shelf: 456 | dependency: transitive 457 | description: 458 | name: shelf 459 | url: "https://pub.dartlang.org" 460 | source: hosted 461 | version: "0.7.5" 462 | shelf_web_socket: 463 | dependency: transitive 464 | description: 465 | name: shelf_web_socket 466 | url: "https://pub.dartlang.org" 467 | source: hosted 468 | version: "0.2.3" 469 | simple_animations: 470 | dependency: "direct main" 471 | description: 472 | name: simple_animations 473 | url: "https://pub.dartlang.org" 474 | source: hosted 475 | version: "1.3.11" 476 | sky_engine: 477 | dependency: transitive 478 | description: flutter 479 | source: sdk 480 | version: "0.0.99" 481 | sliding_sheet: 482 | dependency: "direct main" 483 | description: 484 | name: sliding_sheet 485 | url: "https://pub.dartlang.org" 486 | source: hosted 487 | version: "0.3.1" 488 | source_gen: 489 | dependency: transitive 490 | description: 491 | name: source_gen 492 | url: "https://pub.dartlang.org" 493 | source: hosted 494 | version: "0.9.5" 495 | source_span: 496 | dependency: transitive 497 | description: 498 | name: source_span 499 | url: "https://pub.dartlang.org" 500 | source: hosted 501 | version: "1.5.5" 502 | sqflite: 503 | dependency: transitive 504 | description: 505 | name: sqflite 506 | url: "https://pub.dartlang.org" 507 | source: hosted 508 | version: "1.3.0" 509 | sqflite_common: 510 | dependency: transitive 511 | description: 512 | name: sqflite_common 513 | url: "https://pub.dartlang.org" 514 | source: hosted 515 | version: "1.0.0+1" 516 | stack_trace: 517 | dependency: transitive 518 | description: 519 | name: stack_trace 520 | url: "https://pub.dartlang.org" 521 | source: hosted 522 | version: "1.9.3" 523 | stream_channel: 524 | dependency: transitive 525 | description: 526 | name: stream_channel 527 | url: "https://pub.dartlang.org" 528 | source: hosted 529 | version: "2.0.0" 530 | stream_transform: 531 | dependency: transitive 532 | description: 533 | name: stream_transform 534 | url: "https://pub.dartlang.org" 535 | source: hosted 536 | version: "1.2.0" 537 | string_scanner: 538 | dependency: transitive 539 | description: 540 | name: string_scanner 541 | url: "https://pub.dartlang.org" 542 | source: hosted 543 | version: "1.0.5" 544 | synchronized: 545 | dependency: transitive 546 | description: 547 | name: synchronized 548 | url: "https://pub.dartlang.org" 549 | source: hosted 550 | version: "2.2.0" 551 | term_glyph: 552 | dependency: transitive 553 | description: 554 | name: term_glyph 555 | url: "https://pub.dartlang.org" 556 | source: hosted 557 | version: "1.1.0" 558 | test_api: 559 | dependency: transitive 560 | description: 561 | name: test_api 562 | url: "https://pub.dartlang.org" 563 | source: hosted 564 | version: "0.2.11" 565 | timing: 566 | dependency: transitive 567 | description: 568 | name: timing 569 | url: "https://pub.dartlang.org" 570 | source: hosted 571 | version: "0.1.1+2" 572 | typed_data: 573 | dependency: transitive 574 | description: 575 | name: typed_data 576 | url: "https://pub.dartlang.org" 577 | source: hosted 578 | version: "1.1.6" 579 | uuid: 580 | dependency: transitive 581 | description: 582 | name: uuid 583 | url: "https://pub.dartlang.org" 584 | source: hosted 585 | version: "2.0.4" 586 | vector_math: 587 | dependency: transitive 588 | description: 589 | name: vector_math 590 | url: "https://pub.dartlang.org" 591 | source: hosted 592 | version: "2.0.8" 593 | watcher: 594 | dependency: transitive 595 | description: 596 | name: watcher 597 | url: "https://pub.dartlang.org" 598 | source: hosted 599 | version: "0.9.7+14" 600 | web_socket_channel: 601 | dependency: transitive 602 | description: 603 | name: web_socket_channel 604 | url: "https://pub.dartlang.org" 605 | source: hosted 606 | version: "1.1.0" 607 | xml: 608 | dependency: transitive 609 | description: 610 | name: xml 611 | url: "https://pub.dartlang.org" 612 | source: hosted 613 | version: "3.5.0" 614 | yaml: 615 | dependency: transitive 616 | description: 617 | name: yaml 618 | url: "https://pub.dartlang.org" 619 | source: hosted 620 | version: "2.2.0" 621 | sdks: 622 | dart: ">=2.7.0 <3.0.0" 623 | flutter: ">=1.10.15-pre.148 <2.0.0" 624 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: pokedex_modular 2 | description: "A new Flutter project. Created by Slidy" 3 | 4 | publish_to: "none" 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.7.0 <3.0.0" 10 | 11 | dependencies: 12 | cached_network_image: ^2.0.0 13 | md2_tab_indicator: ^1.0.2 14 | flutter_staggered_animations: ^0.1.2 15 | sliding_sheet: ^0.3.1 16 | simple_animations: ^1.3.11 17 | dio: ^3.0.9 18 | flutter_mobx: ^1.1.0 19 | mobx: ^1.1.1 20 | flutter_modular: ^1.0.0 21 | flutter: 22 | sdk: flutter 23 | 24 | dev_dependencies: 25 | mockito: ^4.1.1 26 | mobx_codegen: ^1.0.3 27 | build_runner: ^1.8.1 28 | flutter_test: 29 | sdk: flutter 30 | 31 | flutter: 32 | uses-material-design: true 33 | 34 | assets: 35 | - assets/images/pokeball_dark.png 36 | - assets/images/pokeball.png 37 | 38 | fonts: 39 | - family: PokemonFont 40 | fonts: 41 | - asset: assets/fonts/ProductSans-Regular.ttf 42 | - asset: assets/fonts/ProductSans-Bold.ttf 43 | weight: 700 44 | 45 | scripts: 46 | build: flutter pub run build_runner build --delete-conflicting-outputs 47 | clean: flutter pub run build_runner clean 48 | watch: flutter pub run build_runner watch --delete-conflicting-outputs -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/app_bar_detail/app_bar_detail_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/app_bar_detail/app_bar_detail_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('AppBarDetailWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(AppBarDetailWidget())); 10 | // final textFinder = find.text('AppBarDetail'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/image_detail/image_detail_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/image_detail/image_detail_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('ImageDetailWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(ImageDetailWidget())); 10 | // final textFinder = find.text('ImageDetail'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/poke_detail_header/poke_detail_header_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/poke_detail_header/poke_detail_header_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('PokeDetailHeaderWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(PokeDetailHeaderWidget())); 10 | // final textFinder = find.text('PokeDetailHeader'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular_test.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_controller.dart'; 5 | import 'package:pokedex_modular/app/modules/home/home_module.dart'; 6 | 7 | void main() { 8 | initModule(HomeModule()); 9 | // TabsController tabs; 10 | // 11 | setUp(() { 12 | // tabs = HomeModule.to.get(); 13 | }); 14 | 15 | group('TabsController Test', () { 16 | // test("First Test", () { 17 | // expect(tabs, isInstanceOf()); 18 | // }); 19 | 20 | // test("Set Value", () { 21 | // expect(tabs.value, equals(0)); 22 | // tabs.increment(); 23 | // expect(tabs.value, equals(1)); 24 | // }); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/poower_info/tabs/tabs_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('TabsWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(TabsWidget())); 10 | // final textFinder = find.text('Tabs'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/about/about_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/about/about_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('AboutWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(AboutWidget())); 10 | // final textFinder = find.text('About'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/power_info_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/power_info_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('PowerInfoWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(PowerInfoWidget())); 10 | // final textFinder = find.text('PowerInfo'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular_test.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_controller.dart'; 5 | import 'package:pokedex_modular/app/modules/home/home_module.dart'; 6 | 7 | void main() { 8 | initModule(HomeModule()); 9 | // EvolutionController evolution; 10 | // 11 | setUp(() { 12 | // evolution = HomeModule.to.get(); 13 | }); 14 | 15 | group('EvolutionController Test', () { 16 | // test("First Test", () { 17 | // expect(evolution, isInstanceOf()); 18 | // }); 19 | 20 | // test("Set Value", () { 21 | // expect(evolution.value, equals(0)); 22 | // evolution.increment(); 23 | // expect(evolution.value, equals(1)); 24 | // }); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/evolution/evolution_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('EvolutionWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(EvolutionWidget())); 10 | // final textFinder = find.text('Evolution'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/tabs/status/status_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/status/status_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('StatusWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(StatusWidget())); 10 | // final textFinder = find.text('Status'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs/tabs_widget.dart'; 6 | 7 | main() { 8 | // testWidgets('TabsWidget has message', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(TabsWidget())); 10 | // final textFinder = find.text('Tabs'); 11 | // expect(textFinder, findsOneWidget); 12 | // }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/components/power_info/tabs_controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular_test.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/components/power_info/tabs_controller.dart'; 5 | import 'package:pokedex_modular/app/modules/home/home_module.dart'; 6 | 7 | void main() { 8 | initModule(HomeModule()); 9 | // TabsController tabs; 10 | // 11 | setUp(() { 12 | // tabs = HomeModule.to.get(); 13 | }); 14 | 15 | group('TabsController Test', () { 16 | // test("First Test", () { 17 | // expect(tabs, isInstanceOf()); 18 | // }); 19 | 20 | // test("Set Value", () { 21 | // expect(tabs.value, equals(0)); 22 | // tabs.increment(); 23 | // expect(tabs.value, equals(1)); 24 | // }); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/poke_detail_controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_modular/flutter_modular_test.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/poke_detail_controller.dart'; 5 | import 'package:pokedex_modular/app/modules/home/home_module.dart'; 6 | 7 | void main() { 8 | initModule(HomeModule()); 9 | // PokeDetailController pokedetail; 10 | // 11 | setUp(() { 12 | // pokedetail = HomeModule.to.get(); 13 | }); 14 | 15 | group('PokeDetailController Test', () { 16 | // test("First Test", () { 17 | // expect(pokedetail, isInstanceOf()); 18 | // }); 19 | 20 | // test("Set Value", () { 21 | // expect(pokedetail.value, equals(0)); 22 | // pokedetail.increment(); 23 | // expect(pokedetail.value, equals(1)); 24 | // }); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /test/app/modules/home/pages/poke_detail/poke_detail_page_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_modular/flutter_modular_test.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/pages/poke_detail/poke_detail_page.dart'; 6 | 7 | main() { 8 | testWidgets('PokeDetailPage has title', (WidgetTester tester) async { 9 | // await tester.pumpWidget(buildTestableWidget(PokeDetailPage(title: 'PokeDetail'))); 10 | // final titleFinder = find.text('PokeDetail'); 11 | // expect(titleFinder, findsOneWidget); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /test/app/modules/home/repositories/evolution_chain_repository_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:mockito/mockito.dart'; 3 | import 'package:dio/dio.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/repositories/evolution_chain_repository.dart'; 6 | 7 | class MockClient extends Mock implements Dio {} 8 | 9 | void main() { 10 | EvolutionChainRepository repository; 11 | // MockClient client; 12 | 13 | setUp(() { 14 | // repository = EvolutionChainRepository(); 15 | // client = MockClient(); 16 | }); 17 | 18 | group('EvolutionChainRepository Test', () { 19 | // test("First Test", () { 20 | // expect(repository, isInstanceOf()); 21 | // }); 22 | 23 | test('returns a Post if the http call completes successfully', () async { 24 | // when(client.get('https://jsonplaceholder.typicode.com/posts/1')) 25 | // .thenAnswer((_) async => 26 | // Response(data: {'title': 'Test'}, statusCode: 200)); 27 | // Map data = await repository.fetchPost(client); 28 | // expect(data['title'], 'Test'); 29 | }); 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /test/app/modules/home/repositories/evolution_chain_service_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | import 'package:pokedex_modular/app/modules/home/repositories/evolution_chain_service.dart'; 4 | 5 | void main() { 6 | EvolutionChainService service; 7 | 8 | setUp(() { 9 | // service = EvolutionChainService(); 10 | }); 11 | // 12 | group('EvolutionChainService Test', () { 13 | // test("First Test", () { 14 | // expect(service, isInstanceOf()); 15 | // }); 16 | // 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /test/app/modules/home/repositories/pokemon_species_repository_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:mockito/mockito.dart'; 3 | import 'package:dio/dio.dart'; 4 | 5 | import 'package:pokedex_modular/app/modules/home/repositories/pokemon_species_repository.dart'; 6 | 7 | class MockClient extends Mock implements Dio {} 8 | 9 | void main() { 10 | PokemonSpeciesRepository repository; 11 | // MockClient client; 12 | 13 | setUp(() { 14 | // repository = PokemonSpeciesRepository(); 15 | // client = MockClient(); 16 | }); 17 | 18 | group('PokemonSpeciesRepository Test', () { 19 | // test("First Test", () { 20 | // expect(repository, isInstanceOf()); 21 | // }); 22 | 23 | test('returns a Post if the http call completes successfully', () async { 24 | // when(client.get('https://jsonplaceholder.typicode.com/posts/1')) 25 | // .thenAnswer((_) async => 26 | // Response(data: {'title': 'Test'}, statusCode: 200)); 27 | // Map data = await repository.fetchPost(client); 28 | // expect(data['title'], 'Test'); 29 | }); 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /test/app/modules/home/services/evolution_chain_service_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | import 'package:pokedex_modular/app/modules/home/services/evolution_chain_service.dart'; 4 | 5 | void main() { 6 | EvolutionChainService service; 7 | 8 | setUp(() { 9 | // service = EvolutionChainService(); 10 | }); 11 | // 12 | group('EvolutionChainService Test', () { 13 | // test("First Test", () { 14 | // expect(service, isInstanceOf()); 15 | // }); 16 | // 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /test/app/modules/home/services/pokemon_species_service_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | import 'package:pokedex_modular/app/modules/home/services/pokemon_species_service.dart'; 4 | 5 | void main() { 6 | PokemonSpeciesService service; 7 | 8 | setUp(() { 9 | // service = PokemonSpeciesService(); 10 | }); 11 | // 12 | group('PokemonSpeciesService Test', () { 13 | // test("First Test", () { 14 | // expect(service, isInstanceOf()); 15 | // }); 16 | // 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterPokedex/cbc512d9dd0c31468fa3a77b3fc39c4565d37c36/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | pokedex_modular 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pokedex_modular", 3 | "short_name": "pokedex_modular", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "'A new Flutter project. Created by Slidy'", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------