diff --git a/.gitignore b/.gitignore index a441dcdcb..89f6918e8 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ build/ example/ios/Frameworks/ example/lib/ui/ +example_livelist/lib/application_constants.dart + .flutter-plugins-dependencies .vscode/ diff --git a/README.md b/README.md index 9a6559a0a..9ed4ae52c 100644 --- a/README.md +++ b/README.md @@ -430,6 +430,66 @@ LiveQuery server. liveQuery.client.unSubscribe(subscription); ``` +## ParseLiveList +ParseLiveList makes implementing a dynamic List as simple as possible. + + +It ships with the ParseLiveList class itself, this class manages all elements of the list, sorts them, +keeps itself up to date and Notifies you on changes. + +ParseLiveListWidget is a widget that handles all the communication with the ParseLiveList for you. +Using ParseLiveListWidget you can create a dynamic List by just providing a QueryBuilder. + +```dart +ParseLiveListWidget( + query: query, + ); +``` +To customize the List Elements, you can provide a childBuilder. +```dart +ParseLiveListWidget( + query: query, + reverse: false, + childBuilder: + (BuildContext context, bool failed, ParseObject loadedData) { + if (failed) { + return const Text('something went wrong!'); + } else if (loadedData != null) { + return ListTile( + title: Text( + loadedData.get("text"), + ), + ); + } else { + return const ListTile( + leading: CircularProgressIndicator(), + ); + } + }, +); +``` +Similar to the standard ListView, you can provide arguments like reverse or shrinkWrap. +By providing the listLoadingElement, you can show the user something while the list is loading. +```dart +ParseLiveListWidget( + query: query, + childBuilder: childBuilder, + listLoadingElement: Center( + child: CircularProgressIndicator(), + ), +); +``` +By providing the duration argument, you can change the animation speed. +```dart +ParseLiveListWidget( + query: query, + childBuilder: childBuilder, + duration: Duration(seconds: 1), +); +``` + +Note: To use this features you have to enable [Live Queries](#live-queries) first. + ## Users You can create and control users just as normal using this SDK. diff --git a/example_livelist/.gitignore b/example_livelist/.gitignore new file mode 100644 index 000000000..ae1f1838e --- /dev/null +++ b/example_livelist/.gitignore @@ -0,0 +1,37 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/example_livelist/.metadata b/example_livelist/.metadata new file mode 100644 index 000000000..01d2dcb9a --- /dev/null +++ b/example_livelist/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 0b8abb4724aa590dd0f429683339b1e045a1594d + channel: stable + +project_type: app diff --git a/example_livelist/README.md b/example_livelist/README.md new file mode 100644 index 000000000..cc179bdde --- /dev/null +++ b/example_livelist/README.md @@ -0,0 +1,9 @@ +# ParesLiveList example +Change application_constants.dart and give it a try. + +You need a class "Test" with the fields text, show and order in your database. +You have to add some data by yourself. (The app is TO simple) +(The class should be Read/Write for public) + +It's recommended to use the Parse Dashboard to manipulate the data. +This way, you will be able to hide objects and edit items, while your device is offline. \ No newline at end of file diff --git a/example_livelist/android/.gitignore b/example_livelist/android/.gitignore new file mode 100644 index 000000000..bc2100d8f --- /dev/null +++ b/example_livelist/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/example_livelist/android/app/build.gradle b/example_livelist/android/app/build.gradle new file mode 100644 index 000000000..0d54735d6 --- /dev/null +++ b/example_livelist/android/app/build.gradle @@ -0,0 +1,67 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.flutterpluginexample_livelist" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' +} diff --git a/example_livelist/android/app/src/debug/AndroidManifest.xml b/example_livelist/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..ecdeb9a6f --- /dev/null +++ b/example_livelist/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/example_livelist/android/app/src/main/AndroidManifest.xml b/example_livelist/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..dff7e72d9 --- /dev/null +++ b/example_livelist/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/example_livelist/android/app/src/main/kotlin/com/example/flutterpluginexample_livelist/MainActivity.kt b/example_livelist/android/app/src/main/kotlin/com/example/flutterpluginexample_livelist/MainActivity.kt new file mode 100644 index 000000000..624c7b88d --- /dev/null +++ b/example_livelist/android/app/src/main/kotlin/com/example/flutterpluginexample_livelist/MainActivity.kt @@ -0,0 +1,12 @@ +package com.example.flutterpluginexample_livelist + +import androidx.annotation.NonNull; +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity: FlutterActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + } +} diff --git a/example_livelist/android/app/src/main/res/drawable/launch_background.xml b/example_livelist/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/example_livelist/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/example_livelist/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example_livelist/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/example_livelist/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/example_livelist/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example_livelist/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/example_livelist/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/example_livelist/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example_livelist/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/example_livelist/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/example_livelist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example_livelist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/example_livelist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/example_livelist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example_livelist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/example_livelist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/example_livelist/android/app/src/main/res/values/styles.xml b/example_livelist/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..00fa4417c --- /dev/null +++ b/example_livelist/android/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + diff --git a/example_livelist/android/app/src/profile/AndroidManifest.xml b/example_livelist/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..ecdeb9a6f --- /dev/null +++ b/example_livelist/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/example_livelist/android/build.gradle b/example_livelist/android/build.gradle new file mode 100644 index 000000000..3100ad2d5 --- /dev/null +++ b/example_livelist/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/example_livelist/android/gradle.properties b/example_livelist/android/gradle.properties new file mode 100644 index 000000000..38c8d4544 --- /dev/null +++ b/example_livelist/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/example_livelist/android/gradle/wrapper/gradle-wrapper.properties b/example_livelist/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..296b146b7 --- /dev/null +++ b/example_livelist/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/example_livelist/android/settings.gradle b/example_livelist/android/settings.gradle new file mode 100644 index 000000000..5a2f14fb1 --- /dev/null +++ b/example_livelist/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/example_livelist/assets/parse.png b/example_livelist/assets/parse.png new file mode 100644 index 000000000..fc7e48dd6 Binary files /dev/null and b/example_livelist/assets/parse.png differ diff --git a/example_livelist/fonts/Roboto/LICENSE.txt b/example_livelist/fonts/Roboto/LICENSE.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/example_livelist/fonts/Roboto/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/example_livelist/fonts/Roboto/Roboto-Black.ttf b/example_livelist/fonts/Roboto/Roboto-Black.ttf new file mode 100644 index 000000000..689fe5cb3 Binary files /dev/null and b/example_livelist/fonts/Roboto/Roboto-Black.ttf differ diff --git a/example_livelist/fonts/Roboto/Roboto-Bold.ttf b/example_livelist/fonts/Roboto/Roboto-Bold.ttf new file mode 100644 index 000000000..d3f01ad24 Binary files /dev/null and b/example_livelist/fonts/Roboto/Roboto-Bold.ttf differ diff --git a/example_livelist/fonts/Roboto/Roboto-Light.ttf b/example_livelist/fonts/Roboto/Roboto-Light.ttf new file mode 100644 index 000000000..219063a57 Binary files /dev/null and b/example_livelist/fonts/Roboto/Roboto-Light.ttf differ diff --git a/example_livelist/fonts/Roboto/Roboto-Medium.ttf b/example_livelist/fonts/Roboto/Roboto-Medium.ttf new file mode 100644 index 000000000..1a7f3b0bb Binary files /dev/null and b/example_livelist/fonts/Roboto/Roboto-Medium.ttf differ diff --git a/example_livelist/fonts/Roboto/Roboto-Regular.ttf b/example_livelist/fonts/Roboto/Roboto-Regular.ttf new file mode 100644 index 000000000..2c97eeadf Binary files /dev/null and b/example_livelist/fonts/Roboto/Roboto-Regular.ttf differ diff --git a/example_livelist/fonts/Roboto/Roboto-Thin.ttf b/example_livelist/fonts/Roboto/Roboto-Thin.ttf new file mode 100644 index 000000000..b74a4fd1a Binary files /dev/null and b/example_livelist/fonts/Roboto/Roboto-Thin.ttf differ diff --git a/example_livelist/ios/.gitignore b/example_livelist/ios/.gitignore new file mode 100644 index 000000000..e96ef602b --- /dev/null +++ b/example_livelist/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/example_livelist/ios/Flutter/AppFrameworkInfo.plist b/example_livelist/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..6b4c0f78a --- /dev/null +++ b/example_livelist/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/example_livelist/ios/Flutter/Debug.xcconfig b/example_livelist/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..592ceee85 --- /dev/null +++ b/example_livelist/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/example_livelist/ios/Flutter/Release.xcconfig b/example_livelist/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..592ceee85 --- /dev/null +++ b/example_livelist/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/example_livelist/ios/Runner.xcodeproj/project.pbxproj b/example_livelist/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..553f2c54b --- /dev/null +++ b/example_livelist/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,518 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B80C3931E831B6300D905FE /* App.framework */, + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEBA1CF902C7004384FC /* Flutter.framework */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = "The Chromium Authors"; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterpluginexampleLivelist; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterpluginexampleLivelist; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterpluginexampleLivelist; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/example_livelist/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example_livelist/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1d526a16e --- /dev/null +++ b/example_livelist/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/example_livelist/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example_livelist/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..a28140cfd --- /dev/null +++ b/example_livelist/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_livelist/ios/Runner.xcworkspace/contents.xcworkspacedata b/example_livelist/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1d526a16e --- /dev/null +++ b/example_livelist/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/example_livelist/ios/Runner/AppDelegate.swift b/example_livelist/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/example_livelist/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..dc9ada472 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..28c6bf030 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..f091b6b0b Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cde12118 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..d0ef06e7e Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..dcdc2306c Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..c8f9ed8f5 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..75b2d164a Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..c4df70d39 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..6a84f41e1 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..d0e1f5853 Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/example_livelist/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +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. \ No newline at end of file diff --git a/example_livelist/ios/Runner/Base.lproj/LaunchScreen.storyboard b/example_livelist/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/example_livelist/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_livelist/ios/Runner/Base.lproj/Main.storyboard b/example_livelist/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/example_livelist/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example_livelist/ios/Runner/Info.plist b/example_livelist/ios/Runner/Info.plist new file mode 100644 index 000000000..1622792f9 --- /dev/null +++ b/example_livelist/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + flutterpluginexample_livelist + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/example_livelist/ios/Runner/Runner-Bridging-Header.h b/example_livelist/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..7335fdf90 --- /dev/null +++ b/example_livelist/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/example_livelist/lib/application_constants.dart b/example_livelist/lib/application_constants.dart new file mode 100644 index 000000000..472dce179 --- /dev/null +++ b/example_livelist/lib/application_constants.dart @@ -0,0 +1,6 @@ +const String keyApplicationName = ''; +const String keyParseApplicationId = ''; +const String keyParseMasterKey = ''; +const String keyParseServerUrl = ''; +const String keyParseLiveServerUrl = ''; +const bool keyDebug = true; diff --git a/example_livelist/lib/main.dart b/example_livelist/lib/main.dart new file mode 100644 index 000000000..546c3dfe9 --- /dev/null +++ b/example_livelist/lib/main.dart @@ -0,0 +1,192 @@ +import 'package:flutter/material.dart'; +import 'package:parse_server_sdk/parse_server_sdk.dart'; + +import 'application_constants.dart'; + +void main() => runApp(MyApp()); + +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => _MyAppState(); +} + +class _MyAppState extends State { + bool initFailed; + + QueryBuilder _queryBuilder; + + @override + void initState() { + super.initState(); + initData().then((bool success) { + setState(() { + initFailed = !success; + if (success) + _queryBuilder = QueryBuilder(ParseObject('Test')) + ..orderByAscending('order'); + ; + }); + }).catchError((dynamic _) { + setState(() { + initFailed = true; + }); + }); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('LiveList example app'), + ), + body: initFailed == false + ? buildBody(context) + : Container( + height: double.infinity, + alignment: Alignment.center, + child: initFailed == null + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: const [ + CircularProgressIndicator(), + Text('Connecting to the server...'), + ], + ) + : const Text('Connecting to the server failed!'), + ), + ), + ); + } + + Future initData() async { + await Parse().initialize( + keyParseApplicationId, + keyParseServerUrl, + clientKey: keyParseClientKey, + debug: true, + liveQueryUrl: keyParseLiveServerUrl, + ); + + return (await Parse().healthCheck()).success; + } + + Widget buildBody(BuildContext context) { + final GlobalKey<_ObjectFormState> objectFormKey = + GlobalKey<_ObjectFormState>(); + return Column( + children: [ + Expanded( + child: ParseLiveListWidget( + query: _queryBuilder, + duration: const Duration(seconds: 1), + childBuilder: + (BuildContext context, bool failed, ParseObject loadedData) { + if (failed) { + return const Text('something went wrong!'); + } else if (loadedData != null) { + return ListTile( + title: Row( + children: [ + Flexible( + child: Text(loadedData.get('order').toString()), + flex: 1, + ), + Flexible( + child: Container( + alignment: Alignment.center, + child: Text( + loadedData.get('text'), + ), + ), + flex: 10, + ), + ], + ), + onLongPress: () { + objectFormKey.currentState.setObject(loadedData); + }, + ); + } else { + return const ListTile( + leading: CircularProgressIndicator(), + ); + } + }), + ), + Container( + color: Colors.black12, + child: ObjectForm( + key: objectFormKey, + ), + ) + ], + ); + } +} + +class ObjectForm extends StatefulWidget { + const ObjectForm({Key key}) : super(key: key); + + @override + _ObjectFormState createState() => _ObjectFormState(); +} + +class _ObjectFormState extends State { + ParseObject _currentObject; + final GlobalKey _formKey = GlobalKey(); + + void setObject(ParseObject object) { + setState(() { + _currentObject = object; + }); + } + + @override + Widget build(BuildContext context) { + return _currentObject == null + ? Container() + : Form( + key: _formKey, + child: ListTile( + key: UniqueKey(), + title: Row( + children: [ + Flexible( + flex: 1, + child: TextFormField( + initialValue: _currentObject.get('order').toString(), + keyboardType: TextInputType.number, + onSaved: (String value) { + _currentObject.set('order', int.parse(value)); + }, + ), + ), + Flexible( + flex: 10, + child: TextFormField( + initialValue: _currentObject.get('text'), + onSaved: (String value) { + _currentObject.set('text', value); + }, + ), + ) + ], + ), + trailing: IconButton( + icon: Icon(Icons.save), + onPressed: () { + setState(() { + _formKey.currentState.save(); + final ParseObject object = _currentObject; + Future.delayed(const Duration(seconds: 1)) + .then((_) { + object.save(); + }); + _currentObject = null; + }); + }), + ), + ); + } +} diff --git a/example_livelist/pubspec.yaml b/example_livelist/pubspec.yaml new file mode 100644 index 000000000..05bc5d4d5 --- /dev/null +++ b/example_livelist/pubspec.yaml @@ -0,0 +1,60 @@ +name: flutterpluginexample_livelist +description: A simple example for using ParseLiveQuery. + +version: 1.0.0+1 + +dependencies: + flutter: + sdk: flutter + parse_server_sdk: + path: ../ + + cupertino_icons: ^0.1.2 + +dev_dependencies: + flutter_test: + sdk: flutter + mockito: ^4.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://www.dartlang.org/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + # - images/a_dot_burr.jpeg + - assets/parse.png + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.io/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.io/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + fonts: + - family: Roboto + fonts: + - asset: fonts/Roboto/Roboto-Thin.ttf + weight: 100 + - asset: fonts/Roboto/Roboto-Light.ttf + weight: 300 + - asset: fonts/Roboto/Roboto-Regular.ttf + weight: 400 + - asset: fonts/Roboto/Roboto-Medium.ttf + weight: 500 + - asset: fonts/Roboto/Roboto-Bold.ttf + weight: 700 + - asset: fonts/Roboto/Roboto-Black.ttf + weight: 900 diff --git a/example_livelist/test/widget_test.dart b/example_livelist/test/widget_test.dart new file mode 100644 index 000000000..5d0d1e727 --- /dev/null +++ b/example_livelist/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:flutterpluginexample_livelist/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/lib/parse_server_sdk.dart b/lib/parse_server_sdk.dart index 69483c77c..c8950d096 100644 --- a/lib/parse_server_sdk.dart +++ b/lib/parse_server_sdk.dart @@ -21,6 +21,7 @@ import 'package:xxtea/xxtea.dart'; export 'src/network/parse_live_query.dart' if (dart.library.js) 'src/network/parse_live_query_web.dart'; +export 'src/utils/parse_live_list.dart'; part 'package:parse_server_sdk/src/objects/response/parse_error_response.dart'; diff --git a/lib/src/utils/parse_live_list.dart b/lib/src/utils/parse_live_list.dart new file mode 100644 index 000000000..cab7187d2 --- /dev/null +++ b/lib/src/utils/parse_live_list.dart @@ -0,0 +1,500 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; + +import '../../parse_server_sdk.dart'; + +class ParseLiveList { + ParseLiveList._(this._query); + + static Future> create( + QueryBuilder _query) { + final ParseLiveList parseLiveList = ParseLiveList._(_query); + + return parseLiveList._init().then((_) { + return parseLiveList; + }); + } + + List> _list = List>(); + StreamController> _eventStreamController; + int _nextID = 0; + + /// is object1 listed after object2? + /// can return null + bool after(T object1, T object2) { + List fields = List(); + + if (_query.limiters.containsKey('order')) { + fields = _query.limiters['order'].toString().split(','); + } + fields.add(keyVarCreatedAt); + for (String key in fields) { + bool reverse = false; + if (key.startsWith('-')) { + reverse = true; + key = key.substring(1); + } + final dynamic val1 = object1.get(key); + final dynamic val2 = object2.get(key); + + if (val1 == null && val2 == null) break; + if (val1 == null) return reverse; + if (val2 == null) return !reverse; + + if (val1 is num && val2 is num) { + if ((val1 as num) < (val2 as num)) return reverse; + if ((val1 as num) > (val2 as num)) return !reverse; + } else if (val1 is String && val2 is String) { + if (val1.toString().compareTo(val2) < 0) return reverse; + if (val1.toString().compareTo(val2) > 0) return !reverse; + } else if (val1 is DateTime && val2 is DateTime) { + if ((val1 as DateTime).isAfter(val2)) return !reverse; + if ((val1 as DateTime).isBefore(val2)) return reverse; + } + } + return null; + } + + int get nextID => _nextID++; + + final QueryBuilder _query; + + int get size { + return _list.length; + } + + Stream> get stream => _eventStreamController.stream; + Subscription _liveQuerySubscription; + StreamSubscription _liveQueryClientEventSubscription; + + Future _runQuery() async { + final QueryBuilder query = QueryBuilder.copy(_query); + if (query.limiters.containsKey('order')) { + query.keysToReturn( + query.limiters['order'].toString().split(',').map((String string) { + if (string.startsWith('-')) return string.substring(1); + return string; + }).toList()); + } else { + query.keysToReturn(List()); + } + + return await query.query(); + } + + Future _init() async { + _eventStreamController = StreamController>(); + + final ParseResponse parseResponse = await _runQuery(); + if (parseResponse.success) { + _list = parseResponse.results + .map>( + (dynamic element) => ParseLiveListElement(element)) + .toList(); + } + + LiveQuery() + .client + .subscribe(QueryBuilder.copy(_query)) + .then((Subscription subscription) { + _liveQuerySubscription = subscription; + subscription.on(LiveQueryEvent.create, _objectAdded); + subscription.on(LiveQueryEvent.update, _objectUpdated); + subscription.on(LiveQueryEvent.enter, _objectAdded); + subscription.on(LiveQueryEvent.leave, _objectDeleted); + subscription.on(LiveQueryEvent.delete, _objectDeleted); + }); + + _liveQueryClientEventSubscription = LiveQuery() + .client + .getClientEventStream + .listen((LiveQueryClientEvent event) async { + if (event == LiveQueryClientEvent.CONNECTED) { + ParseResponse parseResponse = await _runQuery(); + if (parseResponse.success) { + List newlist = parseResponse.results; + + //update List + for (int i = 0; i < _list.length; i++) { + final ParseObject currentObject = _list[i].object; + final String currentObjectId = + currentObject.get(keyVarObjectId); + + bool stillInList = false; + + for (int j = 0; j < newlist.length; j++) { + if (newlist[j].get(keyVarObjectId) == currentObjectId) { + stillInList = true; + if (newlist[j] + .get(keyVarUpdatedAt) + .isAfter(currentObject.get(keyVarUpdatedAt))) { + QueryBuilder queryBuilder = QueryBuilder.copy(_query) + ..whereEqualTo(keyVarObjectId, currentObjectId); + queryBuilder.query().then((ParseResponse result) { + if (result.success) { + _objectUpdated(result.results.first); + } + }); + } + newlist.removeAt(j); + j--; + break; + } + } + if (!stillInList) { + _objectDeleted(currentObject); + i--; + } + } + + for (int i = 0; i < newlist.length; i++) { + _objectAdded(newlist[i], loaded: false); + } + } + } + }); + } + + void _objectAdded(T object, {bool loaded = true}) { + for (int i = 0; i < _list.length; i++) { + if (after(object, _list[i].object) != true) { + _list.insert(i, ParseLiveListElement(object, loaded: loaded)); + _eventStreamController.sink.add(ParseLiveListAddEvent(i, object)); + return; + } + } + _list.add(ParseLiveListElement(object, loaded: loaded)); + _eventStreamController.sink + .add(ParseLiveListAddEvent(_list.length - 1, object)); + } + + void _objectUpdated(T object) { + for (int i = 0; i < _list.length; i++) { + if (_list[i].object.get(keyVarObjectId) == + object.get(keyVarObjectId)) { + //TODO: better soulution +// if (after(_list[i].object, object) == null) { +// _list[i].object = object; +// } else { + _list.removeAt(i).dispose(); + _eventStreamController.sink.add(ParseLiveListDeleteEvent(i, object)); + _objectAdded(object); +// } + break; + } + } + } + + void _objectDeleted(T object) { + for (int i = 0; i < _list.length; i++) { + if (_list[i].object.get(keyVarObjectId) == + object.get(keyVarObjectId)) { + _list.removeAt(i).dispose(); + _eventStreamController.sink.add(ParseLiveListDeleteEvent(i, object)); + break; + } + } + } + + Stream getAt(final int index) async* { + if (index < _list.length) { + if (!_list[index].loaded) { + final QueryBuilder queryBuilder = QueryBuilder.copy(_query) + ..whereEqualTo( + keyVarObjectId, _list[index].object.get(keyVarObjectId)) + ..setLimit(1); + final ParseResponse response = await queryBuilder.query(); + if (response.success) { + _list[index].object = response.results.first; + } else { + throw response.error; + } + } +// just for testing +// await Future.delayed(const Duration(seconds: 2)); + yield _list[index].object; + yield* _list[index].stream; + } + } + + String idOf(int index) { + if (index < _list.length) { + return _list[index].object.get(keyVarObjectId); + } + return 'NotFound'; + } + + T getLoadedAt(int index) { + if (index < _list.length && _list[index].loaded) return _list[index].object; + return null; + } + + void dispose() { + if (_liveQuerySubscription != null) { + LiveQuery().client.unSubscribe(_liveQuerySubscription); + _liveQuerySubscription = null; + } + if (_liveQueryClientEventSubscription != null) { + _liveQueryClientEventSubscription.cancel(); + _liveQueryClientEventSubscription = null; + } + while (_list.isNotEmpty) { + _list.removeLast().dispose(); + } + } +} + +class ParseLiveListElement { + ParseLiveListElement(this._object, {bool loaded = false}) { + if (_object != null) _loaded = loaded; + } + + final StreamController _streamController = StreamController.broadcast(); + T _object; + bool _loaded = false; + + Stream get stream => _streamController?.stream; + + T get object => _object; + + set object(T value) { + _loaded = true; + _object = value; + _streamController?.add(object); + } + + bool get loaded => _loaded; + + void dispose() { + _streamController.close(); + } +} + +abstract class ParseLiveListEvent { + ParseLiveListEvent(this._index, this._object); //, this._object); + + final int _index; + final T _object; + + int get index => _index; + T get object => _object; +} + +class ParseLiveListAddEvent + extends ParseLiveListEvent { + ParseLiveListAddEvent(int index, T object) : super(index, object); +} + +class ParseLiveListDeleteEvent + extends ParseLiveListEvent { + ParseLiveListDeleteEvent(int index, T object) : super(index, object); +} + +typedef Stream StreamGetter(); +typedef T DataGetter(); +typedef Widget ChildBuilder( + BuildContext context, bool failed, T loadedData); +typedef Widget RemovedItemBuilder( + BuildContext context, int index, T oldObject); + +class ParseLiveListWidget extends StatefulWidget { + const ParseLiveListWidget( + {Key key, + @required this.query, + this.listLoadingElement, + this.duration = const Duration(milliseconds: 300), + this.scrollPhysics, + this.scrollController, + this.scrollDirection = Axis.vertical, + this.padding, + this.primary, + this.reverse = false, + this.childBuilder, + this.shrinkWrap = false, + this.removedItemBuilder}) + : super(key: key); + + final QueryBuilder query; + final Widget listLoadingElement; + final Duration duration; + final ScrollPhysics scrollPhysics; + final ScrollController scrollController; + + final Axis scrollDirection; + final EdgeInsetsGeometry padding; + final bool primary; + final bool reverse; + final bool shrinkWrap; + + final ChildBuilder childBuilder; + final RemovedItemBuilder removedItemBuilder; + + @override + _ParseLiveListWidgetState createState() => + _ParseLiveListWidgetState(query, removedItemBuilder); + + static Widget defaultChildBuilder( + BuildContext context, bool failed, T loadedData) { + Widget child; + if (failed) { + child = const Text('something went wrong!'); + } else if (loadedData != null) { + child = ListTile( + title: Text( + loadedData.get(keyVarObjectId), + ), + ); + } else { + child = const ListTile( + leading: CircularProgressIndicator(), + ); + } + return child; + } +} + +class _ParseLiveListWidgetState + extends State> { + _ParseLiveListWidgetState(this._query, this.removedItemBuilder) { + ParseLiveList.create(_query).then((ParseLiveList value) { + setState(() { + _liveList = value; + _liveList.stream.listen((ParseLiveListEvent event) { + if (event is ParseLiveListAddEvent) { + if (_animatedListKey.currentState != null) + _animatedListKey.currentState + .insertItem(event.index, duration: widget.duration); + } else if (event is ParseLiveListDeleteEvent) { + _animatedListKey.currentState.removeItem( + event.index, + (BuildContext context, Animation animation) => + ParseLiveListElementWidget( + key: ValueKey(event.object?.get( + keyVarObjectId, + defaultValue: 'removingItem')), + childBuilder: widget.childBuilder ?? + ParseLiveListWidget.defaultChildBuilder, + sizeFactor: animation, + duration: widget.duration, + loadedData: () => event.object, + ), + duration: widget.duration); + } + }); + }); + }); + } + + final QueryBuilder _query; + ParseLiveList _liveList; + final GlobalKey _animatedListKey = + GlobalKey(); + final RemovedItemBuilder removedItemBuilder; + + @override + Widget build(BuildContext context) { + return _liveList == null + ? widget.listLoadingElement ?? Container() + : buildAnimatedList(); + } + + Widget buildAnimatedList() { + return AnimatedList( + key: _animatedListKey, + physics: widget.scrollPhysics, + controller: widget.scrollController, + scrollDirection: widget.scrollDirection, + padding: widget.padding, + primary: widget.primary, + reverse: widget.reverse, + shrinkWrap: widget.shrinkWrap, + initialItemCount: _liveList?.size, + itemBuilder: + (BuildContext context, int index, Animation animation) { + return ParseLiveListElementWidget( + key: ValueKey(_liveList?.idOf(index) ?? '_NotFound'), + stream: () => _liveList?.getAt(index), + loadedData: () => _liveList?.getLoadedAt(index), + sizeFactor: animation, + duration: widget.duration, + childBuilder: + widget.childBuilder ?? ParseLiveListWidget.defaultChildBuilder, + ); + }); + } + + @override + void dispose() { + _liveList.dispose(); + _liveList = null; + super.dispose(); + } +} + +class ParseLiveListElementWidget extends StatefulWidget { + const ParseLiveListElementWidget( + {Key key, + this.stream, + this.loadedData, + @required this.sizeFactor, + @required this.duration, + @required this.childBuilder}) + : super(key: key); + + final StreamGetter stream; + final DataGetter loadedData; + final Animation sizeFactor; + final Duration duration; + final ChildBuilder childBuilder; + + @override + _ParseLiveListElementWidgetState createState() { + return _ParseLiveListElementWidgetState(loadedData, stream); + } +} + +class _ParseLiveListElementWidgetState + extends State> + with SingleTickerProviderStateMixin { + _ParseLiveListElementWidgetState( + DataGetter loadedDataGetter, StreamGetter stream) { + loadedData = loadedDataGetter(); + if (stream != null) { + _streamSubscription = stream().listen((T data) { + if (widget != null) { + setState(() { + loadedData = data; + }); + } else { + loadedData = data; + } + }); + } + } + T loadedData; + bool failed = false; + StreamSubscription _streamSubscription; + bool firstBuild = true; + + @override + void dispose() { + _streamSubscription?.cancel(); + _streamSubscription = null; + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final Widget result = SizeTransition( + sizeFactor: widget.sizeFactor, + child: AnimatedSize( + duration: widget.duration, + vsync: this, + child: widget.childBuilder(context, failed, loadedData), + ), + ); + firstBuild = false; + return result; + } +}