├── .github └── ISSUE_TEMPLATE │ ├── petici-n-de-ejemplo.md │ └── propuesta-de-ejemplo.md ├── .gitignore ├── .travis.yml ├── AUTHORS ├── LICENSE ├── README.md ├── built_value ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── builtvalue │ │ │ │ └── MainActivity.java │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── built_value.iml ├── built_value_android.iml ├── images │ └── built_value.gif ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── 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 │ │ └── main.m ├── lib │ ├── main.dart │ ├── quote.dart │ ├── quote.g.dart │ ├── serializers.dart │ └── serializers.g.dart └── pubspec.yaml ├── cookbook └── usando_themes │ ├── .gitignore │ ├── .metadata │ ├── README.md │ ├── android │ ├── .gitignore │ ├── .project │ ├── app │ │ ├── .classpath │ │ ├── .project │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── usandothemes │ │ │ │ └── MainActivity.java │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ ├── dir.txt │ ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── 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 │ │ └── main.m │ ├── lib │ └── main.dart │ ├── pubspec.yaml │ ├── usando_themes.iml │ └── usando_themes_android.iml ├── flutter_switching_widgets ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── vegacode │ │ │ │ └── flutterswitchingwidgets │ │ │ │ └── MainActivity.java │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── flutter_switching_widgets.iml ├── flutter_switching_widgets_android.iml ├── images │ └── moverse_entre_ widgets.gif ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── 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 │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── flutter_whatsapp ├── .gitignore ├── .metadata ├── .vscode │ └── launch.json ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutterwhatsapp │ │ │ │ └── MainActivity.java │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── camera_dart.png ├── emulator ├── flutter_whatsapp.iml ├── flutter_whatsapp_android.iml ├── images │ └── clone_whatsapp.gif ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── 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 │ │ └── main.m ├── lib │ ├── CustomCircleAvatar.dart │ ├── main.dart │ ├── models │ │ ├── call_model.dart │ │ ├── chat_model.dart │ │ └── status_model.dart │ ├── pages │ │ ├── call_screen.dart │ │ ├── camera_screen.dart │ │ ├── chat_screen.dart │ │ └── status_screen.dart │ └── whatsapp_home.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── todoapp-mvp ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── flutteres │ │ │ │ └── todomvp │ │ │ │ └── MainActivity.java │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── 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 │ ├── main.dart │ └── src │ │ ├── app.dart │ │ ├── data │ │ ├── repository │ │ │ ├── local │ │ │ │ └── repository.dart │ │ │ ├── repository.dart │ │ │ └── source.dart │ │ └── task.dart │ │ ├── db │ │ ├── const.dart │ │ └── db.dart │ │ ├── presenter.dart │ │ ├── taskdetail │ │ ├── contract.dart │ │ ├── presenter.dart │ │ └── view.dart │ │ ├── tasklist │ │ ├── contract.dart │ │ ├── presenter.dart │ │ ├── view.dart │ │ └── widgets │ │ │ ├── taskaddeddialog.dart │ │ │ └── taskwidget.dart │ │ └── view.dart ├── pubspec.yaml ├── res │ └── values │ │ └── strings_en.arb ├── test │ └── widget_test.dart ├── todomvp.iml └── todomvp_android.iml └── travis_script.sh /.github/ISSUE_TEMPLATE/petici-n-de-ejemplo.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Petición de ejemplo 3 | about: Para declarar un ejemplo que sería deseable tener en el repo 4 | 5 | --- 6 | 7 | Descripción (Descripción del ejemplo que se requiere, bibliotecas a usar, patrón de diseño , etc. según proceda. 8 | 9 | > Notas: (cualquier aclaración que se quiera hacer, urls externas, etc) 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/propuesta-de-ejemplo.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Propuesta de ejemplo 3 | about: Para declarar la intención de subir un ejemplo 4 | 5 | --- 6 | 7 | # Título (En una frase corta en que consistirá el ejemplo) 8 | 9 | Descripción (Descripción larga de lo que el ejemplo va a demostrar, bibliotecas que usa, patrón de diseño , etc. según proceda. 10 | 11 | #### Carpeta: (nombre de la carpeta que se usará, ej. todo-app-mvc-pattern 12 | > Notas: (cualquier aclaración que se quiera hacer, urls externas, etc) 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .buildlog 2 | .DS_Store 3 | .idea 4 | .pub/ 5 | .settings/ 6 | build/ 7 | packages 8 | .packages 9 | pubspec.lock 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: 2 | - linux 3 | sudo: false 4 | addons: 5 | apt: 6 | sources: 7 | - ubuntu-toolchain-r-test 8 | packages: 9 | - libstdc++6 10 | - fonts-droid 11 | git: 12 | depth: 3 13 | env: 14 | - FLUTTER_VERSION=dev 15 | before_script: 16 | - git clone https://github.com/flutter/flutter.git -b $FLUTTER_VERSION 17 | - ./flutter/bin/flutter doctor 18 | - chmod +x travis_script.sh 19 | script: 20 | - ./travis_script.sh 21 | cache: 22 | directories: 23 | - $HOME/shared/.pub-cache 24 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Below is a list of people and organizations that have contributed 2 | # to the project. Names should be added to the list like so: 3 | # 4 | # Name/Organization 5 | 6 | Google Inc. 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ejemplos de Flutter 2 | 3 | [![Build Status](https://travis-ci.org/flutter-es/ejemplos.svg?branch=master)](https://travis-ci.org/flutter-es/ejemplos) 4 | 5 | Una colección de ejemplos de código para 6 | [Flutter](https://flutter-es.io). 7 | 8 | ## Contenido del repositorio 9 | 10 | En la carpeta cookbook están los ejemplos de la sección cookbook de la documentación 11 | [Cookbook](https://flutter-es.io/cookbook). 12 | 13 | El resto de carpetas, cada una contiene un ejemplo particular, ver los readme de cada uno para más información. 14 | 15 | 23 | 24 | ## ¿Interesado en contribuir? 25 | 26 | Si quieres contribuir con un nuevo ejemplo a este repositorio, por favor 27 | mira primero las [guías de estilo Dart](https://www.dartlang.org/guides/language/effective-dart/style). 28 | 29 | Para subir un ejemplo deberás crear un PR, para ello, crea una rama nueva donde trabajar tu ejemplo dentro de una carpeta nombrada convenientemente, y envia luego tu [pull request](https://github.com/flutter-es/ejemplos/pulls). 30 | 31 | Todo PR requiere revisión por al menos 1 miembro. 32 | 33 | ### Condiciones mínimas para aceptar un ejemplo. 34 | 35 | * Incluye un fichero README.md que contenga al menos, un título, y una descripción corta. 36 | * El código debe estar comentando, al menos aquellas partes que sean el objeto de demostración del ejemplo. 37 | 38 | ### Condiciones deseables para un ejemplo. 39 | 40 | * Una descripción detallada del funcionamiento del ejemplo , mótivos de su realización, arquitectura que usa, o cualquier cosa que sea conventiente explicar para el mejor entendimiento del ejemplo. 41 | * Pruebas unitarias. 42 | * Captura de pantalla o gif animado , ver como [crear gif de tu app](https://github.com/flutter/flutter/wiki/Making-animated-GIFs-of-Flutter-apps) 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /built_value/.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: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b 8 | channel: beta 9 | -------------------------------------------------------------------------------- /built_value/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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "com.example.builtvalue" 27 | minSdkVersion 16 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /built_value/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /built_value/android/app/src/main/java/com/example/builtvalue/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.builtvalue; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /built_value/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /built_value/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /built_value/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /built_value/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /built_value/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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /built_value/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 | -------------------------------------------------------------------------------- /built_value/built_value.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /built_value/built_value_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /built_value/images/built_value.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/images/built_value.gif -------------------------------------------------------------------------------- /built_value/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /built_value/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /built_value/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /built_value/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /built_value/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /built_value/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /built_value/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /built_value/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 | -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /built_value/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/built_value/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /built_value/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. -------------------------------------------------------------------------------- /built_value/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 | -------------------------------------------------------------------------------- /built_value/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 | -------------------------------------------------------------------------------- /built_value/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | built_value 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 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 | -------------------------------------------------------------------------------- /built_value/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /built_value/lib/quote.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert' as json; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'serializers.dart'; 5 | 6 | part 'quote.g.dart'; 7 | 8 | 9 | // Esta es la forma de crear el boilerplate para ejecuta el comando que genera el código 10 | // que termina con .g.dart 11 | abstract class Quote implements Built { 12 | static Serializer get serializer => _$quoteSerializer; 13 | 14 | //Estos campos son los que utilizan crean para pasar de el json que regresa el API a un objeto Quote 15 | String get id; 16 | @BuiltValueField(wireName: 'icon_url') 17 | String get iconUrl; 18 | String get url; 19 | String get value; 20 | 21 | Quote._(); 22 | factory Quote([updates(QuoteBuilder b)]) = _$Quote; 23 | } 24 | 25 | // En este metodo se toma la cadena que regresa la API y se regresa un objeto tipo Quote. 26 | Quote parseQuote(String jsonString){ 27 | final parsed = json.jsonDecode(jsonString); 28 | Quote quote = standardSerializers.deserializeWith(Quote.serializer, parsed); 29 | return quote; 30 | } -------------------------------------------------------------------------------- /built_value/lib/serializers.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details. 2 | // All rights reserved. Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | library serializers; 6 | 7 | import 'package:built_value/serializer.dart'; 8 | import 'package:built_value/standard_json_plugin.dart'; 9 | import 'quote.dart'; 10 | 11 | part 'serializers.g.dart'; 12 | 13 | /// Ejemplo de como utilizar serializacion con built_value 14 | /// 15 | /// Declara el nivel mayor de campos [Serializers] llamados serializers. Anotalo 16 | /// con [SerializersFor] y provee un `const` `List` de tipos que deseas serializar 17 | /// 18 | /// el generador de codigo build_value podra proveer la implementación. este 19 | /// contendra los serializadores para todos los tipos preguntados para aumentar 20 | /// explicitamente todos los tipos necesitados transitivamente a través de los campos 21 | /// 22 | /// Usualmente solo necesitaras hacer uno por proyecto. 23 | // Solo de agrego Quote todo lo demas es parte del documento de ejemplo de David morgan tiene de ejemplo 24 | // en su documentación. 25 | @SerializersFor(const [ 26 | Quote 27 | ]) 28 | Serializers serializers = _$serializers; 29 | 30 | // Serializer no utiliza un decodificador regular de JSON por lo que es importante hacer uso de 31 | // standard_json_plugin.dart el cual es importado al inicio del documento. 32 | Serializers standardSerializers = 33 | (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); -------------------------------------------------------------------------------- /built_value/lib/serializers.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of serializers; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: always_put_control_body_on_new_line 10 | // ignore_for_file: annotate_overrides 11 | // ignore_for_file: avoid_annotating_with_dynamic 12 | // ignore_for_file: avoid_catches_without_on_clauses 13 | // ignore_for_file: avoid_returning_this 14 | // ignore_for_file: lines_longer_than_80_chars 15 | // ignore_for_file: omit_local_variable_types 16 | // ignore_for_file: prefer_expression_function_bodies 17 | // ignore_for_file: sort_constructors_first 18 | // ignore_for_file: unnecessary_const 19 | // ignore_for_file: unnecessary_new 20 | // ignore_for_file: test_types_in_equals 21 | 22 | Serializers _$serializers = 23 | (new Serializers().toBuilder()..add(Quote.serializer)).build(); 24 | -------------------------------------------------------------------------------- /built_value/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chucknorris 2 | description: Muestra como funciona built value en Flutter. 3 | 4 | enviroment: 5 | sdk: ">=2.0.0-dev <3.0.0" 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | 11 | built_collection: '>=2.0.0 <4.0.0' 12 | built_value: '>=5.5.5 <7.0.0' 13 | 14 | cupertino_icons: ^0.1.2 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | build_runner: '>=0.9.0 <0.11.0' 21 | built_value_generator: ^6.1.2 22 | 23 | flutter: 24 | 25 | uses-material-design: true 26 | 27 | # To add assets to your application, add an assets section, like this: 28 | # assets: 29 | # - images/a_dot_burr.jpeg 30 | # - images/a_dot_ham.jpeg 31 | 32 | # An image asset can refer to one or more resolution-specific "variants", see 33 | # https://flutter.io/assets-and-images/#resolution-aware. 34 | 35 | # For details regarding adding assets from package dependencies, see 36 | # https://flutter.io/assets-and-images/#from-packages 37 | 38 | # To add custom fonts to your application, add a fonts section here, 39 | # in this "flutter" section. Each entry in this list should have a 40 | # "family" key with the font family name, and a "fonts" key with a 41 | # list giving the asset and other descriptors for the font. For 42 | # example: 43 | # fonts: 44 | # - family: Schyler 45 | # fonts: 46 | # - asset: fonts/Schyler-Regular.ttf 47 | # - asset: fonts/Schyler-Italic.ttf 48 | # style: italic 49 | # - family: Trajan Pro 50 | # fonts: 51 | # - asset: fonts/TrajanPro.ttf 52 | # - asset: fonts/TrajanPro_Bold.ttf 53 | # weight: 700 54 | # 55 | # For details regarding fonts from package dependencies, 56 | # see https://flutter.io/custom-fonts/#from-packages 57 | -------------------------------------------------------------------------------- /cookbook/usando_themes/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /cookbook/usando_themes/.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: 392a178169a9e620a5ae8e55c40d4276cddd3b36 8 | channel: master 9 | -------------------------------------------------------------------------------- /cookbook/usando_themes/README.md: -------------------------------------------------------------------------------- 1 | # usando_themes 2 | 3 | Ejemplo de uso de themes 4 | 5 | Ver receta en 6 | [Usar Themes para compartir colores y estilos de fuente](https://flutter-es.io/cookbook/design/themes/). 7 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /cookbook/usando_themes/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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.usandothemes" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/java/com/example/usandothemes/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.usandothemes; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /cookbook/usando_themes/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /cookbook/usando_themes/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /cookbook/usando_themes/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-4.4-all.zip 7 | -------------------------------------------------------------------------------- /cookbook/usando_themes/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 | -------------------------------------------------------------------------------- /cookbook/usando_themes/dir.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/dir.txt -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/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 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/cookbook/usando_themes/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /cookbook/usando_themes/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. -------------------------------------------------------------------------------- /cookbook/usando_themes/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 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | usando_themes 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 | -------------------------------------------------------------------------------- /cookbook/usando_themes/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /cookbook/usando_themes/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | void main() { 5 | runApp(MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | final appName = 'Themes Personalizados'; 12 | 13 | return MaterialApp( 14 | title: appName, 15 | theme: ThemeData( 16 | brightness: Brightness.dark, 17 | primaryColor: Colors.lightBlue[800], 18 | accentColor: Colors.cyan[600], 19 | ), 20 | home: MyHomePage( 21 | title: appName, 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class MyHomePage extends StatelessWidget { 28 | final String title; 29 | 30 | MyHomePage({Key key, @required this.title}) : super(key: key); 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Scaffold( 35 | appBar: AppBar( 36 | title: Text(title), 37 | ), 38 | body: Center( 39 | child: Container( 40 | color: Theme.of(context).accentColor, 41 | child: Text( 42 | 'Text con un color de fondo', 43 | style: Theme.of(context).textTheme.title, 44 | ), 45 | ), 46 | ), 47 | floatingActionButton: Theme( 48 | data: Theme.of(context).copyWith(accentColor: Colors.yellow), 49 | child: FloatingActionButton( 50 | onPressed: null, 51 | child: Icon(Icons.add), 52 | ), 53 | ), 54 | ); 55 | } 56 | } -------------------------------------------------------------------------------- /cookbook/usando_themes/usando_themes.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cookbook/usando_themes/usando_themes_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /flutter_switching_widgets/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /flutter_switching_widgets/.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: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b 8 | channel: beta 9 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /flutter_switching_widgets/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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "com.vegacode.flutterswitchingwidgets" 27 | minSdkVersion 16 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/java/com/vegacode/flutterswitchingwidgets/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.vegacode.flutterswitchingwidgets; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_switching_widgets/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /flutter_switching_widgets/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /flutter_switching_widgets/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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /flutter_switching_widgets/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 | -------------------------------------------------------------------------------- /flutter_switching_widgets/flutter_switching_widgets.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /flutter_switching_widgets/flutter_switching_widgets_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /flutter_switching_widgets/images/moverse_entre_ widgets.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/images/moverse_entre_ widgets.gif -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/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 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_switching_widgets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter_switching_widgets/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. -------------------------------------------------------------------------------- /flutter_switching_widgets/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 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_switching_widgets 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 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 | -------------------------------------------------------------------------------- /flutter_switching_widgets/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /flutter_switching_widgets/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_switching_widgets 2 | description: En esta app de ejemplo se verá la sincronización de los diferentes widgets que permiten seleccionar y desplegar imágenes bajadas de la red. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | 8 | # The following adds the Cupertino Icons font to your application. 9 | # Use with the CupertinoIcons class for iOS style icons. 10 | cupertino_icons: ^0.1.2 11 | 12 | dev_dependencies: 13 | flutter_test: 14 | sdk: flutter 15 | 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://www.dartlang.org/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | 23 | # The following line ensures that the Material Icons font is 24 | # included with your application, so that you can use the icons in 25 | # the material Icons class. 26 | uses-material-design: true 27 | 28 | # To add assets to your application, add an assets section, like this: 29 | # assets: 30 | # - images/a_dot_burr.jpeg 31 | # - images/a_dot_ham.jpeg 32 | 33 | # An image asset can refer to one or more resolution-specific "variants", see 34 | # https://flutter.io/assets-and-images/#resolution-aware. 35 | 36 | # For details regarding adding assets from package dependencies, see 37 | # https://flutter.io/assets-and-images/#from-packages 38 | 39 | # To add custom fonts to your application, add a fonts section here, 40 | # in this "flutter" section. Each entry in this list should have a 41 | # "family" key with the font family name, and a "fonts" key with a 42 | # list giving the asset and other descriptors for the font. For 43 | # example: 44 | # fonts: 45 | # - family: Schyler 46 | # fonts: 47 | # - asset: fonts/Schyler-Regular.ttf 48 | # - asset: fonts/Schyler-Italic.ttf 49 | # style: italic 50 | # - family: Trajan Pro 51 | # fonts: 52 | # - asset: fonts/TrajanPro.ttf 53 | # - asset: fonts/TrajanPro_Bold.ttf 54 | # weight: 700 55 | # 56 | # For details regarding fonts from package dependencies, 57 | # see https://flutter.io/custom-fonts/#from-packages 58 | -------------------------------------------------------------------------------- /flutter_switching_widgets/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | 11 | void main() { 12 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 13 | // Build our app and trigger a frame. 14 | await tester.pumpWidget(new MaterialApp()); 15 | 16 | // Verify that our counter starts at 0. 17 | expect(find.text('0'), findsOneWidget); 18 | expect(find.text('1'), findsNothing); 19 | 20 | // Tap the '+' icon and trigger a frame. 21 | await tester.tap(find.byIcon(Icons.add)); 22 | await tester.pump(); 23 | 24 | // Verify that our counter has incremented. 25 | expect(find.text('0'), findsNothing); 26 | expect(find.text('1'), findsOneWidget); 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /flutter_whatsapp/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /flutter_whatsapp/.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: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b 8 | channel: beta 9 | -------------------------------------------------------------------------------- /flutter_whatsapp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense para saber los atributos posibles. 3 | // Mantenga el puntero para ver las descripciones de los existentes atributos 4 | // Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Flutter", 9 | "request": "launch", 10 | "type": "dart" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /flutter_whatsapp/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /flutter_whatsapp/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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "com.example.flutterwhatsapp" 27 | minSdkVersion 21 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/java/com/example/flutterwhatsapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flutterwhatsapp; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_whatsapp/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /flutter_whatsapp/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /flutter_whatsapp/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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /flutter_whatsapp/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 | -------------------------------------------------------------------------------- /flutter_whatsapp/camera_dart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/camera_dart.png -------------------------------------------------------------------------------- /flutter_whatsapp/emulator: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/emulator -------------------------------------------------------------------------------- /flutter_whatsapp/flutter_whatsapp.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /flutter_whatsapp/flutter_whatsapp_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /flutter_whatsapp/images/clone_whatsapp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/images/clone_whatsapp.gif -------------------------------------------------------------------------------- /flutter_whatsapp/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/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 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/flutter_whatsapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter_whatsapp/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. -------------------------------------------------------------------------------- /flutter_whatsapp/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 | -------------------------------------------------------------------------------- /flutter_whatsapp/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 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_whatsapp 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 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 | -------------------------------------------------------------------------------- /flutter_whatsapp/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/CustomCircleAvatar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomCircleAvatar extends StatefulWidget { 4 | final NetworkImage myImage; 5 | final String initials; 6 | 7 | CustomCircleAvatar({this.myImage, this.initials}); 8 | 9 | @override 10 | _CustomCircleAvatarState createState() => new _CustomCircleAvatarState(); 11 | } 12 | 13 | class _CustomCircleAvatarState extends State 14 | with AutomaticKeepAliveClientMixin { 15 | bool _checkLoading = true; 16 | 17 | @override 18 | bool get wantKeepAlive => true; 19 | 20 | @override 21 | void initState() { 22 | widget.myImage.resolve(new ImageConfiguration()).addListener((_, __) { 23 | if (mounted) { 24 | setState(() { 25 | _checkLoading = false; 26 | }); 27 | } 28 | }); 29 | super.initState(); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | super.build(context); 35 | 36 | // ? new CircleAvatar(child: new Text(widget.initials)) 37 | 38 | return _checkLoading == true 39 | ? Text(widget.initials) 40 | : CircleAvatar( 41 | backgroundImage: widget.myImage, 42 | foregroundColor: new Color(0xff25D366), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_whatsapp/whatsapp_home.dart'; 5 | import 'package:camera/camera.dart'; 6 | 7 | List cameras; 8 | 9 | Future main() async { 10 | cameras = await availableCameras(); 11 | runApp(new MyApp()); 12 | } 13 | 14 | class MyApp extends StatelessWidget { 15 | // This widget is the root of your application. 16 | @override 17 | Widget build(BuildContext context) { 18 | return new MaterialApp( 19 | title: 'Flutter WhatsApp', 20 | theme: new ThemeData( 21 | primaryColor: new Color(0xff075E54), 22 | accentColor: new Color(0xff25D366), 23 | ), 24 | debugShowCheckedModeBanner: false, 25 | home: new WhatsAppHome(cameras), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/models/call_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CallsModel { 4 | final String name; 5 | final String message; 6 | final String time; 7 | final IconData icono; 8 | final NetworkImage netImg; 9 | 10 | const CallsModel({this.name, this.message, this.time, this.icono, this.netImg}); 11 | } 12 | 13 | const dummyDataCall = [ 14 | const CallsModel( 15 | name: "Sully Rojas", 16 | message: "(3) 10 de septiembre", 17 | time: "08:04 AM", 18 | icono: Icons.video_call, 19 | netImg: NetworkImage( 20 | "https://randomuser.me/api/portraits/women/3.jpg")), 21 | const CallsModel( 22 | name: "Sully Rojas", 23 | message: "7 de septiembre", 24 | time: "10:30 AM", 25 | icono: Icons.video_call, 26 | netImg: NetworkImage( 27 | "https://randomuser.me/api/portraits/women/3.jpg")), 28 | const CallsModel( 29 | name: "Sully Rojas", 30 | message: "27 de agosto", 31 | time: "10:19 AM", 32 | icono: Icons.phone, 33 | netImg: NetworkImage( 34 | "https://randomuser.me/api/portraits/women/3.jpg")), 35 | const CallsModel( 36 | name: "Mario Sabato", 37 | message: "20 de agosto", 38 | time: "09:45 PM", 39 | icono: Icons.phone, 40 | netImg: NetworkImage( 41 | "https://randomuser.me/api/portraits/men/27.jpg")), 42 | const CallsModel( 43 | name: "Pedro Avila", 44 | message: "15 de agosto", 45 | time: "12:20 PM", 46 | icono: Icons.phone, 47 | netImg: NetworkImage( 48 | "https://randomuser.me/api/portraits/men/10.jpg")), 49 | const CallsModel( 50 | name: "Antonio Palmar", 51 | message: "11 de agosto", 52 | time: "13:50 PM", 53 | icono: Icons.phone, 54 | netImg: NetworkImage( 55 | "https://randomuser.me/api/portraits/men/16.jpg")), 56 | const CallsModel( 57 | name: "David Murcia", 58 | message: "(2) 5 de agosto", 59 | time: "11:05 AM", 60 | icono: Icons.phone, 61 | netImg: NetworkImage( 62 | "https://randomuser.me/api/portraits/men/15.jpg")), 63 | ]; 64 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/models/chat_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ChatModel { 4 | final String name; 5 | final String message; 6 | final String time; 7 | final NetworkImage netImg; 8 | 9 | const ChatModel({this.name, this.message, this.time, this.netImg}); 10 | } 11 | 12 | const dummyDataChat = [ 13 | const ChatModel( 14 | name: "César Vega", 15 | message: "Hola Flutter, eres asombroso!", 16 | time: "08:00", 17 | netImg: NetworkImage( 18 | "https://randomuser.me/api/portraits/men/36.jpg")), 19 | const ChatModel( 20 | name: "Sully Rojas", 21 | message: "Hola César, ¿Vienes hoy?", 22 | time: "08:30", 23 | netImg: NetworkImage( 24 | "https://randomuser.me/api/portraits/women/3.jpg")), 25 | const ChatModel( 26 | name: "Mario Sabato", 27 | message: "Hola César, ¿Vas el sábado a la fiesta?", 28 | time: "09:45", 29 | netImg: NetworkImage( 30 | "https://randomuser.me/api/portraits/men/27.jpg")), 31 | const ChatModel( 32 | name: "Pedro Avila", 33 | message: "¿Con hambre? Lunch?", 34 | time: "12:20", 35 | netImg: NetworkImage( 36 | "https://randomuser.me/api/portraits/men/10.jpg")), 37 | const ChatModel( 38 | name: "Antonio Palmar", 39 | message: "Hola Cesar! Tiempos sin convesar!", 40 | time: "13:50", 41 | netImg: NetworkImage( 42 | "https://randomuser.me/api/portraits/men/16.jpg")), 43 | const ChatModel( 44 | name: "David Murcia", 45 | message: "Hey Cesar, Necesito tu ayuda con un programa!", 46 | time: "15:10", 47 | netImg: NetworkImage( 48 | "https://randomuser.me/api/portraits/men/15.jpg")), 49 | ]; 50 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/models/status_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class StatusModel { 4 | final String name; 5 | final String message; 6 | final String time; 7 | final NetworkImage netImg; 8 | 9 | const StatusModel({this.name, this.message, this.time, this.netImg}); 10 | } 11 | 12 | const dummyData = [ 13 | const StatusModel( 14 | name: "Mi estado", 15 | message: "Hoy", 16 | time: "08:00 AM", 17 | netImg: NetworkImage("https://randomuser.me/api/portraits/lego/8.jpg")), 18 | const StatusModel( 19 | name: "Sully Rojas", 20 | message: "Hoy", 21 | time: "08:30 AM", 22 | netImg: NetworkImage("https://randomuser.me/api/portraits/lego/3.jpg")), 23 | const StatusModel( 24 | name: "Mario Sabato", 25 | message: "Hoy", 26 | time: "09:45 PM", 27 | netImg: NetworkImage("https://randomuser.me/api/portraits/lego/7.jpg")), 28 | const StatusModel( 29 | name: "Pedro Avila", 30 | message: "Hoy", 31 | time: "12:20 AM", 32 | netImg: NetworkImage("https://randomuser.me/api/portraits/lego/9.jpg")), 33 | const StatusModel( 34 | name: "Antonio Palmar", 35 | message: "Hoy", 36 | time: "13:50", 37 | netImg: NetworkImage("https://randomuser.me/api/portraits/lego/2.jpg")), 38 | const StatusModel( 39 | name: "David Murcia", 40 | message: "Hoy", 41 | time: "15:10", 42 | netImg: NetworkImage("https://randomuser.me/api/portraits/lego/4.jpg")), 43 | ]; 44 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/pages/camera_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:camera/camera.dart'; 3 | 4 | class CameraScreen extends StatefulWidget { 5 | 6 | final List cameras; 7 | 8 | CameraScreen(this.cameras); 9 | 10 | @override 11 | CameraScreenState createState() { 12 | return new CameraScreenState(); 13 | } 14 | } 15 | 16 | class CameraScreenState extends State { 17 | CameraController controller; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | controller = 23 | new CameraController(widget.cameras[0], ResolutionPreset.medium); 24 | controller.initialize().then((_) { 25 | if (!mounted) { 26 | return; 27 | } 28 | setState(() {}); 29 | }); 30 | } 31 | 32 | @override 33 | void dispose() { 34 | controller?.dispose(); 35 | super.dispose(); 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | if (!controller.value.isInitialized) { 41 | return new Container(); 42 | } 43 | return new AspectRatio( 44 | aspectRatio: controller.value.aspectRatio, 45 | child: new CameraPreview(controller), 46 | ); 47 | } 48 | } -------------------------------------------------------------------------------- /flutter_whatsapp/lib/pages/chat_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_whatsapp/models/chat_model.dart'; 3 | 4 | class ChatScreen extends StatefulWidget { 5 | @override 6 | _ChatScreenState createState() => _ChatScreenState(); 7 | } 8 | 9 | class _ChatScreenState extends State 10 | with AutomaticKeepAliveClientMixin { 11 | @override 12 | bool get wantKeepAlive => true; 13 | 14 | @override 15 | void initState() { 16 | super.initState(); 17 | } 18 | 19 | @override 20 | void dispose() { 21 | super.dispose(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | super.build(context); 27 | 28 | return Container( 29 | child: ListView.builder( 30 | itemCount: dummyDataChat.length, 31 | itemBuilder: (context, i) => Column( 32 | children: [ 33 | Divider( 34 | height: 10.0, 35 | ), 36 | ListTile( 37 | leading: Container( 38 | height: 50.0, 39 | width: 50.0, 40 | child: CircleAvatar( 41 | //child: Text("Loading"), 42 | backgroundImage: dummyDataChat[i].netImg, 43 | ), 44 | ), 45 | title: Row( 46 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 47 | children: [ 48 | Text( 49 | dummyDataChat[i].name, 50 | style: TextStyle(fontWeight: FontWeight.bold), 51 | ), 52 | Text( 53 | dummyDataChat[i].time, 54 | style: TextStyle(color: Colors.grey, fontSize: 14.0), 55 | ), 56 | ], 57 | ), 58 | subtitle: Container( 59 | padding: const EdgeInsets.only(top: 5.0), 60 | child: Text( 61 | dummyDataChat[i].message, 62 | style: TextStyle(color: Colors.grey, fontSize: 15.0), 63 | ), 64 | ), 65 | ) 66 | ], 67 | ), 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/pages/status_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_whatsapp/models/status_model.dart'; 3 | import 'package:flutter_whatsapp/CustomCircleAvatar.dart'; 4 | 5 | class StatusScreen extends StatefulWidget { 6 | @override 7 | _StatusScreenState createState() => _StatusScreenState(); 8 | } 9 | 10 | class _StatusScreenState extends State 11 | with AutomaticKeepAliveClientMixin { 12 | @override 13 | bool get wantKeepAlive => true; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | } 19 | 20 | @override 21 | void dispose() { 22 | super.dispose(); 23 | } 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | super.build(context); 28 | 29 | return Container( 30 | child: ListView.builder( 31 | itemCount: dummyData.length, 32 | itemBuilder: (context, i) => Column( 33 | children: [ 34 | Divider( 35 | height: 12.0, 36 | ), 37 | ListTile( 38 | leading: Container( 39 | height: 70.0, 40 | width: 70.0, 41 | child: CustomCircleAvatar( 42 | initials: "Loading", 43 | myImage: dummyData[i].netImg, 44 | ), 45 | ), 46 | title: Row( 47 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 48 | children: [ 49 | Text( 50 | dummyData[i].name, 51 | style: TextStyle(fontWeight: FontWeight.bold), 52 | ), 53 | ], 54 | ), 55 | subtitle: Container( 56 | padding: const EdgeInsets.only(top: 5.0), 57 | child: Row(children: [ 58 | Text( 59 | dummyData[i].message, 60 | style: 61 | new TextStyle(color: Colors.grey, fontSize: 18.0), 62 | ), 63 | Text( 64 | dummyData[i].time, 65 | style: TextStyle(color: Colors.grey, fontSize: 17.0), 66 | ), 67 | ]), 68 | ), 69 | ) 70 | ], 71 | ), 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /flutter_whatsapp/lib/whatsapp_home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_whatsapp/pages/call_screen.dart'; 3 | import 'package:flutter_whatsapp/pages/camera_screen.dart'; 4 | import 'package:flutter_whatsapp/pages/chat_screen.dart'; 5 | import 'package:flutter_whatsapp/pages/status_screen.dart'; 6 | 7 | class WhatsAppHome extends StatefulWidget { 8 | final cameras; 9 | WhatsAppHome(this.cameras); 10 | 11 | @override 12 | State createState() { 13 | return new WhatsAppHomeState(); 14 | } 15 | } 16 | 17 | class WhatsAppHomeState extends State 18 | with SingleTickerProviderStateMixin { 19 | TabController _tabController; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _tabController = new TabController(vsync: this, length: 4); 25 | } 26 | 27 | @override 28 | void dispose() { 29 | _tabController.dispose(); 30 | super.dispose(); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Scaffold( 36 | appBar: AppBar( 37 | title: Text("WhatsApp"), 38 | elevation: 0.7, 39 | bottom: TabBar( 40 | controller: _tabController, 41 | indicatorColor: Colors.white, 42 | tabs: [ 43 | Tab(icon: new Icon(Icons.camera_alt)), 44 | Tab(text: "CHATS"), 45 | Tab( 46 | text: "ESTADOS", 47 | ), 48 | Tab( 49 | text: "LLAMADAS", 50 | ), 51 | ], 52 | ), 53 | actions: [ 54 | Icon(Icons.search), 55 | Padding( 56 | padding: const EdgeInsets.symmetric(horizontal: 5.0), 57 | ), 58 | Icon(Icons.more_vert) 59 | ], 60 | ), 61 | body: TabBarView( 62 | controller: _tabController, 63 | children: [ 64 | CameraScreen(widget.cameras), 65 | ChatScreen(), 66 | StatusScreen(), 67 | CallScreen(), 68 | ], 69 | ), 70 | floatingActionButton: FloatingActionButton( 71 | backgroundColor: Theme.of(context).accentColor, 72 | child: Icon(Icons.message), 73 | onPressed: () => print("open chats"), 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /flutter_whatsapp/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_whatsapp 2 | description: A new Flutter project. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | 8 | # The following adds the Cupertino Icons font to your application. 9 | # Use with the CupertinoIcons class for iOS style icons. 10 | cupertino_icons: ^0.1.2 11 | camera: 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | 18 | # For information on the generic Dart part of this file, see the 19 | # following page: https://www.dartlang.org/tools/pub/pubspec 20 | 21 | # The following section is specific to Flutter. 22 | flutter: 23 | 24 | # The following line ensures that the Material Icons font is 25 | # included with your application, so that you can use the icons in 26 | # the material Icons class. 27 | uses-material-design: true 28 | 29 | # To add assets to your application, add an assets section, like this: 30 | # assets: 31 | # - images/a_dot_burr.jpeg 32 | # - images/a_dot_ham.jpeg 33 | 34 | # An image asset can refer to one or more resolution-specific "variants", see 35 | # https://flutter.io/assets-and-images/#resolution-aware. 36 | 37 | # For details regarding adding assets from package dependencies, see 38 | # https://flutter.io/assets-and-images/#from-packages 39 | 40 | # To add custom fonts to your application, add a fonts section here, 41 | # in this "flutter" section. Each entry in this list should have a 42 | # "family" key with the font family name, and a "fonts" key with a 43 | # list giving the asset and other descriptors for the font. For 44 | # example: 45 | # fonts: 46 | # - family: Schyler 47 | # fonts: 48 | # - asset: fonts/Schyler-Regular.ttf 49 | # - asset: fonts/Schyler-Italic.ttf 50 | # style: italic 51 | # - family: Trajan Pro 52 | # fonts: 53 | # - asset: fonts/TrajanPro.ttf 54 | # - asset: fonts/TrajanPro_Bold.ttf 55 | # weight: 700 56 | # 57 | # For details regarding fonts from package dependencies, 58 | # see https://flutter.io/custom-fonts/#from-packages 59 | -------------------------------------------------------------------------------- /flutter_whatsapp/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:flutter_whatsapp/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new MyApp()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /todoapp-mvp/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | 11 | *.swp 12 | -------------------------------------------------------------------------------- /todoapp-mvp/.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: 9299c02cf708497d6f72edda8efae0bb8340660e 8 | channel: beta 9 | -------------------------------------------------------------------------------- /todoapp-mvp/README.md: -------------------------------------------------------------------------------- 1 | # Todoapp-mvp 2 | 3 | Esta aplicación le permitirá a los nuevos desarrolladores de flutter, aprender como implementar el patrón de diseño MVP(modelo vista presentador) en sus aplicaciones. 4 | 5 | ## Que es MVP? 6 | 7 | Es una derivación del patrón de diseño [MVC](https://es.wikipedia.org/wiki/Modelo%E2%80%93vista%E2%80%93controlador), liberado por google para permitirle a los desarrolladores de aplicaciones android poder crear aplicaciones escalables y de fácil mantenimiento. 8 | 9 | ### Vista 10 | 11 | Es la encargada de renderizar los gráficos de la aplicación, e.j: diálogos, iconos, etc. 12 | 13 | ### Presentador 14 | 15 | Es el puente que conecta la vista con el modelo. Se va a encargar de obtener los datos del modelo y mostrarlos en la vista. 16 | 17 | ### Modelo 18 | 19 | Es una interfaz que define los datos que van a ser mostrados al usuario 20 | 21 | ## Requerimientos 22 | 23 | * [sqflite](https://github.com/tekartik/sqflite) 24 | -------------------------------------------------------------------------------- /todoapp-mvp/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /todoapp-mvp/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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.flutteres.todomvp" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/java/com/flutteres/todomvp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.flutteres.todomvp; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /todoapp-mvp/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /todoapp-mvp/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /todoapp-mvp/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /todoapp-mvp/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /todoapp-mvp/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-4.4-all.zip 7 | -------------------------------------------------------------------------------- /todoapp-mvp/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 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /todoapp-mvp/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: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/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 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-es/ejemplos/7128947e47549aa0cc95d2d5b22a99500cc8861d/todoapp-mvp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /todoapp-mvp/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. -------------------------------------------------------------------------------- /todoapp-mvp/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 | -------------------------------------------------------------------------------- /todoapp-mvp/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 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | todomvp 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 | -------------------------------------------------------------------------------- /todoapp-mvp/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /todoapp-mvp/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import './src/app.dart'; 4 | 5 | void main() => runApp(new Application()); 6 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import './tasklist/view.dart'; 4 | 5 | class Application extends StatelessWidget { 6 | Application({Key key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | title: 'todoapp-mvp', 12 | theme: ThemeData( 13 | primarySwatch: Colors.indigo, 14 | scaffoldBackgroundColor: Colors.white), 15 | home: TaskList(appBarTitle: 'todoapp-mvp')); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/data/repository/local/repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:sqflite/sqflite.dart'; 2 | 3 | import '../../task.dart'; 4 | import '../../../db/const.dart'; 5 | import '../source.dart'; 6 | 7 | 8 | /// El [LocalRepository] es el modelo local, el cual, 9 | /// va a ejecutar querys a la base de datos local. 10 | class LocalRepository implements DataSource { 11 | Database database; 12 | 13 | @override 14 | void deleteAllTasks(VoidCallback onSuccess, OnErrorCallback onError) { 15 | this 16 | .database 17 | .execute('DELETE FROM ${DatabaseConstants.TABLE_NAME}') 18 | .then((_) { 19 | onSuccess(); 20 | }).catchError((err) { 21 | onError(err); 22 | }); 23 | } 24 | 25 | @override 26 | void getTask(OnLoadTask onLoadTask, OnErrorCallback onError) {} 27 | 28 | @override 29 | void getTasks(OnLoadTasks onLoadTasks, OnErrorCallback onError) { 30 | this 31 | .database 32 | .query('${DatabaseConstants.TABLE_NAME};') 33 | .then((List> tasksMap) { 34 | List tasks = List(); 35 | for (Map tmpTask in tasksMap) { 36 | tasks.add(Task.fromJson(tmpTask)); 37 | } 38 | 39 | if (tasks.length > 0) 40 | onLoadTasks(tasks); 41 | else 42 | onError(''); 43 | }).catchError((err) { 44 | onError(err); 45 | }); 46 | } 47 | 48 | @override 49 | void deleteTask(Task task, VoidCallback onSuccess, OnErrorCallback onError) { 50 | this.database.delete(DatabaseConstants.TABLE_NAME, 51 | where: '${DatabaseConstants.ID} = ?', 52 | whereArgs: [task.id]).then((int i) { 53 | onSuccess(); 54 | }).catchError((err) { 55 | onError(err); 56 | }); 57 | } 58 | 59 | @override 60 | void insertTask(Task task, OnLoadTask onLoadTask, OnErrorCallback onError) { 61 | this 62 | .database 63 | .insert(DatabaseConstants.TABLE_NAME, task.toJson()) 64 | .then((int index) { 65 | onLoadTask(task..id = index); 66 | }).catchError((err) { 67 | onError(err); 68 | }); 69 | } 70 | 71 | @override 72 | void updateTask(Task task, OnLoadTask onLoadTask, OnErrorCallback onError) { 73 | this.database.update(DatabaseConstants.TABLE_NAME, task.toJson(), 74 | where: '${DatabaseConstants.ID} = ?', 75 | whereArgs: [task.id]).then((int i) { 76 | onLoadTask(task); 77 | }).catchError((err) { 78 | onError(err); 79 | }); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/data/repository/repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:sqflite/sqflite.dart'; 2 | 3 | import '../task.dart'; 4 | import './local/repository.dart'; 5 | import './source.dart'; 6 | 7 | /// El [Repository] va a encargarse de decidir 8 | /// cual modelo(local o remoto) usar. 9 | /// 10 | /// Para este ejemplo solo se va a usar un modelo 11 | /// local(sqlite3). 12 | class Repository implements DataSource { 13 | LocalRepository repository; 14 | 15 | Repository(Database db) { 16 | repository = LocalRepository()..database = db; 17 | } 18 | 19 | @override 20 | void deleteAllTasks(VoidCallback onSuccess, OnErrorCallback onError) { 21 | this.repository.deleteAllTasks(onSuccess, onError); 22 | } 23 | 24 | @override 25 | void getTask(OnLoadTask onLoadTask, OnErrorCallback onError) { 26 | this.repository.getTask(onLoadTask, onError); 27 | } 28 | 29 | @override 30 | void getTasks(OnLoadTasks onLoadTasks, OnErrorCallback onError) { 31 | this.repository.getTasks(onLoadTasks, onError); 32 | } 33 | 34 | @override 35 | void deleteTask(Task task, VoidCallback onSuccess, OnErrorCallback onError) { 36 | this.repository.deleteTask(task, onSuccess, onError); 37 | } 38 | 39 | @override 40 | void insertTask(Task task, OnLoadTask onLoadTask, OnErrorCallback onError) { 41 | this.repository.insertTask(task, onLoadTask, onError); 42 | } 43 | 44 | @override 45 | void updateTask(Task task, OnLoadTask onLoadTask, OnErrorCallback onError) { 46 | this.repository.updateTask(task, onLoadTask, onError); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/data/repository/source.dart: -------------------------------------------------------------------------------- 1 | import '../task.dart'; 2 | 3 | typedef VoidCallback(); 4 | typedef OnLoadTask(Task task); 5 | typedef OnLoadTasks(List task); 6 | typedef OnErrorCallback(dynamic message); 7 | 8 | 9 | /// Modelo base encargado de implementar metodos 10 | /// que van a ser utilizados por modelos locales(base de datos) 11 | /// o modelos de remotos(conexiones a bases de datos remotes a 12 | /// travez de una api). 13 | abstract class DataSource { 14 | void getTasks(OnLoadTasks onLoadTasks, OnErrorCallback onError); 15 | void getTask(OnLoadTask onLoadTask, OnErrorCallback onError); 16 | 17 | void insertTask(Task task, OnLoadTask onLoadTask, OnErrorCallback onError); 18 | void updateTask(Task task, OnLoadTask onLoadTask, OnErrorCallback onError); 19 | 20 | void deleteTask(Task task, VoidCallback onSuccess, OnErrorCallback onError); 21 | void deleteAllTasks(VoidCallback onSuccess, OnErrorCallback onError); 22 | } 23 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/data/task.dart: -------------------------------------------------------------------------------- 1 | import '../db/const.dart'; 2 | 3 | /// El objeto [Task] representa de forma 4 | /// abstracta a las tareas que son agregadas, borradas 5 | /// actualizadas, etc. 6 | class Task { 7 | int id; 8 | bool done; 9 | String description; 10 | String shortDescription; 11 | 12 | Map toJson() { 13 | Map task = Map(); 14 | task[DatabaseConstants.DONE] = done ? 1 : 0; 15 | task[DatabaseConstants.ID] = id; 16 | task[DatabaseConstants.DESCRIPTION] = description; 17 | task[DatabaseConstants.SHORT_DESCRIPTION] = shortDescription; 18 | 19 | return task; 20 | } 21 | 22 | static Task fromJson(Map json) { 23 | return Task() 24 | ..done = (json[DatabaseConstants.DONE] as int) == 0 ? false : true 25 | ..description = (json[DatabaseConstants.DESCRIPTION] as String) 26 | ..shortDescription = (json[DatabaseConstants.SHORT_DESCRIPTION] as String) 27 | ..id = (json[DatabaseConstants.ID] as int); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/db/const.dart: -------------------------------------------------------------------------------- 1 | /// Guarda todas las constantes de base de datos, como 2 | /// por ejemplo, el nombre de los campos, el nombre de 3 | /// la base de datos [sqlite3], etc. 4 | class DatabaseConstants { 5 | // ignore: non_constant_identifier_names 6 | static final String SHORT_DESCRIPTION = 'short_description'; 7 | 8 | // ignore: non_constant_identifier_names 9 | static final String DESCRIPTION = 'description'; 10 | 11 | // ignore: non_constant_identifier_names 12 | static final String DONE = 'done'; 13 | 14 | // ignore: non_constant_identifier_names 15 | static final String ID = 'id'; 16 | 17 | // ignore: non_constant_identifier_names 18 | static final String DB_NAME = 'todoapp-mvp.db'; 19 | 20 | // ignore: non_constant_identifier_names 21 | static final String TABLE_NAME = 'todoappmvp'; 22 | 23 | // ignore: non_constant_identifier_names 24 | static final int VERSION = 1; 25 | } 26 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/db/db.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:path/path.dart'; 3 | import 'package:sqflite/sqflite.dart'; 4 | 5 | import './const.dart'; 6 | 7 | /// Se encarga de crear la base de datos 8 | /// y si el desarrollador así lo prefiere, 9 | /// sus tablas de base de datos. 10 | Future openLocalDatabase() async { 11 | String databasesPath = await getDatabasesPath(); 12 | String path = join(databasesPath, DatabaseConstants.DB_NAME); 13 | 14 | return await openDatabase(path, version: DatabaseConstants.VERSION, 15 | onCreate: (Database db, int version) async { 16 | await db.execute(''' 17 | CREATE TABLE IF NOT EXISTS ${DatabaseConstants.TABLE_NAME} ( 18 | ${DatabaseConstants.ID} INTEGER PRIMARY KEY, 19 | ${DatabaseConstants.SHORT_DESCRIPTION} TEXT NOT NULL, 20 | ${DatabaseConstants.DESCRIPTION} TEXT NOT NULL, 21 | ${DatabaseConstants.DONE} INTEGER DEFAULT 0 22 | ); 23 | '''); 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/presenter.dart: -------------------------------------------------------------------------------- 1 | 2 | /// Presentador base encargado de conectar la [vista] 3 | /// base con el [modelo]. 4 | abstract class BasePresenter { 5 | 6 | /// Inicializa o crear todas las conexiones 7 | /// a base de datos, websockets, servidores http, ftp 8 | /// entre otros. 9 | /// 10 | /// Este método debe ser llamado desde la [vista], dentro del 11 | /// método [initState]. 12 | /// 13 | /// Ejemplo de uso: 14 | /// 15 | /// @override 16 | /// void initState() { 17 | /// super.initState(); 18 | /// presenter.initPresenter(); 19 | /// } 20 | void initPresenter(); 21 | 22 | /// Cierra las conexiones a bases de datos, websockets, 23 | /// etc... y así liberar recursos del sistema. 24 | /// 25 | /// Este método debe ser llamado desde la [vista], dentro del 26 | /// método [dispose]. 27 | /// 28 | /// @override 29 | /// void dispose() { 30 | /// super.dispose(); 31 | /// presenter.dispose(); 32 | /// } 33 | void dispose(); 34 | } 35 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/taskdetail/contract.dart: -------------------------------------------------------------------------------- 1 | /// EL contract normalmente es el lugar donde 2 | /// se definen las vistas y presentadores base 3 | /// de cada widget. 4 | 5 | import '../presenter.dart'; 6 | import '../view.dart'; 7 | import '../data/task.dart'; 8 | 9 | 10 | /// Va a definir los metodos que van a ser llamados desde 11 | /// la vista, para agregar, actualizar, eliminar u obtener 12 | /// las tareas del modelo. 13 | abstract class BaseTaskDetailPresenter extends BasePresenter { 14 | 15 | /// Va a borrar una tarea de la base de datos. 16 | void deleteTask(Task task); 17 | } 18 | 19 | /// Va a definir los metodos para mostrar o renderizar 20 | /// datos y errores en la vista. 21 | abstract class BaseTaskDetailView extends BaseView {} 22 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/taskdetail/presenter.dart: -------------------------------------------------------------------------------- 1 | import 'package:sqflite/sqflite.dart'; 2 | 3 | import './contract.dart'; 4 | import '../data/task.dart'; 5 | import '../data/repository/repository.dart'; 6 | 7 | class TaskDetailPresenter implements BaseTaskDetailPresenter { 8 | BaseTaskDetailView view; 9 | Repository repository; 10 | 11 | TaskDetailPresenter(BaseTaskDetailView view, Database db) { 12 | this.view = view; 13 | this.view.setPresenter(this); 14 | 15 | this.repository = Repository(db); 16 | } 17 | 18 | @override 19 | void dispose() {} 20 | 21 | @override 22 | void initPresenter() {} 23 | 24 | @override 25 | deleteTask(Task task) { 26 | repository.deleteTask(task, () {}, (err) {}); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/taskdetail/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:sqflite/sqflite.dart'; 3 | 4 | import '../data/task.dart'; 5 | import './contract.dart'; 6 | import './presenter.dart'; 7 | 8 | class TaskDetailView extends StatefulWidget { 9 | final Task task; 10 | final Database db; 11 | final VoidCallback onTaskDeleted; 12 | 13 | const TaskDetailView( 14 | {Key key, @required this.task, @required this.db, this.onTaskDeleted}) 15 | : super(key: key); 16 | 17 | @override 18 | State createState() => _TaskDetailViewState(db); 19 | } 20 | 21 | class _TaskDetailViewState extends State 22 | implements BaseTaskDetailView { 23 | BaseTaskDetailPresenter presenter; 24 | 25 | _TaskDetailViewState(Database db) { 26 | new TaskDetailPresenter(this, db); 27 | } 28 | 29 | @override 30 | void initState() { 31 | super.initState(); 32 | presenter.initPresenter(); 33 | } 34 | 35 | @override 36 | void dispose() { 37 | super.dispose(); 38 | presenter.dispose(); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return Scaffold( 44 | appBar: createAppBar(), 45 | body: Container( 46 | padding: EdgeInsets.all(10.0), 47 | child: Text( 48 | widget.task.description, 49 | style: TextStyle(fontSize: 18.0), 50 | ), 51 | ), 52 | ); 53 | } 54 | 55 | Widget createAppBar() { 56 | return AppBar(title: Text(widget.task.shortDescription), actions: [ 57 | IconButton( 58 | icon: Icon(Icons.delete), 59 | onPressed: () { 60 | presenter.deleteTask(widget.task); 61 | widget.onTaskDeleted(); 62 | Navigator.of(context).pop(); 63 | }) 64 | ]); 65 | } 66 | 67 | @override 68 | void setPresenter(BaseTaskDetailPresenter presenter) { 69 | this.presenter = presenter; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/tasklist/contract.dart: -------------------------------------------------------------------------------- 1 | /// EL contract normalmente es el lugar donde 2 | /// se definen las vistas y presentadores base 3 | /// de cada widget. 4 | 5 | import '../data/task.dart'; 6 | import '../presenter.dart'; 7 | import '../view.dart'; 8 | 9 | /// Va a definir los metodos que van a ser llamados desde 10 | /// la vista, para agregar, actualizar, eliminar u obtener 11 | /// las tareas del modelo. 12 | abstract class BaseTaskListPresenter extends BasePresenter { 13 | 14 | /// Agrega una [tarea] a el modelo. 15 | void addTask(Task task); 16 | 17 | /// Actualiza una [tarea] del modelo 18 | void updateTask(Task task); 19 | 20 | /// obtiene todas las [tareas] del modelo 21 | void getTasks(); 22 | 23 | /// elimina todas las tareas del modelo. 24 | void removeAllTasks(); 25 | } 26 | 27 | /// Va a definir los metodos para mostrar o renderizar 28 | /// datos y errores en la vista. 29 | abstract class BaseTaskListView extends BaseView { 30 | 31 | /// Este método es llamado por el presentador cuando 32 | /// ya ha obtenido los datos del modelo, para mostrarlos. 33 | void showTasks(List tasks); 34 | 35 | /// Este método es llamado cuando no hay tareas en la 36 | /// base de datos y cuando ha ocurrido algun error interno. 37 | void showEmptyMessage(); 38 | 39 | /// Este método va a mostrar un [SnackBar] cuando 40 | /// se ha actualizado el estado de la tarea en la 41 | /// base de datos. 42 | void showUpdatedDoneMessage(String msg); 43 | 44 | /// Este método va a mostrar un dialogo de error 45 | /// cuando exista algún error con la base de datos. 46 | void showAlertErrorMessage(String error); 47 | } 48 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/tasklist/presenter.dart: -------------------------------------------------------------------------------- 1 | import 'package:sqflite/sqflite.dart'; 2 | 3 | import '../data/task.dart'; 4 | import './contract.dart'; 5 | import '../data/repository/source.dart'; 6 | import '../data/repository/repository.dart'; 7 | import '../db/db.dart'; 8 | 9 | class TaskListPresenter implements BaseTaskListPresenter { 10 | BaseTaskListView view; 11 | DataSource repository; 12 | Database db; 13 | 14 | TaskListPresenter(BaseTaskListView view) { 15 | this.view = view; 16 | this.view.setPresenter(this); 17 | } 18 | 19 | @override 20 | void initPresenter() { 21 | openLocalDatabase().then((Database db) { 22 | this.db = db; 23 | this.repository = Repository(db); 24 | this.getTasks(); 25 | }).catchError((err) { 26 | this.view.showEmptyMessage(); 27 | if ((err as DatabaseException).isSyntaxError()) { 28 | this.view.showAlertErrorMessage('SQL syntax error'); 29 | } else if ((err as DatabaseException).isOpenFailedError()) { 30 | this.view.showAlertErrorMessage('cannot open database'); 31 | } 32 | }); 33 | } 34 | 35 | @override 36 | void dispose() { 37 | if (db != null && db.isOpen) db.close(); 38 | } 39 | 40 | @override 41 | void addTask(Task task) { 42 | this.repository.insertTask(task, (Task task) { 43 | this.view.showTasks([task]); 44 | }, (err) { 45 | this.view.showAlertErrorMessage('SQL syntax error'); 46 | }); 47 | } 48 | 49 | @override 50 | void getTasks() { 51 | this.repository.getTasks((List tasks) { 52 | this.view.showTasks(tasks); 53 | }, (error) { 54 | if ('$error'.length == 0) { 55 | this.view.showEmptyMessage(); 56 | } else { 57 | this.view.showEmptyMessage(); 58 | this.view.showAlertErrorMessage('SQL syntax error'); 59 | } 60 | }); 61 | } 62 | 63 | @override 64 | void removeAllTasks() { 65 | this.repository.deleteAllTasks(() { 66 | // no se hace nada 67 | }, (err) { 68 | this.view.showAlertErrorMessage('SQL syntax error'); 69 | }); 70 | } 71 | 72 | @override 73 | void updateTask(Task task) { 74 | this.repository.updateTask(task, (Task task) { 75 | String tmp = task.done ? 'complete' : 'not complete'; 76 | this.view.showUpdatedDoneMessage( 77 | 'Task ${task..shortDescription} is market as $tmp'); 78 | }, (err) { 79 | print('$err'); 80 | this.view.showAlertErrorMessage('SQL syntax error'); 81 | }); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/tasklist/widgets/taskwidget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../data/task.dart'; 4 | 5 | typedef OnTaskCallback(Task task); 6 | 7 | class TaskWidget extends StatefulWidget { 8 | final Task task; 9 | final OnTaskCallback onUpdateTask; 10 | final OnTaskCallback onTaskCallback; 11 | 12 | const TaskWidget( 13 | {Key key, 14 | @required this.task, 15 | @required this.onUpdateTask, 16 | @required this.onTaskCallback}) 17 | : super(key: key); 18 | 19 | @override 20 | State createState() => _TaskWidgetState(); 21 | } 22 | 23 | class _TaskWidgetState extends State { 24 | bool _checkboxVal; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | _checkboxVal = widget.task.done; 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return FlatButton( 35 | padding: EdgeInsets.only(left: 0.0, right: 0.0, top: 10.0, bottom: 10.0), 36 | onPressed: () { 37 | widget.onTaskCallback(widget.task); 38 | }, 39 | child: Row( 40 | children: [ 41 | Checkbox( 42 | value: _checkboxVal, 43 | onChanged: (bool value) { 44 | setState(() { 45 | _checkboxVal = value; 46 | }); 47 | 48 | widget.onUpdateTask(widget.task..done = value); 49 | }, 50 | ), 51 | Text(widget.task.shortDescription, 52 | style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)) 53 | ], 54 | ), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /todoapp-mvp/lib/src/view.dart: -------------------------------------------------------------------------------- 1 | import './presenter.dart'; 2 | 3 | 4 | /// Vista base encargada de pintar todos los datos que el 5 | /// presentador le envía y pintar animaciones. 6 | abstract class BaseView

{ 7 | 8 | /// establece el presentador, el mismo tiene que 9 | /// heredar del BasePresenter, para que sea un 10 | /// presentador valido. 11 | void setPresenter(P presenter); 12 | } 13 | -------------------------------------------------------------------------------- /todoapp-mvp/res/values/strings_en.arb: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /todoapp-mvp/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:todomvp/src/app.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new Application()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /todoapp-mvp/todomvp.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /todoapp-mvp/todomvp_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /travis_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fast fail the script on failures. 4 | set -e 5 | 6 | # Normalize Branch variable 7 | export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) 8 | 9 | # Analyze cookbook samples 10 | 11 | for D in cookbook/*; do 12 | if [ -d "${D}" ]; then 13 | cd ${D} 14 | echo "Run flutter packages get on ${D}" 15 | ../../flutter/bin/flutter packages get 16 | 17 | echo "Run flutter analyze on ${D}" 18 | ../../flutter/bin/flutter analyze 19 | cd ../../ 20 | fi 21 | done 22 | 23 | # Analyze other samples 24 | 25 | for D in *; do 26 | 27 | if [ "$D" == "cookbook" ] || [ "$D" == "flutter" ] ; then 28 | continue; 29 | fi 30 | if [ -d "${D}" ]; then 31 | cd ${D} 32 | echo "Run flutter packages get on ${D}" 33 | ../flutter/bin/flutter packages get 34 | 35 | echo "Run flutter analyze on ${D}" 36 | ../flutter/bin/flutter analyze 37 | cd .. 38 | 39 | fi 40 | done 41 | 42 | 43 | # pass test 44 | # declare -a PROJECT_NAMES=( 45 | # # "jsonexample" \ 46 | # # "shrine" \ 47 | # ) 48 | 49 | # for PROJECT_NAME in "${PROJECT_NAMES[@]}" 50 | # do 51 | # echo "== Testing '${PROJECT_NAME}' on Flutter's $FLUTTER_VERSION channel ==" 52 | # pushd "${PROJECT_NAME}" 53 | # ../flutter/bin/flutter test 54 | # popd 55 | # done 56 | 57 | # echo "-- Success --" 58 | --------------------------------------------------------------------------------