├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .metadata ├── .vscode └── launch.json ├── LICENSE ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_wordpress │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets └── img │ ├── loading.gif │ └── no-image.jpg ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── flutter_export_environment.sh ├── 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 ├── bloc │ ├── login_bloc.dart │ ├── provider.dart │ ├── register_bloc.dart │ └── validator.dart ├── main.dart ├── models │ ├── ads_model.dart │ ├── create_user_model.dart │ ├── page_model.dart │ ├── post_model.dart │ └── user_model.dart ├── pages │ ├── ads_page.dart │ ├── login_page.dart │ ├── post_page.dart │ └── register_page.dart ├── preferences │ └── user_preferences.dart ├── providers │ ├── ads_provider.dart │ ├── page_provider.dart │ ├── post_provider.dart │ └── user_provider.dart └── utils │ └── utils.dart ├── pubspec.lock └── pubspec.yaml /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # APIS 13 | /lib/API 14 | /lib/wp-content 15 | 16 | # IntelliJ related 17 | *.iml 18 | *.ipr 19 | *.iws 20 | .idea/ 21 | 22 | # The .vscode folder contains launch configuration and tasks you configure in 23 | # VS Code which you may wish to be included in version control, so this line 24 | # is commented out by default. 25 | #.vscode/ 26 | 27 | # Flutter/Dart/Pub related 28 | **/doc/api/ 29 | .dart_tool/ 30 | .flutter-plugins 31 | .packages 32 | .pub-cache/ 33 | .pub/ 34 | /build/ 35 | 36 | # Android related 37 | **/android/**/gradle-wrapper.jar 38 | **/android/.gradle 39 | **/android/captures/ 40 | **/android/gradlew 41 | **/android/gradlew.bat 42 | **/android/local.properties 43 | **/android/**/GeneratedPluginRegistrant.java 44 | 45 | # iOS/XCode related 46 | **/ios/**/*.mode1v3 47 | **/ios/**/*.mode2v3 48 | **/ios/**/*.moved-aside 49 | **/ios/**/*.pbxuser 50 | **/ios/**/*.perspectivev3 51 | **/ios/**/*sync/ 52 | **/ios/**/.sconsign.dblite 53 | **/ios/**/.tags* 54 | **/ios/**/.vagrant/ 55 | **/ios/**/DerivedData/ 56 | **/ios/**/Icon? 57 | **/ios/**/Pods/ 58 | **/ios/**/.symlinks/ 59 | **/ios/**/profile 60 | **/ios/**/xcuserdata 61 | **/ios/.generated/ 62 | **/ios/Flutter/App.framework 63 | **/ios/Flutter/Flutter.framework 64 | **/ios/Flutter/Generated.xcconfig 65 | **/ios/Flutter/app.flx 66 | **/ios/Flutter/app.zip 67 | **/ios/Flutter/flutter_assets/ 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 77 | -------------------------------------------------------------------------------- /.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: 20e59316b8b8474554b38493b8ca888794b0234a 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: 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 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Francisco Javier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter + Wordpress 2 | 3 | This Project is created with the idea How to use Wordpres API as a Backend for the Flutter APP. 4 | 5 | - [x] Create Model for Posts 6 | - [x] Visualize Posts 7 | - [x] Create Plugin for Custom Endpoints/Routes 8 | - [x] Create Model for Pages 9 | - [x] ~~Create Model for Media~~ 10 | - [x] Create Model for Users 11 | - [x] Show Media in Posts 12 | - [x] Login/Register Users 13 | - [ ] Created Posts 14 | - [ ] Update Posts 15 | - [ ] Delete Posts 16 | - [ ] Create Documentation of how this project was created 17 | 18 | ## Custom Plugin Wordpress 19 | 20 | For the next versions is necesary install the Custom Plugin, because I'm use custom endpoints for consume the API. 21 | This plugin is very basic and of course is not perfect but I created with my little bit experience in PHP and I'm very happy with the result. 22 | 23 | - [Gist for plugin](https://gist.github.com/FrankyCode/8255e5a3da223c56666125d4d0808194) 24 | 25 | ### How to Use? 26 | 27 | - 1º Download the plugin for Gist 28 | - 2º Go to your folder htdocs\wp-content\plugins inside in your Wordpress 29 | - 3º Create a folder for contain the plugin for example wl-test 30 | - 4º Copy inside this folder the file wl-api.php 31 | - 5º Go to dashboard > Plugins > Installed Plugins > Custom Api > Activate 32 | - 6º Done ^_^ 33 | 34 | Now you can use the custom Routes/endpoints for consume the data for example posts. 35 | Be carefull if you use this plugin in productions because if you need to ovewrite or changes the file, you needed desactivate first before to changes. 36 | 37 | ## Documentation of WordPress API 38 | 39 | - [HandBook](https://developer.wordpress.org/rest-api/) 40 | - [References](https://developer.wordpress.org/rest-api/reference/) 41 | - [Authentication - Nonces - Tokens in Wordpress](https://codex.wordpress.org/WordPress_Nonces) 42 | - [Code Reference for Get Image](https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/) 43 | 44 | ## Flutter 45 | 46 | - [CookBook: Spanish - Obtener datos desde internet](https://flutter-es.io/docs/cookbook/networking/fetch-data) 47 | - [CookBook: English - Fetch data from the Internet](https://flutter.dev/docs/cookbook/networking/fetch-data) 48 | - [DOC: Serializar JSON usando Auto Librerias](https://flutter-es.io/docs/development/data-and-backend/json#serializar-json-usando-librer%C3%ADas-de-auto-generaci%C3%B3n-de-c%C3%B3digo) 49 | 50 | ## Flutter Packages 51 | 52 | - [Http](https://pub.dev/packages/http) 53 | - [RxDart](https://pub.dev/packages/rxdart) 54 | - [Shared Preference](https://pub.dev/packages/shared_preferences) 55 | 56 | ## Tools 57 | 58 | - [Create Models Serialize and Deserialize](https://app.quicktype.io/) 59 | - [RegExpression](https://regexr.com/) 60 | 61 | ## Articles for Flutter 62 | 63 | - [Medium: Working with APIs in Flutter](https://medium.com/flutter-community/working-with-apis-in-flutter-8745968103e9) 64 | - [Medium: Trabajando con APIs en FLutter](https://medium.com/comunidad-flutter/trabajando-con-api-en-flutter-2e49b78b6b98) 65 | - [Medium: Parseando JSON en Flutter](https://medium.com/@carlosAmillan/parseando-json-complejo-en-flutter-18d46c0eb045) 66 | 67 | ## RegExpression 68 | 69 | - Get Images in pages -> [^(src=\\")]([^"])+(png|jpg|gif) 70 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.flutter_wordpress" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_wordpress/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_wordpress 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /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.10.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/assets/img/loading.gif -------------------------------------------------------------------------------- /assets/img/no-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/assets/img/no-image.jpg -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=C:\flutter" 4 | export "FLUTTER_APPLICATION_PATH=C:\Users\Franky Coding\Desktop\Projects\Flutter\flutter_wordpress" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "FLUTTER_FRAMEWORK_DIR=C:\flutter\bin\cache\artifacts\engine\ios" 9 | export "FLUTTER_BUILD_NAME=1.0.0" 10 | export "FLUTTER_BUILD_NUMBER=1" 11 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXCopyFilesBuildPhase section */ 24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 25 | isa = PBXCopyFilesBuildPhase; 26 | buildActionMask = 2147483647; 27 | dstPath = ""; 28 | dstSubfolderSpec = 10; 29 | files = ( 30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 32 | ); 33 | name = "Embed Frameworks"; 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 43 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 44 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 62 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 9740EEB11CF90186004384FC /* Flutter */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 3B80C3931E831B6300D905FE /* App.framework */, 73 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 74 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 78 | ); 79 | name = Flutter; 80 | sourceTree = ""; 81 | }; 82 | 97C146E51CF9000F007C117D = { 83 | isa = PBXGroup; 84 | children = ( 85 | 9740EEB11CF90186004384FC /* Flutter */, 86 | 97C146F01CF9000F007C117D /* Runner */, 87 | 97C146EF1CF9000F007C117D /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 97C146EF1CF9000F007C117D /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 97C146EE1CF9000F007C117D /* Runner.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 97C146F01CF9000F007C117D /* Runner */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 103 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 104 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 105 | 97C147021CF9000F007C117D /* Info.plist */, 106 | 97C146F11CF9000F007C117D /* Supporting Files */, 107 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 108 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 109 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 110 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 111 | ); 112 | path = Runner; 113 | sourceTree = ""; 114 | }; 115 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 97C146ED1CF9000F007C117D /* Runner */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 128 | buildPhases = ( 129 | 9740EEB61CF901F6004384FC /* Run Script */, 130 | 97C146EA1CF9000F007C117D /* Sources */, 131 | 97C146EB1CF9000F007C117D /* Frameworks */, 132 | 97C146EC1CF9000F007C117D /* Resources */, 133 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 134 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = Runner; 141 | productName = Runner; 142 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 97C146E61CF9000F007C117D /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 1020; 152 | ORGANIZATIONNAME = "The Chromium Authors"; 153 | TargetAttributes = { 154 | 97C146ED1CF9000F007C117D = { 155 | CreatedOnToolsVersion = 7.3.1; 156 | LastSwiftMigration = 0910; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = en; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = 97C146E51CF9000F007C117D; 169 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 97C146ED1CF9000F007C117D /* Runner */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 97C146EC1CF9000F007C117D /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 184 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 185 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 186 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 187 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXResourcesBuildPhase section */ 192 | 193 | /* Begin PBXShellScriptBuildPhase section */ 194 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 195 | isa = PBXShellScriptBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | ); 199 | inputPaths = ( 200 | ); 201 | name = "Thin Binary"; 202 | outputPaths = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | shellPath = /bin/sh; 206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 207 | }; 208 | 9740EEB61CF901F6004384FC /* Run Script */ = { 209 | isa = PBXShellScriptBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | inputPaths = ( 214 | ); 215 | name = "Run Script"; 216 | outputPaths = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 221 | }; 222 | /* End PBXShellScriptBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 97C146EA1CF9000F007C117D /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 230 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXVariantGroup section */ 237 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 97C146FB1CF9000F007C117D /* Base */, 241 | ); 242 | name = Main.storyboard; 243 | sourceTree = ""; 244 | }; 245 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 97C147001CF9000F007C117D /* Base */, 249 | ); 250 | name = LaunchScreen.storyboard; 251 | sourceTree = ""; 252 | }; 253 | /* End PBXVariantGroup section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 257 | isa = XCBuildConfiguration; 258 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_COMMA = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 272 | CLANG_WARN_EMPTY_BODY = YES; 273 | CLANG_WARN_ENUM_CONVERSION = YES; 274 | CLANG_WARN_INFINITE_RECURSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 281 | CLANG_WARN_STRICT_PROTOTYPES = YES; 282 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 288 | ENABLE_NS_ASSERTIONS = NO; 289 | ENABLE_STRICT_OBJC_MSGSEND = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_NO_COMMON_BLOCKS = YES; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 299 | MTL_ENABLE_DEBUG_INFO = NO; 300 | SDKROOT = iphoneos; 301 | TARGETED_DEVICE_FAMILY = "1,2"; 302 | VALIDATE_PRODUCT = YES; 303 | }; 304 | name = Profile; 305 | }; 306 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 307 | isa = XCBuildConfiguration; 308 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 309 | buildSettings = { 310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 311 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 312 | DEVELOPMENT_TEAM = S8QB4VV633; 313 | ENABLE_BITCODE = NO; 314 | FRAMEWORK_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | "$(PROJECT_DIR)/Flutter", 317 | ); 318 | INFOPLIST_FILE = Runner/Info.plist; 319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 320 | LIBRARY_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "$(PROJECT_DIR)/Flutter", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWordpress; 325 | PRODUCT_NAME = "$(TARGET_NAME)"; 326 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 327 | SWIFT_VERSION = 4.0; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 381 | MTL_ENABLE_DEBUG_INFO = YES; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | }; 386 | name = Debug; 387 | }; 388 | 97C147041CF9000F007C117D /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_COMMA = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INFINITE_RECURSION = YES; 407 | CLANG_WARN_INT_CONVERSION = YES; 408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWordpress; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 462 | SWIFT_VERSION = 4.0; 463 | VERSIONING_SYSTEM = "apple-generic"; 464 | }; 465 | name = Debug; 466 | }; 467 | 97C147071CF9000F007C117D /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 470 | buildSettings = { 471 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 472 | CLANG_ENABLE_MODULES = YES; 473 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 474 | ENABLE_BITCODE = NO; 475 | FRAMEWORK_SEARCH_PATHS = ( 476 | "$(inherited)", 477 | "$(PROJECT_DIR)/Flutter", 478 | ); 479 | INFOPLIST_FILE = Runner/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 481 | LIBRARY_SEARCH_PATHS = ( 482 | "$(inherited)", 483 | "$(PROJECT_DIR)/Flutter", 484 | ); 485 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWordpress; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 488 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 489 | SWIFT_VERSION = 4.0; 490 | VERSIONING_SYSTEM = "apple-generic"; 491 | }; 492 | name = Release; 493 | }; 494 | /* End XCBuildConfiguration section */ 495 | 496 | /* Begin XCConfigurationList section */ 497 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 97C147031CF9000F007C117D /* Debug */, 501 | 97C147041CF9000F007C117D /* Release */, 502 | 249021D3217E4FDB00AE95B9 /* Profile */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 508 | isa = XCConfigurationList; 509 | buildConfigurations = ( 510 | 97C147061CF9000F007C117D /* Debug */, 511 | 97C147071CF9000F007C117D /* Release */, 512 | 249021D4217E4FDB00AE95B9 /* Profile */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | defaultConfigurationName = Release; 516 | }; 517 | /* End XCConfigurationList section */ 518 | 519 | }; 520 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 521 | } 522 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FrankyCode/flutter-wordpress-api/8c4828e76983431b59dc2229c8636c4949d1b778/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_wordpress 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/bloc/login_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:flutter_wordpress/bloc/validator.dart'; 4 | 5 | class LoginBloc with Validators{ 6 | 7 | final _emailController = BehaviorSubject(); 8 | final _passwordController = BehaviorSubject(); 9 | 10 | // Insert Values to Stream 11 | Function(String) get changeEmail => _emailController.sink.add; 12 | Function(String) get changePassword => _passwordController.sink.add; 13 | 14 | 15 | // Get values to Stream 16 | Stream get emailStream => _emailController.stream.transform(validateEmail); 17 | Stream get passwordStream => _passwordController.stream.transform(validatePassword); 18 | 19 | Stream get formValidLoginStream => Observable.combineLatest2(emailStream, passwordStream, (e, p) => true); 20 | 21 | 22 | // Get the last value insert in Stream 23 | String get email => _emailController.value; 24 | String get password => _passwordController.value; 25 | 26 | 27 | 28 | 29 | 30 | dispose(){ 31 | _emailController?.close(); 32 | _passwordController?.close(); 33 | } 34 | 35 | 36 | 37 | } -------------------------------------------------------------------------------- /lib/bloc/provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:flutter_wordpress/bloc/login_bloc.dart'; 4 | export 'package:flutter_wordpress/bloc/login_bloc.dart'; 5 | 6 | import 'package:flutter_wordpress/bloc/register_bloc.dart'; 7 | export 'package:flutter_wordpress/bloc/register_bloc.dart'; 8 | 9 | 10 | class Provider extends InheritedWidget{ 11 | 12 | 13 | // Instancia for save data if use hot reload 14 | static Provider _instancia; 15 | factory Provider({Key key, Widget child}){ 16 | 17 | if(_instancia == null){ 18 | _instancia = new Provider._internal(key: key, child: child); 19 | } 20 | 21 | return _instancia; 22 | } 23 | 24 | Provider._internal({Key key, Widget child}) : super(key: key, child: child); 25 | 26 | 27 | 28 | final loginBloc = LoginBloc(); 29 | final registerBloc = RegisterBloc(); 30 | 31 | 32 | @override 33 | bool updateShouldNotify(InheritedWidget oldWidget) => true; 34 | 35 | static LoginBloc login ( BuildContext context ){ 36 | return ( context.inheritFromWidgetOfExactType(Provider) as Provider).loginBloc; 37 | 38 | } 39 | 40 | static RegisterBloc regis (BuildContext context){ 41 | return (context.inheritFromWidgetOfExactType(Provider) as Provider).registerBloc; 42 | } 43 | 44 | 45 | } -------------------------------------------------------------------------------- /lib/bloc/register_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:flutter_wordpress/bloc/validator.dart'; 4 | 5 | class RegisterBloc with Validators{ 6 | 7 | final _usernameController = BehaviorSubject(); 8 | final _emailController = BehaviorSubject(); 9 | final _passwordController = BehaviorSubject(); 10 | 11 | // Insert Values to Stream 12 | Function(String) get changeUsername => _usernameController.sink.add; 13 | Function(String) get changeEmail => _emailController.sink.add; 14 | Function(String) get changePassword => _passwordController.sink.add; 15 | 16 | 17 | // Get values to Stream 18 | Stream get usernameStream => _usernameController.stream.transform(validateUsername); 19 | Stream get emailStream => _emailController.stream.transform(validateEmail); 20 | Stream get passwordStream => _passwordController.stream.transform(validatePassword); 21 | 22 | Stream get formValidRegisterStream => Observable.combineLatest3(usernameStream, emailStream, passwordStream, (u, e, p) => true); 23 | 24 | 25 | // Get the last value insert in Stream 26 | String get username => _usernameController.value; 27 | String get email => _emailController.value; 28 | String get password => _passwordController.value; 29 | 30 | 31 | 32 | 33 | 34 | dispose(){ 35 | _usernameController?.close(); 36 | _emailController?.close(); 37 | _passwordController?.close(); 38 | } 39 | 40 | 41 | 42 | } -------------------------------------------------------------------------------- /lib/bloc/validator.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'dart:async'; 4 | 5 | class Validators{ 6 | 7 | final validateUsername = StreamTransformer.fromHandlers( 8 | handleData: (username, sink){ 9 | 10 | if(username.length >= 6){ 11 | sink.add(username); 12 | }else{ 13 | sink.addError('Need more than 6 characters'); 14 | } 15 | 16 | } 17 | ); 18 | 19 | final validateEmail = StreamTransformer.fromHandlers( 20 | handleData: (email, sink){ 21 | Pattern pattern = r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'; 22 | RegExp regex = new RegExp(pattern); 23 | 24 | if(regex.hasMatch(email)){ 25 | sink.add(email); 26 | }else{ 27 | sink.addError('Email is not correct'); 28 | } 29 | 30 | 31 | } 32 | ); 33 | 34 | 35 | final validatePassword = StreamTransformer.fromHandlers( 36 | handleData: (password, sink){ 37 | 38 | if(password.length >= 6){ 39 | sink.add(password); 40 | }else{ 41 | sink.addError('Need more than 6 characters'); 42 | } 43 | 44 | } 45 | ); 46 | 47 | 48 | 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wordpress/bloc/provider.dart'; 3 | import 'package:flutter_wordpress/pages/ads_page.dart'; 4 | import 'package:flutter_wordpress/pages/login_page.dart'; 5 | import 'package:flutter_wordpress/pages/post_page.dart'; 6 | import 'package:flutter_wordpress/pages/register_page.dart'; 7 | import 'package:flutter_wordpress/preferences/user_preferences.dart'; 8 | 9 | void main() async { 10 | final prefs = new UserPreferences(); 11 | await prefs.initPrefs(); 12 | runApp(MyApp()); 13 | } 14 | 15 | class MyApp extends StatelessWidget { 16 | @override 17 | Widget build(BuildContext context) { 18 | final prefs = new UserPreferences(); 19 | //print(prefs.token); 20 | return Provider( 21 | child: MaterialApp( 22 | debugShowCheckedModeBanner: false, 23 | title: 'Material App', 24 | initialRoute: prefs.lastPage, 25 | routes: { 26 | '/': (BuildContext context) => LoginPage(), 27 | 'register': (BuildContext context) => RegisterPage(), 28 | 'post': (BuildContext context) => PostPage(), 29 | 'ads': (BuildContext context) => AdsPage(), 30 | }, 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/models/ads_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final ads = adsFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | List adsFromJson(String str) => List.from(json.decode(str).map((x) => Ads.fromJson(x))); 8 | 9 | String adsToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); 10 | 11 | class Ads { 12 | int id; 13 | String title; 14 | String content; 15 | String slug; 16 | Author author; 17 | List advertCategory; 18 | List advertLocation; 19 | FeaturedImage featuredImage; 20 | 21 | Ads({ 22 | this.id, 23 | this.title, 24 | this.content, 25 | this.slug, 26 | this.author, 27 | this.advertCategory, 28 | this.advertLocation, 29 | this.featuredImage, 30 | }); 31 | 32 | factory Ads.fromJson(Map json) => Ads( 33 | id: json["id"], 34 | title: json["title"], 35 | content: json["content"], 36 | slug: json["slug"], 37 | author: Author.fromJson(json["author"]), 38 | advertCategory: List.from(json["advert_category"].map((x) => Advert.fromJson(x))), 39 | advertLocation: List.from(json["advert_location"].map((x) => Advert.fromJson(x))), 40 | featuredImage: FeaturedImage.fromJson(json["featured_image"]), 41 | ); 42 | 43 | Map toJson() => { 44 | "id": id, 45 | "title": title, 46 | "content": content, 47 | "slug": slug, 48 | "author": author.toJson(), 49 | "advert_category": List.from(advertCategory.map((x) => x.toJson())), 50 | "advert_location": List.from(advertLocation.map((x) => x.toJson())), 51 | "featured_image": featuredImage.toJson(), 52 | }; 53 | } 54 | 55 | class Advert { 56 | int termId; 57 | String name; 58 | String slug; 59 | int termGroup; 60 | int termTaxonomyId; 61 | String taxonomy; 62 | String description; 63 | int parent; 64 | int count; 65 | String filter; 66 | 67 | Advert({ 68 | this.termId, 69 | this.name, 70 | this.slug, 71 | this.termGroup, 72 | this.termTaxonomyId, 73 | this.taxonomy, 74 | this.description, 75 | this.parent, 76 | this.count, 77 | this.filter, 78 | }); 79 | 80 | factory Advert.fromJson(Map json) => Advert( 81 | termId: json["term_id"], 82 | name: json["name"], 83 | slug: json["slug"], 84 | termGroup: json["term_group"], 85 | termTaxonomyId: json["term_taxonomy_id"], 86 | taxonomy: json["taxonomy"], 87 | description: json["description"], 88 | parent: json["parent"], 89 | count: json["count"], 90 | filter: json["filter"], 91 | ); 92 | 93 | Map toJson() => { 94 | "term_id": termId, 95 | "name": name, 96 | "slug": slug, 97 | "term_group": termGroup, 98 | "term_taxonomy_id": termTaxonomyId, 99 | "taxonomy": taxonomy, 100 | "description": description, 101 | "parent": parent, 102 | "count": count, 103 | "filter": filter, 104 | }; 105 | } 106 | 107 | class Author { 108 | String id; 109 | String nickname; 110 | String avatar; 111 | String userStatus; 112 | 113 | Author({ 114 | this.id, 115 | this.nickname, 116 | this.avatar, 117 | this.userStatus, 118 | }); 119 | 120 | factory Author.fromJson(Map json) => Author( 121 | id: json["id"], 122 | nickname: json["nickname"], 123 | avatar: json["avatar"], 124 | userStatus: json["user_status"], 125 | ); 126 | 127 | Map toJson() => { 128 | "id": id, 129 | "nickname": nickname, 130 | "avatar": avatar, 131 | "user_status": userStatus, 132 | }; 133 | } 134 | 135 | class FeaturedImage { 136 | String thumbnail; 137 | String medium; 138 | String large; 139 | 140 | FeaturedImage({ 141 | this.thumbnail, 142 | this.medium, 143 | this.large, 144 | }); 145 | 146 | factory FeaturedImage.fromJson(Map json) => FeaturedImage( 147 | thumbnail: json["thumbnail"], 148 | medium: json["medium"], 149 | large: json["large"], 150 | ); 151 | 152 | Map toJson() => { 153 | "thumbnail": thumbnail, 154 | "medium": medium, 155 | "large": large, 156 | }; 157 | } 158 | -------------------------------------------------------------------------------- /lib/models/create_user_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final user = userFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | User userFromJson(String str) => User.fromJson(json.decode(str)); 8 | 9 | String userToJson(User data) => json.encode(data.toJson()); 10 | 11 | class User { 12 | int id; 13 | String username; 14 | String name; 15 | String firstName; 16 | String lastName; 17 | String email; 18 | String url; 19 | String description; 20 | String link; 21 | String locale; 22 | String nickname; 23 | String slug; 24 | DateTime registeredDate; 25 | List role; 26 | String password; 27 | Capabilities capabilities; 28 | ExtraCapabilities extraCapabilities; 29 | Map avatarUrls; 30 | Meta meta; 31 | 32 | User({ 33 | this.id, 34 | this.username, 35 | this.name, 36 | this.firstName, 37 | this.lastName, 38 | this.email, 39 | this.url, 40 | this.description, 41 | this.link, 42 | this.locale, 43 | this.nickname, 44 | this.slug, 45 | this.registeredDate, 46 | this.role, 47 | this.password, 48 | this.capabilities, 49 | this.extraCapabilities, 50 | this.avatarUrls, 51 | this.meta, 52 | }); 53 | 54 | factory User.fromJson(Map json) => User( 55 | id: json["id"], 56 | username: json["username"], 57 | name: json["name"], 58 | firstName: json["first_name"], 59 | lastName: json["last_name"], 60 | email: json["email"], 61 | url: json["url"], 62 | description: json["description"], 63 | link: json["link"], 64 | locale: json["locale"], 65 | nickname: json["nickname"], 66 | slug: json["slug"], 67 | registeredDate: DateTime.parse(json["registered_date"]), 68 | role: List.from(json["role"].map((x) => x)), 69 | password: json["password"], 70 | capabilities: Capabilities.fromJson(json["capabilities"]), 71 | extraCapabilities: ExtraCapabilities.fromJson(json["extra_capabilities"]), 72 | avatarUrls: Map.from(json["avatar_urls"]).map((k, v) => MapEntry(k, v)), 73 | meta: Meta.fromJson(json["meta"]), 74 | ); 75 | 76 | Map toJson() => { 77 | "id": id, 78 | "username": username, 79 | "name": name, 80 | "first_name": firstName, 81 | "last_name": lastName, 82 | "email": email, 83 | "url": url, 84 | "description": description, 85 | "link": link, 86 | "locale": locale, 87 | "nickname": nickname, 88 | "slug": slug, 89 | "registered_date": registeredDate.toIso8601String(), 90 | "role": List.from(role.map((x) => x)), 91 | "password": password, 92 | "capabilities": capabilities.toJson(), 93 | "extra_capabilities": extraCapabilities.toJson(), 94 | "avatar_urls": Map.from(avatarUrls).map((k, v) => MapEntry(k, v)), 95 | "meta": meta.toJson(), 96 | }; 97 | } 98 | 99 | class Capabilities { 100 | Capabilities(); 101 | 102 | factory Capabilities.fromJson(Map json) => Capabilities( 103 | ); 104 | 105 | Map toJson() => { 106 | }; 107 | } 108 | 109 | class ExtraCapabilities { 110 | ExtraCapabilities(); 111 | 112 | factory ExtraCapabilities.fromJson(Map json) => ExtraCapabilities( 113 | ); 114 | 115 | Map toJson() => { 116 | }; 117 | } 118 | 119 | class Meta { 120 | Meta(); 121 | 122 | factory Meta.fromJson(Map json) => Meta( 123 | ); 124 | 125 | Map toJson() => { 126 | }; 127 | } -------------------------------------------------------------------------------- /lib/models/page_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final page = pageFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | List pagesFromJson(String str) => List.from(json.decode(str).map((x) => Page.fromJson(x))); 8 | 9 | Page pageFromJson(String str) => Page.fromJson(json.decode(str)); 10 | 11 | List respon(String str) => List.from(json.decode(str).map((j) => Page.fromJson(j))); 12 | 13 | String pageToJson(Page data) => json.encode(data.toJson()); 14 | 15 | String pagesToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); 16 | 17 | class Page { 18 | int id; 19 | DateTime date; 20 | DateTime dateGmt; 21 | Guid guid; 22 | DateTime modified; 23 | DateTime modifiedGmt; 24 | String slug; 25 | StatusEnum status; 26 | Type type; 27 | String link; 28 | Guid title; 29 | Content content; 30 | Content excerpt; 31 | int author; 32 | int featuredMedia; 33 | int parent; 34 | int menuOrder; 35 | Status commentStatus; 36 | Status pingStatus; 37 | String template; 38 | List meta; 39 | Links links; 40 | 41 | Page({ 42 | this.id, 43 | this.date, 44 | this.dateGmt, 45 | this.guid, 46 | this.modified, 47 | this.modifiedGmt, 48 | this.slug, 49 | this.status, 50 | this.type, 51 | this.link, 52 | this.title, 53 | this.content, 54 | this.excerpt, 55 | this.author, 56 | this.featuredMedia, 57 | this.parent, 58 | this.menuOrder, 59 | this.commentStatus, 60 | this.pingStatus, 61 | this.template, 62 | this.meta, 63 | this.links, 64 | }); 65 | 66 | factory Page.fromJson(Map json) => Page( 67 | id: json["id"], 68 | date: DateTime.parse(json["date"]), 69 | dateGmt: DateTime.parse(json["date_gmt"]), 70 | guid: Guid.fromJson(json["guid"]), 71 | modified: DateTime.parse(json["modified"]), 72 | modifiedGmt: DateTime.parse(json["modified_gmt"]), 73 | slug: json["slug"], 74 | status: statusEnumValues.map[json["status"]], 75 | type: typeValues.map[json["type"]], 76 | link: json["link"], 77 | title: Guid.fromJson(json["title"]), 78 | content: Content.fromJson(json["content"]), 79 | excerpt: Content.fromJson(json["excerpt"]), 80 | author: json["author"], 81 | featuredMedia: json["featured_media"], 82 | parent: json["parent"], 83 | menuOrder: json["menu_order"], 84 | commentStatus: statusValues.map[json["comment_status"]], 85 | pingStatus: statusValues.map[json["ping_status"]], 86 | template: json["template"], 87 | meta: List.from(json["meta"].map((x) => x)), 88 | links: Links.fromJson(json["_links"]), 89 | ); 90 | 91 | Map toJson() => { 92 | "id": id, 93 | "date": date.toIso8601String(), 94 | "date_gmt": dateGmt.toIso8601String(), 95 | "guid": guid.toJson(), 96 | "modified": modified.toIso8601String(), 97 | "modified_gmt": modifiedGmt.toIso8601String(), 98 | "slug": slug, 99 | "status": statusEnumValues.reverse[status], 100 | "type": typeValues.reverse[type], 101 | "link": link, 102 | "title": title.toJson(), 103 | "content": content.toJson(), 104 | "excerpt": excerpt.toJson(), 105 | "author": author, 106 | "featured_media": featuredMedia, 107 | "parent": parent, 108 | "menu_order": menuOrder, 109 | "comment_status": statusValues.reverse[commentStatus], 110 | "ping_status": statusValues.reverse[pingStatus], 111 | "template": template, 112 | "meta": List.from(meta.map((x) => x)), 113 | "_links": links.toJson(), 114 | }; 115 | } 116 | 117 | enum Status { CLOSED } 118 | 119 | final statusValues = EnumValues({ 120 | "closed": Status.CLOSED 121 | }); 122 | 123 | class Content { 124 | String rendered; 125 | bool protected; 126 | 127 | Content({ 128 | this.rendered, 129 | this.protected, 130 | }); 131 | 132 | factory Content.fromJson(Map json) => Content( 133 | rendered: json["rendered"], 134 | protected: json["protected"], 135 | ); 136 | 137 | Map toJson() => { 138 | "rendered": rendered, 139 | "protected": protected, 140 | }; 141 | } 142 | 143 | class Guid { 144 | String rendered; 145 | 146 | Guid({ 147 | this.rendered, 148 | }); 149 | 150 | factory Guid.fromJson(Map json) => Guid( 151 | rendered: json["rendered"], 152 | ); 153 | 154 | Map toJson() => { 155 | "rendered": rendered, 156 | }; 157 | } 158 | 159 | class Links { 160 | List self; 161 | List collection; 162 | List about; 163 | List author; 164 | List replies; 165 | List versionHistory; 166 | List predecessorVersion; 167 | List wpAttachment; 168 | List curies; 169 | List up; 170 | 171 | Links({ 172 | this.self, 173 | this.collection, 174 | this.about, 175 | this.author, 176 | this.replies, 177 | this.versionHistory, 178 | this.predecessorVersion, 179 | this.wpAttachment, 180 | this.curies, 181 | this.up, 182 | }); 183 | 184 | factory Links.fromJson(Map json) => Links( 185 | self: List.from(json["self"].map((x) => About.fromJson(x))), 186 | collection: List.from(json["collection"].map((x) => About.fromJson(x))), 187 | about: List.from(json["about"].map((x) => About.fromJson(x))), 188 | author: List.from(json["author"].map((x) => Author.fromJson(x))), 189 | replies: List.from(json["replies"].map((x) => Author.fromJson(x))), 190 | versionHistory: List.from(json["version-history"].map((x) => VersionHistory.fromJson(x))), 191 | predecessorVersion: json["predecessor-version"] == null ? null : List.from(json["predecessor-version"].map((x) => PredecessorVersion.fromJson(x))), 192 | wpAttachment: List.from(json["wp:attachment"].map((x) => About.fromJson(x))), 193 | curies: List.from(json["curies"].map((x) => Cury.fromJson(x))), 194 | up: json["up"] == null ? null : List.from(json["up"].map((x) => Author.fromJson(x))), 195 | ); 196 | 197 | Map toJson() => { 198 | "self": List.from(self.map((x) => x.toJson())), 199 | "collection": List.from(collection.map((x) => x.toJson())), 200 | "about": List.from(about.map((x) => x.toJson())), 201 | "author": List.from(author.map((x) => x.toJson())), 202 | "replies": List.from(replies.map((x) => x.toJson())), 203 | "version-history": List.from(versionHistory.map((x) => x.toJson())), 204 | "predecessor-version": predecessorVersion == null ? null : List.from(predecessorVersion.map((x) => x.toJson())), 205 | "wp:attachment": List.from(wpAttachment.map((x) => x.toJson())), 206 | "curies": List.from(curies.map((x) => x.toJson())), 207 | "up": up == null ? null : List.from(up.map((x) => x.toJson())), 208 | }; 209 | } 210 | 211 | class About { 212 | String href; 213 | 214 | About({ 215 | this.href, 216 | }); 217 | 218 | factory About.fromJson(Map json) => About( 219 | href: json["href"], 220 | ); 221 | 222 | Map toJson() => { 223 | "href": href, 224 | }; 225 | } 226 | 227 | class Author { 228 | bool embeddable; 229 | String href; 230 | 231 | Author({ 232 | this.embeddable, 233 | this.href, 234 | }); 235 | 236 | factory Author.fromJson(Map json) => Author( 237 | embeddable: json["embeddable"], 238 | href: json["href"], 239 | ); 240 | 241 | Map toJson() => { 242 | "embeddable": embeddable, 243 | "href": href, 244 | }; 245 | } 246 | 247 | class Cury { 248 | Name name; 249 | Href href; 250 | bool templated; 251 | 252 | Cury({ 253 | this.name, 254 | this.href, 255 | this.templated, 256 | }); 257 | 258 | factory Cury.fromJson(Map json) => Cury( 259 | name: nameValues.map[json["name"]], 260 | href: hrefValues.map[json["href"]], 261 | templated: json["templated"], 262 | ); 263 | 264 | Map toJson() => { 265 | "name": nameValues.reverse[name], 266 | "href": hrefValues.reverse[href], 267 | "templated": templated, 268 | }; 269 | } 270 | 271 | enum Href { HTTPS_API_W_ORG_REL } 272 | 273 | final hrefValues = EnumValues({ 274 | "https://api.w.org/{rel}": Href.HTTPS_API_W_ORG_REL 275 | }); 276 | 277 | enum Name { WP } 278 | 279 | final nameValues = EnumValues({ 280 | "wp": Name.WP 281 | }); 282 | 283 | class PredecessorVersion { 284 | int id; 285 | String href; 286 | 287 | PredecessorVersion({ 288 | this.id, 289 | this.href, 290 | }); 291 | 292 | factory PredecessorVersion.fromJson(Map json) => PredecessorVersion( 293 | id: json["id"], 294 | href: json["href"], 295 | ); 296 | 297 | Map toJson() => { 298 | "id": id, 299 | "href": href, 300 | }; 301 | } 302 | 303 | class VersionHistory { 304 | int count; 305 | String href; 306 | 307 | VersionHistory({ 308 | this.count, 309 | this.href, 310 | }); 311 | 312 | factory VersionHistory.fromJson(Map json) => VersionHistory( 313 | count: json["count"], 314 | href: json["href"], 315 | ); 316 | 317 | Map toJson() => { 318 | "count": count, 319 | "href": href, 320 | }; 321 | } 322 | 323 | enum StatusEnum { PUBLISH } 324 | 325 | final statusEnumValues = EnumValues({ 326 | "publish": StatusEnum.PUBLISH 327 | }); 328 | 329 | enum Type { PAGE } 330 | 331 | final typeValues = EnumValues({ 332 | "page": Type.PAGE 333 | }); 334 | 335 | class EnumValues { 336 | Map map; 337 | Map reverseMap; 338 | 339 | EnumValues(this.map); 340 | 341 | Map get reverse { 342 | if (reverseMap == null) { 343 | reverseMap = map.map((k, v) => new MapEntry(v, k)); 344 | } 345 | return reverseMap; 346 | } 347 | } 348 | -------------------------------------------------------------------------------- /lib/models/post_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final posts = postsFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | List postsFromJson(String str) => List.from(json.decode(str).map((x) => Posts.fromJson(x))); 8 | 9 | String postsToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); 10 | 11 | class Posts { 12 | int id; 13 | String title; 14 | String content; 15 | String slug; 16 | FeaturedImage featuredImage; 17 | 18 | Posts({ 19 | this.id, 20 | this.title, 21 | this.content, 22 | this.slug, 23 | this.featuredImage, 24 | }); 25 | 26 | factory Posts.fromJson(Map json) => Posts( 27 | id: json["id"], 28 | title: json["title"], 29 | content: json["content"], 30 | slug: json["slug"], 31 | featuredImage: FeaturedImage.fromJson(json["featured_image"]), 32 | ); 33 | 34 | Map toJson() => { 35 | "id": id, 36 | "title": title, 37 | "content": content, 38 | "slug": slug, 39 | "featured_image": featuredImage.toJson(), 40 | }; 41 | } 42 | 43 | class FeaturedImage { 44 | dynamic thumbnail; 45 | dynamic medium; 46 | dynamic large; 47 | 48 | FeaturedImage({ 49 | this.thumbnail, 50 | this.medium, 51 | this.large, 52 | }); 53 | 54 | factory FeaturedImage.fromJson(Map json) => FeaturedImage( 55 | thumbnail: json["thumbnail"], 56 | medium: json["medium"], 57 | large: json["large"], 58 | ); 59 | 60 | Map toJson() => { 61 | "thumbnail": thumbnail, 62 | "medium": medium, 63 | "large": large, 64 | }; 65 | } 66 | -------------------------------------------------------------------------------- /lib/models/user_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final user = userFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | User userFromJson(String str) => User.fromJson(json.decode(str)); 8 | 9 | String userToJson(User data) => json.encode(data.toJson()); 10 | 11 | class User { 12 | int id; 13 | String username; 14 | String name; 15 | String firstName; 16 | String lastName; 17 | String email; 18 | String url; 19 | String description; 20 | String link; 21 | String locale; 22 | String nickname; 23 | String slug; 24 | List roles; 25 | DateTime registeredDate; 26 | Capabilities capabilities; 27 | ExtraCapabilities extraCapabilities; 28 | Map avatarUrls; 29 | List meta; 30 | Links links; 31 | 32 | User({ 33 | this.id, 34 | this.username, 35 | this.name, 36 | this.firstName, 37 | this.lastName, 38 | this.email, 39 | this.url, 40 | this.description, 41 | this.link, 42 | this.locale, 43 | this.nickname, 44 | this.slug, 45 | this.roles, 46 | this.registeredDate, 47 | this.capabilities, 48 | this.extraCapabilities, 49 | this.avatarUrls, 50 | this.meta, 51 | this.links, 52 | }); 53 | 54 | factory User.fromJson(Map json) => User( 55 | id: json["id"], 56 | username: json["username"], 57 | name: json["name"], 58 | firstName: json["first_name"], 59 | lastName: json["last_name"], 60 | email: json["email"], 61 | url: json["url"], 62 | description: json["description"], 63 | link: json["link"], 64 | locale: json["locale"], 65 | nickname: json["nickname"], 66 | slug: json["slug"], 67 | roles: List.from(json["roles"].map((x) => x)), 68 | registeredDate: DateTime.parse(json["registered_date"]), 69 | capabilities: Capabilities.fromJson(json["capabilities"]), 70 | extraCapabilities: ExtraCapabilities.fromJson(json["extra_capabilities"]), 71 | avatarUrls: Map.from(json["avatar_urls"]).map((k, v) => MapEntry(k, v)), 72 | meta: List.from(json["meta"].map((x) => x)), 73 | links: Links.fromJson(json["_links"]), 74 | ); 75 | 76 | Map toJson() => { 77 | "id": id, 78 | "username": username, 79 | "name": name, 80 | "first_name": firstName, 81 | "last_name": lastName, 82 | "email": email, 83 | "url": url, 84 | "description": description, 85 | "link": link, 86 | "locale": locale, 87 | "nickname": nickname, 88 | "slug": slug, 89 | "roles": List.from(roles.map((x) => x)), 90 | "registered_date": registeredDate.toIso8601String(), 91 | "capabilities": capabilities.toJson(), 92 | "extra_capabilities": extraCapabilities.toJson(), 93 | "avatar_urls": Map.from(avatarUrls).map((k, v) => MapEntry(k, v)), 94 | "meta": List.from(meta.map((x) => x)), 95 | "_links": links.toJson(), 96 | }; 97 | } 98 | 99 | class Capabilities { 100 | bool read; 101 | bool level0; 102 | bool uploadFiles; 103 | bool deletePublishedPosts; 104 | bool subscriber; 105 | 106 | Capabilities({ 107 | this.read, 108 | this.level0, 109 | this.uploadFiles, 110 | this.deletePublishedPosts, 111 | this.subscriber, 112 | }); 113 | 114 | factory Capabilities.fromJson(Map json) => Capabilities( 115 | read: json["read"], 116 | level0: json["level_0"], 117 | uploadFiles: json["upload_files"], 118 | deletePublishedPosts: json["delete_published_posts"], 119 | subscriber: json["subscriber"], 120 | ); 121 | 122 | Map toJson() => { 123 | "read": read, 124 | "level_0": level0, 125 | "upload_files": uploadFiles, 126 | "delete_published_posts": deletePublishedPosts, 127 | "subscriber": subscriber, 128 | }; 129 | } 130 | 131 | class ExtraCapabilities { 132 | bool subscriber; 133 | 134 | ExtraCapabilities({ 135 | this.subscriber, 136 | }); 137 | 138 | factory ExtraCapabilities.fromJson(Map json) => ExtraCapabilities( 139 | subscriber: json["subscriber"], 140 | ); 141 | 142 | Map toJson() => { 143 | "subscriber": subscriber, 144 | }; 145 | } 146 | 147 | class Links { 148 | List self; 149 | List collection; 150 | 151 | Links({ 152 | this.self, 153 | this.collection, 154 | }); 155 | 156 | factory Links.fromJson(Map json) => Links( 157 | self: List.from(json["self"].map((x) => Collection.fromJson(x))), 158 | collection: List.from(json["collection"].map((x) => Collection.fromJson(x))), 159 | ); 160 | 161 | Map toJson() => { 162 | "self": List.from(self.map((x) => x.toJson())), 163 | "collection": List.from(collection.map((x) => x.toJson())), 164 | }; 165 | } 166 | 167 | class Collection { 168 | String href; 169 | 170 | Collection({ 171 | this.href, 172 | }); 173 | 174 | factory Collection.fromJson(Map json) => Collection( 175 | href: json["href"], 176 | ); 177 | 178 | Map toJson() => { 179 | "href": href, 180 | }; 181 | } 182 | -------------------------------------------------------------------------------- /lib/pages/ads_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wordpress/models/ads_model.dart'; 3 | import 'package:flutter_wordpress/preferences/user_preferences.dart'; 4 | import 'package:flutter_wordpress/providers/ads_provider.dart'; 5 | 6 | class AdsPage extends StatelessWidget { 7 | final prefs = new UserPreferences(); 8 | final ads = new AdsProvider(); 9 | static final String routename = 'pages'; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | prefs.lastPage = AdsPage.routename; 14 | 15 | return Scaffold( 16 | appBar: AppBar( 17 | title: Text('ADS'), 18 | actions: [ 19 | IconButton( 20 | icon: Icon(Icons.local_post_office), 21 | onPressed: () { 22 | Navigator.pushReplacementNamed(context, 'post'); 23 | }, 24 | ), 25 | ], 26 | ), 27 | body: Container( 28 | padding: EdgeInsets.only( 29 | left: MediaQuery.of(context).size.width * 0.05, 30 | right: MediaQuery.of(context).size.width * 0.05, 31 | top: MediaQuery.of(context).size.height * 0.05, 32 | ), 33 | child: FutureBuilder( 34 | future: ads.getAds(), 35 | builder: (BuildContext context, AsyncSnapshot> snapshot) { 36 | if (snapshot.connectionState == ConnectionState.done) { 37 | if (snapshot.hasError) { 38 | return Text('Error: ${snapshot.error}'); 39 | } else { 40 | return ListView.builder( 41 | itemCount: snapshot.data.length, 42 | itemBuilder: (context, int index) { 43 | return Container( 44 | margin: EdgeInsets.only( 45 | bottom: MediaQuery.of(context).size.height * 0.05), 46 | child: Row( 47 | mainAxisAlignment: MainAxisAlignment.spaceAround, 48 | children: [ 49 | Column( 50 | mainAxisAlignment: MainAxisAlignment.spaceAround, 51 | crossAxisAlignment: CrossAxisAlignment.start, 52 | children: [ 53 | Row( 54 | children: [ 55 | _showAuthorAvatar(context, 56 | snapshot.data[index].author.avatar), 57 | SizedBox(width: 10,), 58 | _showTitle(context, 59 | 'Nick: ${snapshot.data[index].author.nickname}'), 60 | ], 61 | ), 62 | _showTitle(context, 'Ad Title: ${snapshot.data[index].title}'), 63 | _showTitle( 64 | context, 65 | 'Ad Category: ${snapshot.data[index].advertCategory[0].name}', 66 | ), 67 | ], 68 | ), 69 | _showImage(context, 70 | snapshot.data[index].featuredImage.large), 71 | ], 72 | ), 73 | ); 74 | }, 75 | ); 76 | } 77 | } else { 78 | return Container( 79 | height: MediaQuery.of(context).size.height * 0.8, 80 | alignment: Alignment.center, 81 | child: CircularProgressIndicator(), 82 | ); 83 | } 84 | }, 85 | ), 86 | ), 87 | ); 88 | } 89 | 90 | Widget _showImage(BuildContext context, String img) { 91 | return Container( 92 | // color: Colors.pinkAccent, 93 | child: ClipRRect( 94 | borderRadius: BorderRadius.circular(20.0), 95 | child: FadeInImage( 96 | height: MediaQuery.of(context).size.height * 0.25, 97 | width: MediaQuery.of(context).size.width * 0.4, 98 | image: NetworkImage(img), 99 | placeholder: AssetImage('assets/img/no-image.jpg'), 100 | fit: BoxFit.cover, 101 | ), 102 | ), 103 | ); 104 | } 105 | 106 | Widget _showTitle(BuildContext context, String title) { 107 | return Container( 108 | child: Text(title), 109 | ); 110 | } 111 | 112 | 113 | 114 | Widget _showAuthorAvatar(BuildContext context, String author) { 115 | return Container( 116 | child: ClipRRect( 117 | borderRadius: BorderRadius.circular(20.0), 118 | child: FadeInImage( 119 | height: MediaQuery.of(context).size.height * 0.1, 120 | width: MediaQuery.of(context).size.width * 0.15, 121 | image: NetworkImage(author), 122 | placeholder: AssetImage('assets/img/no-image.jpg'), 123 | fit: BoxFit.cover, 124 | ), 125 | ), 126 | ); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /lib/pages/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wordpress/bloc/provider.dart'; 3 | import 'package:flutter_wordpress/providers/user_provider.dart'; 4 | import 'package:flutter_wordpress/utils/utils.dart'; 5 | 6 | class LoginPage extends StatelessWidget { 7 | final userProvider = new UserProvider(); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final bloc = Provider.login(context); 12 | final media = MediaQuery.of(context); 13 | final theme = Theme.of(context); 14 | return Scaffold( 15 | body: Center( 16 | child: ListView( 17 | children: [ 18 | Column( 19 | children: [ 20 | Container( 21 | height: media.size.height * 0.3, 22 | width: media.size.width * 1, 23 | padding: EdgeInsets.only(top: media.size.height * 0.01), 24 | alignment: Alignment.center, 25 | child: FlutterLogo( 26 | size: media.size.height * 0.5, 27 | ), 28 | ), 29 | Container( 30 | height: media.size.height * 0.66, 31 | width: media.size.width * 1, 32 | alignment: Alignment.center, 33 | //color: Colors.greenAccent, 34 | child: Column( 35 | crossAxisAlignment: CrossAxisAlignment.center, 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | children: [ 38 | _usernameField(media, bloc), 39 | _passwordField(media, bloc), 40 | _divider(media), 41 | _buttonsSignIn( media, theme, bloc), 42 | _buttonRegister(context, media, theme), 43 | ], 44 | ), 45 | ), 46 | ], 47 | ), 48 | ], 49 | ), 50 | ), 51 | ); 52 | } 53 | 54 | Widget _usernameField(MediaQueryData media, LoginBloc bloc) { 55 | return StreamBuilder( 56 | stream: bloc.emailStream, 57 | builder: (BuildContext context, AsyncSnapshot snapshot) { 58 | return Container( 59 | padding: EdgeInsets.only( 60 | right: media.size.width * 0.1, 61 | left: media.size.width * 0.05, 62 | ), 63 | child: TextField( 64 | keyboardType: TextInputType.emailAddress, 65 | decoration: InputDecoration( 66 | icon: Icon( 67 | Icons.alternate_email, 68 | color: Colors.pink, 69 | ), 70 | border: OutlineInputBorder(), 71 | labelText: 'Email', 72 | errorText: snapshot.error, 73 | hintText: snapshot.data, 74 | counterText: snapshot.data, 75 | ), 76 | onChanged: bloc.changeEmail, 77 | ), 78 | ); 79 | }, 80 | ); 81 | } 82 | 83 | Widget _passwordField(MediaQueryData media, LoginBloc bloc) { 84 | return StreamBuilder( 85 | stream: bloc.passwordStream, 86 | builder: (context, snapshot) { 87 | return Container( 88 | padding: EdgeInsets.only( 89 | right: media.size.width * 0.1, 90 | left: media.size.width * 0.05, 91 | top: media.size.width * 0.1), 92 | child: TextField( 93 | obscureText: true, 94 | keyboardType: TextInputType.text, 95 | decoration: InputDecoration( 96 | icon: Icon( 97 | Icons.vpn_key, 98 | color: Colors.pink, 99 | ), 100 | border: OutlineInputBorder(), 101 | labelText: 'Password', 102 | errorText: snapshot.error), 103 | onChanged: bloc.changePassword, 104 | ), 105 | ); 106 | }); 107 | } 108 | 109 | Widget _divider(MediaQueryData media) { 110 | return Container( 111 | padding: EdgeInsets.only( 112 | top: media.size.height * 0.04, bottom: media.size.height * 0.05), 113 | child: Divider( 114 | color: Colors.pink, 115 | height: media.size.height * 0.01, 116 | indent: 20.0, 117 | endIndent: 20.0, 118 | ), 119 | ); 120 | } 121 | 122 | Widget _buttonsSignIn(MediaQueryData media, ThemeData theme, LoginBloc bloc) { 123 | return StreamBuilder( 124 | stream: bloc.formValidLoginStream, 125 | builder: (context, snapshot) { 126 | return RaisedButton( 127 | child: Container( 128 | alignment: Alignment.center, 129 | width: media.size.width * 0.8, 130 | height: media.size.height * 0.06, 131 | child: Text( 132 | 'Log In', 133 | style: TextStyle( 134 | fontFamily: theme.textTheme.button.fontFamily, 135 | fontSize: theme.textTheme.button.fontSize, 136 | color: theme.textTheme.button.color, 137 | ), 138 | ), 139 | ), 140 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)), 141 | elevation: 0.0, 142 | color: Colors.pinkAccent, 143 | onPressed: snapshot.hasData ? () => _login(context, bloc) : null, 144 | ); 145 | } 146 | ); 147 | } 148 | 149 | _login(BuildContext context, LoginBloc bloc)async{ 150 | Map info = await userProvider.login(bloc.email, bloc.password); 151 | 152 | if(info['ok']){ 153 | Navigator.pushReplacementNamed(context, 'post'); 154 | }else{ 155 | showAlert(context, 'User or password incorrect'); 156 | } 157 | 158 | } 159 | 160 | Widget _buttonRegister( 161 | BuildContext context, MediaQueryData media, ThemeData theme) { 162 | return FlatButton( 163 | child: Text( 164 | "Don't have an Account? Click Here for Register", 165 | textAlign: TextAlign.center, 166 | style: TextStyle( 167 | fontFamily: theme.textTheme.body1.fontFamily, 168 | fontSize: theme.textTheme.body1.fontSize, 169 | color: theme.textTheme.body1.color), 170 | ), 171 | onPressed: () { 172 | Navigator.pushReplacementNamed(context, 'post'); 173 | }, 174 | ); 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /lib/pages/post_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wordpress/preferences/user_preferences.dart'; 3 | 4 | import 'package:flutter_wordpress/providers/post_provider.dart'; 5 | 6 | class PostPage extends StatelessWidget { 7 | final postProvider = new PostProvider(); 8 | final prefs = new UserPreferences(); 9 | static final String routename = 'post'; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | prefs.lastPage = PostPage.routename; 14 | return Scaffold( 15 | appBar: AppBar( 16 | title: Text("WordPress APi"), 17 | backgroundColor: Colors.blueAccent, 18 | actions: [ 19 | IconButton( 20 | icon: Icon(Icons.whatshot), 21 | onPressed: () { 22 | Navigator.pushReplacementNamed(context, 'ads'); 23 | }, 24 | ), 25 | IconButton( 26 | icon: Icon(Icons.exit_to_app), 27 | onPressed: () { 28 | Navigator.pushReplacementNamed(context, '/'); 29 | }, 30 | ), 31 | ], 32 | ), 33 | body: Container( 34 | child: showPosts(), 35 | ), 36 | ); 37 | } 38 | 39 | Widget showPosts() { 40 | //postProvider.getPosts(); 41 | return FutureBuilder( 42 | future: postProvider.getPosts(), 43 | builder: (BuildContext context, AsyncSnapshot snapshot) { 44 | if (snapshot.connectionState == ConnectionState.done) { 45 | if (snapshot.hasError) { 46 | return Text('Error: ${snapshot.error}'); 47 | } else { 48 | return ListView.builder( 49 | itemCount: snapshot.data.length, 50 | itemBuilder: (BuildContext context, int index) { 51 | return Container( 52 | //color: Colors.greenAccent, 53 | width: MediaQuery.of(context).size.width * 1, 54 | height: MediaQuery.of(context).size.height * 0.65, 55 | padding: EdgeInsets.only(bottom: 5.0), 56 | child: Column( 57 | // crossAxisAlignment: CrossAxisAlignment.center, 58 | //mainAxisAlignment: MainAxisAlignment.center, 59 | children: [ 60 | // Text(snapshot.data['title']) 61 | _showText(context, snapshot.data[index].title), 62 | _showImage(context, snapshot.data[index].featuredImage.medium), 63 | ], 64 | ), 65 | ); 66 | }); 67 | } 68 | } 69 | return Container( 70 | height: MediaQuery.of(context).size.height * 0.8, 71 | alignment: Alignment.center, 72 | child: CircularProgressIndicator(), 73 | ); 74 | }, 75 | ); 76 | } 77 | 78 | Widget _showText(BuildContext context, String text) { 79 | return Container( 80 | //color: Colors.purpleAccent, 81 | height: MediaQuery.of(context).size.height * 0.1, 82 | width: MediaQuery.of(context).size.width * 0.8, 83 | alignment: Alignment.center, 84 | child: Text( 85 | text, 86 | style: TextStyle(fontSize: 15), 87 | ), 88 | ); 89 | } 90 | 91 | Widget _showImage(BuildContext context, var img) { 92 | if (img == false || img == null) { 93 | return Container( 94 | child: ClipRRect( 95 | borderRadius: BorderRadius.circular(20.0), 96 | child: FadeInImage( 97 | height: MediaQuery.of(context).size.height * 0.5, 98 | width: MediaQuery.of(context).size.width * 0.8, 99 | image: AssetImage('assets/img/no-image.jpg'), 100 | placeholder: AssetImage('assets/img/loading.gif'), 101 | fit: BoxFit.cover, 102 | ), 103 | ), 104 | ); 105 | } else { 106 | return Container( 107 | child: ClipRRect( 108 | borderRadius: BorderRadius.circular(20.0), 109 | child: FadeInImage( 110 | height: MediaQuery.of(context).size.height * 0.5, 111 | width: MediaQuery.of(context).size.width * 0.8, 112 | image: NetworkImage(img), 113 | placeholder: AssetImage('assets/img/loading.gif'), 114 | fit: BoxFit.cover, 115 | ), 116 | ), 117 | ); 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /lib/pages/register_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wordpress/bloc/provider.dart'; 3 | import 'package:flutter_wordpress/providers/user_provider.dart'; 4 | import 'package:flutter_wordpress/utils/utils.dart'; 5 | 6 | class RegisterPage extends StatelessWidget { 7 | final userProvider = new UserProvider(); 8 | 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | final bloc = Provider.regis(context); 13 | final media = MediaQuery.of(context); 14 | final theme = Theme.of(context); 15 | return Scaffold( 16 | body: Center( 17 | child: ListView( 18 | children: [ 19 | Column( 20 | children: [ 21 | Container( 22 | height: media.size.height * 0.3, 23 | width: media.size.width * 1, 24 | padding: EdgeInsets.only(top: media.size.height * 0.01), 25 | alignment: Alignment.center, 26 | child: FlutterLogo( 27 | size: media.size.height * 0.5, 28 | ), 29 | ), 30 | Container( 31 | height: media.size.height * 0.66, 32 | width: media.size.width * 1, 33 | alignment: Alignment.center, 34 | //color: Colors.greenAccent, 35 | child: Column( 36 | crossAxisAlignment: CrossAxisAlignment.center, 37 | mainAxisAlignment: MainAxisAlignment.center, 38 | children: [ 39 | _usernameField(media, bloc), 40 | _emailField( media, bloc), 41 | _passwordField( media, bloc), 42 | _divider(media), 43 | _buttonRegisterUser(media, theme, bloc), 44 | _comebackLogin(context, media, theme), 45 | ], 46 | ), 47 | ), 48 | ], 49 | ), 50 | ], 51 | ), 52 | ), 53 | ); 54 | } 55 | 56 | Widget _usernameField( MediaQueryData media, RegisterBloc bloc) { 57 | return StreamBuilder( 58 | stream: bloc.usernameStream, 59 | builder: (context, snapshot) { 60 | return Container( 61 | padding: EdgeInsets.only( 62 | right: media.size.width * 0.1, 63 | left: media.size.width * 0.05, 64 | ), 65 | child: TextField( 66 | keyboardType: TextInputType.text, 67 | decoration: InputDecoration( 68 | icon: Icon( 69 | Icons.person, 70 | color: Colors.pink, 71 | ), 72 | border: OutlineInputBorder(), 73 | labelText: 'Username', 74 | errorText: snapshot.error 75 | ), 76 | onChanged: bloc.changeUsername, 77 | ), 78 | ); 79 | } 80 | ); 81 | } 82 | 83 | Widget _emailField( MediaQueryData media, RegisterBloc bloc) { 84 | return StreamBuilder( 85 | stream: bloc.emailStream, 86 | builder: (context, snapshot) { 87 | return Container( 88 | padding: EdgeInsets.only( 89 | right: media.size.width * 0.1, 90 | left: media.size.width * 0.05, 91 | top: media.size.width * 0.05 92 | ), 93 | child: TextField( 94 | keyboardType: TextInputType.emailAddress, 95 | decoration: InputDecoration( 96 | icon: Icon( 97 | Icons.alternate_email, 98 | color: Colors.pink, 99 | ), 100 | border: OutlineInputBorder(), 101 | labelText: 'Email', 102 | errorText: snapshot.error 103 | ), 104 | onChanged: bloc.changeEmail, 105 | ), 106 | ); 107 | } 108 | ); 109 | } 110 | 111 | Widget _passwordField( MediaQueryData media, RegisterBloc bloc) { 112 | return StreamBuilder( 113 | stream: bloc.passwordStream, 114 | builder: (context, snapshot) { 115 | return Container( 116 | padding: EdgeInsets.only( 117 | right: media.size.width * 0.1, 118 | left: media.size.width * 0.05, 119 | top: media.size.width * 0.05 120 | ), 121 | child: TextField( 122 | obscureText: true, 123 | keyboardType: TextInputType.text, 124 | decoration: InputDecoration( 125 | icon: Icon( 126 | Icons.vpn_key, 127 | color: Colors.pink, 128 | ), 129 | border: OutlineInputBorder(), 130 | labelText: 'Password', 131 | errorText: snapshot.error 132 | ), 133 | onChanged: bloc.changePassword, 134 | ), 135 | ); 136 | } 137 | ); 138 | } 139 | 140 | Widget _divider(MediaQueryData media) { 141 | return Container( 142 | padding: EdgeInsets.only( 143 | top: media.size.height * 0.04, bottom: media.size.height * 0.05), 144 | child: Divider( 145 | color: Colors.pink, 146 | height: media.size.height * 0.01, 147 | indent: 20.0, 148 | endIndent: 20.0, 149 | ), 150 | ); 151 | } 152 | 153 | Widget _buttonRegisterUser(MediaQueryData media, ThemeData theme, RegisterBloc bloc) { 154 | return StreamBuilder( 155 | stream: bloc.formValidRegisterStream, 156 | builder: (context, snapshot) { 157 | return RaisedButton( 158 | child: Container( 159 | alignment: Alignment.center, 160 | width: media.size.width * 0.8, 161 | height: media.size.height * 0.06, 162 | child: Text( 163 | 'Register User', 164 | style: TextStyle( 165 | fontFamily: theme.textTheme.button.fontFamily, 166 | fontSize: theme.textTheme.button.fontSize, 167 | color: theme.textTheme.button.color, 168 | ), 169 | ), 170 | ), 171 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)), 172 | elevation: 0.0, 173 | color: Colors.pinkAccent, 174 | onPressed: snapshot.hasData ? () => _registerUser(context, bloc) : null, 175 | 176 | ); 177 | } 178 | ); 179 | } 180 | 181 | _registerUser(BuildContext context, RegisterBloc bloc) async{ 182 | Map info = await userProvider.registerUser(bloc.username, bloc.email, bloc.password); 183 | 184 | if(info['ok']){ 185 | showAlert(context, info['mensaje']); 186 | Navigator.pushReplacementNamed(context, '/'); 187 | }else{ 188 | showAlert(context, info['mensaje']); 189 | } 190 | 191 | } 192 | 193 | Widget _comebackLogin( 194 | BuildContext context, MediaQueryData media, ThemeData theme) { 195 | return Container( 196 | child: FlatButton( 197 | child: Text( 198 | "Have an Account? Click Here for Login", 199 | textAlign: TextAlign.center, 200 | style: TextStyle( 201 | fontFamily: theme.textTheme.body1.fontFamily, 202 | fontSize: theme.textTheme.body1.fontSize, 203 | color: theme.textTheme.body1.color), 204 | ), 205 | onPressed: () { 206 | Navigator.pushReplacementNamed(context, '/'); 207 | }, 208 | ), 209 | ); 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /lib/preferences/user_preferences.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class UserPreferences { 4 | 5 | static final UserPreferences _instancia = new UserPreferences._internal(); 6 | 7 | factory UserPreferences() { 8 | return _instancia; 9 | } 10 | 11 | UserPreferences._internal(); 12 | 13 | SharedPreferences _prefs; 14 | 15 | initPrefs() async { 16 | this._prefs = await SharedPreferences.getInstance(); 17 | } 18 | 19 | // GET y SET del token 20 | get token { 21 | return _prefs.getString('token') ?? ''; 22 | } 23 | 24 | set token( String value ) { 25 | _prefs.setString('token', value); 26 | } 27 | 28 | 29 | // GET y SET del lastPage 30 | get lastPage { 31 | return _prefs.getString('lastPage') ?? 'post'; 32 | } 33 | 34 | set lastPage( String value ) { 35 | _prefs.setString('lastPage', value); 36 | } 37 | 38 | 39 | } -------------------------------------------------------------------------------- /lib/providers/ads_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_wordpress/API/api.dart'; 2 | import 'package:flutter_wordpress/models/ads_model.dart'; 3 | import 'package:http/http.dart' as http; 4 | 5 | class AdsProvider{ 6 | 7 | String _url = URLDEVELOP; 8 | 9 | 10 | Future> getAds() async { 11 | final url = '$_url/wp-json/wl/v2/ads'; 12 | final resp = await http.get(url); 13 | if(resp.statusCode == 200){ 14 | final List ads = adsFromJson(resp.body); 15 | return ads; 16 | }else{ 17 | throw Exception('Failed to load Data'); 18 | } 19 | 20 | } 21 | 22 | 23 | } -------------------------------------------------------------------------------- /lib/providers/page_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_wordpress/API/api.dart'; 2 | import 'package:http/http.dart' as http; 3 | import 'package:flutter_wordpress/models/page_model.dart'; 4 | 5 | 6 | class PageProvider{ 7 | 8 | 9 | String _url = URLPOST; 10 | String _apiKey = '/wp-json/wp/v2/pages/'; 11 | 12 | 13 | Future> getPages() async { 14 | final url = Uri.http(_url, _apiKey); 15 | final resp = await http.get(url); 16 | if(resp.statusCode == 200){ 17 | final List pages = pagesFromJson(resp.body); 18 | print(pages[0].guid.rendered); 19 | return pages; 20 | 21 | }else{ 22 | throw Exception('Failed to load Data'); 23 | 24 | } 25 | } 26 | 27 | 28 | Future> getAds() async{ 29 | final url = Uri.http(_url, _apiKey,{ 30 | "include" : "4780" 31 | }); 32 | 33 | final resp = await http.get(url); 34 | if(resp.statusCode == 200){ 35 | List page = respon(resp.body); 36 | return page; 37 | }else{ 38 | throw Exception('Failed to load Data'); 39 | } 40 | } 41 | 42 | 43 | Future getInfoAds()async{ 44 | final ads = await getAds(); 45 | final list = new List(); 46 | // Expresion Regular para obtener la URL 47 | var regExp = RegExp(r'[^(src=\\")]([^"])+(png|jpg|gif)'); 48 | for (var ad in ads) { 49 | // Obtengo la Descripcion 50 | var description = ad.content.rendered; 51 | //print('Description: $description'); 52 | assert(regExp.hasMatch(description)); 53 | 54 | for (var match in regExp.allMatches(description)) { 55 | // URL ADS 56 | //print('URL: ${match[0]}'); 57 | list.add(match[0]); 58 | } 59 | 60 | } 61 | 62 | return list; 63 | 64 | } 65 | 66 | 67 | 68 | } -------------------------------------------------------------------------------- /lib/providers/post_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_wordpress/API/api.dart'; 2 | import 'package:flutter_wordpress/models/post_model.dart'; 3 | import 'package:flutter_wordpress/providers/user_provider.dart'; 4 | import 'package:http/http.dart' as http; 5 | 6 | class PostProvider{ 7 | final userProvider = UserProvider(); 8 | 9 | // Base URL for our wordpress API 10 | String _url = URLDEVELOP; 11 | 12 | // Api 13 | String _apiKey = '/wp-json/wl/v2/posts'; 14 | 15 | 16 | Future> getPosts() async { 17 | final url = '$_url$_apiKey'; 18 | final resp = await http.get(url); 19 | if(resp.statusCode == 200){ 20 | final List posts = postsFromJson(resp.body); 21 | print(posts[0].featuredImage.medium); 22 | return posts; 23 | }else{ 24 | throw Exception('Failed to load Data'); 25 | } 26 | } 27 | 28 | 29 | } -------------------------------------------------------------------------------- /lib/providers/user_provider.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_wordpress/API/api.dart'; 4 | import 'package:flutter_wordpress/preferences/user_preferences.dart'; 5 | import 'package:http/http.dart' as http; 6 | 7 | class UserProvider { 8 | // Base URL for our wordpress API 9 | final _url = URLPOSTHTTPS; 10 | final _prefs = new UserPreferences(); 11 | 12 | // Token 13 | String token = ''; 14 | 15 | Future> login(String username, String password) async { 16 | final authData = {"username": username, "password": password}; 17 | 18 | final resp = await http.post( 19 | '$_url/wp-json/jwt-auth/v1/token', 20 | headers: {'Content-type': 'application/json'}, 21 | body: json.encode(authData), 22 | ); 23 | 24 | Map decodeResp = json.decode(resp.body); 25 | 26 | if (decodeResp.containsKey('token')) { 27 | // Save TOken in storage 28 | _prefs.token = decodeResp['token']; 29 | return {'ok': true, 'token': decodeResp['token']}; 30 | } else { 31 | return {'ok': false, 'mensaje': decodeResp['message']}; 32 | } 33 | } 34 | 35 | Future> registerUser( 36 | String username, String email, String password) async { 37 | final authData = { 38 | "username": username, 39 | "email": email, 40 | "password": password 41 | }; 42 | 43 | final resp = await http.post('$_url/wp-json/wp/v2/users/register', 44 | headers: {'Content-type': 'application/json'}, 45 | body: json.encode(authData)); 46 | 47 | Map decodeResp = json.decode(resp.body); 48 | 49 | if (decodeResp['code'] == 200) { 50 | print(decodeResp['message']); 51 | return {'ok': true, 'mensaje': decodeResp['message']}; 52 | } else { 53 | print(decodeResp['message']); 54 | return {'ok': false, 'mensaje': decodeResp['message']}; 55 | } 56 | } 57 | 58 | Future logout(token) async { 59 | final url = '$_url/jwt-auth/v1/token/revoke'; 60 | final resp = 61 | await http.post(url, headers: {"Authorization": "Bearer" + token}); 62 | print(resp); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/utils/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void showAlert(BuildContext context, String sms) { 4 | showDialog( 5 | context: context, 6 | builder: (BuildContext context) { 7 | return AlertDialog( 8 | title: Text("ERROR"), 9 | content: Text( 10 | sms, 11 | ), 12 | actions: [ 13 | FlatButton( 14 | child: Text("Close"), 15 | onPressed: () { 16 | Navigator.of(context).pop(); 17 | }, 18 | ), 19 | ], 20 | ); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | cupertino_icons: 33 | dependency: "direct main" 34 | description: 35 | name: cupertino_icons 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.1.2" 39 | flutter: 40 | dependency: "direct main" 41 | description: flutter 42 | source: sdk 43 | version: "0.0.0" 44 | flutter_test: 45 | dependency: "direct dev" 46 | description: flutter 47 | source: sdk 48 | version: "0.0.0" 49 | http: 50 | dependency: "direct main" 51 | description: 52 | name: http 53 | url: "https://pub.dartlang.org" 54 | source: hosted 55 | version: "0.12.0+2" 56 | http_parser: 57 | dependency: transitive 58 | description: 59 | name: http_parser 60 | url: "https://pub.dartlang.org" 61 | source: hosted 62 | version: "3.1.3" 63 | matcher: 64 | dependency: transitive 65 | description: 66 | name: matcher 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "0.12.5" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "1.1.7" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.6.4" 84 | pedantic: 85 | dependency: transitive 86 | description: 87 | name: pedantic 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.8.0+1" 91 | quiver: 92 | dependency: transitive 93 | description: 94 | name: quiver 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "2.0.5" 98 | rxdart: 99 | dependency: "direct main" 100 | description: 101 | name: rxdart 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.22.2" 105 | shared_preferences: 106 | dependency: "direct main" 107 | description: 108 | name: shared_preferences 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.5.3+4" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.5.5" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.9.3" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.0.0" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.0.5" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.1.0" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.2.5" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.1.6" 166 | vector_math: 167 | dependency: transitive 168 | description: 169 | name: vector_math 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.0.8" 173 | sdks: 174 | dart: ">=2.2.2 <3.0.0" 175 | flutter: ">=1.5.0 <2.0.0" 176 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_wordpress 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.2.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | http: 27 | rxdart: 28 | shared_preferences: 29 | 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | 35 | 36 | 37 | 38 | # For information on the generic Dart part of this file, see the 39 | # following page: https://dart.dev/tools/pub/pubspec 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | # assets: 51 | # - images/a_dot_burr.jpeg 52 | # - images/a_dot_ham.jpeg 53 | 54 | assets: 55 | - assets/img/ 56 | 57 | # An image asset can refer to one or more resolution-specific "variants", see 58 | # https://flutter.dev/assets-and-images/#resolution-aware. 59 | 60 | # For details regarding adding assets from package dependencies, see 61 | # https://flutter.dev/assets-and-images/#from-packages 62 | 63 | # To add custom fonts to your application, add a fonts section here, 64 | # in this "flutter" section. Each entry in this list should have a 65 | # "family" key with the font family name, and a "fonts" key with a 66 | # list giving the asset and other descriptors for the font. For 67 | # example: 68 | # fonts: 69 | # - family: Schyler 70 | # fonts: 71 | # - asset: fonts/Schyler-Regular.ttf 72 | # - asset: fonts/Schyler-Italic.ttf 73 | # style: italic 74 | # - family: Trajan Pro 75 | # fonts: 76 | # - asset: fonts/TrajanPro.ttf 77 | # - asset: fonts/TrajanPro_Bold.ttf 78 | # weight: 700 79 | # 80 | # For details regarding fonts from package dependencies, 81 | # see https://flutter.dev/custom-fonts/#from-packages 82 | --------------------------------------------------------------------------------