diff --git a/drift/example/main.dart b/drift/example/main.dart index e61aec4c..f26af054 100644 --- a/drift/example/main.dart +++ b/drift/example/main.dart @@ -1,4 +1,5 @@ // For more information on using drift, please see https://drift.simonbinder.eu/docs/getting-started/ +// A full cross-platform example is available here: https://github.com/simolus3/drift/tree/develop/examples/app import 'package:drift/drift.dart'; import 'package:drift/native.dart'; diff --git a/drift_sqflite/example/.gitignore b/drift_sqflite/example/.gitignore deleted file mode 100644 index 0fa6b675..00000000 --- a/drift_sqflite/example/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# 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/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/drift_sqflite/example/.metadata b/drift_sqflite/example/.metadata deleted file mode 100644 index 5a023280..00000000 --- a/drift_sqflite/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# 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: 7e9793dee1b85a243edd0e06cb1658e98b077561 - channel: stable - -project_type: app diff --git a/drift_sqflite/example/analysis_options.yaml b/drift_sqflite/example/analysis_options.yaml deleted file mode 100644 index 61b6c4de..00000000 --- a/drift_sqflite/example/analysis_options.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/drift_sqflite/example/android/.gitignore b/drift_sqflite/example/android/.gitignore deleted file mode 100644 index 6f568019..00000000 --- a/drift_sqflite/example/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/drift_sqflite/example/android/app/build.gradle b/drift_sqflite/example/android/app/build.gradle deleted file mode 100644 index 5fe3c929..00000000 --- a/drift_sqflite/example/android/app/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -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 flutter.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.example" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - 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" -} diff --git a/drift_sqflite/example/android/app/src/debug/AndroidManifest.xml b/drift_sqflite/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index c208884f..00000000 --- a/drift_sqflite/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/drift_sqflite/example/android/app/src/main/AndroidManifest.xml b/drift_sqflite/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 3f41384d..00000000 --- a/drift_sqflite/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/drift_sqflite/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/drift_sqflite/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt deleted file mode 100644 index e793a000..00000000 --- a/drift_sqflite/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.example.example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/drift_sqflite/example/android/app/src/main/res/drawable-v21/launch_background.xml b/drift_sqflite/example/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f3..00000000 --- a/drift_sqflite/example/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/drift_sqflite/example/android/app/src/main/res/drawable/launch_background.xml b/drift_sqflite/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f8..00000000 --- a/drift_sqflite/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/drift_sqflite/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/drift_sqflite/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b..00000000 Binary files a/drift_sqflite/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/drift_sqflite/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/drift_sqflite/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79..00000000 Binary files a/drift_sqflite/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/drift_sqflite/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/drift_sqflite/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d43914..00000000 Binary files a/drift_sqflite/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/drift_sqflite/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/drift_sqflite/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d3..00000000 Binary files a/drift_sqflite/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/drift_sqflite/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/drift_sqflite/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372ee..00000000 Binary files a/drift_sqflite/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/drift_sqflite/example/android/app/src/main/res/values-night/styles.xml b/drift_sqflite/example/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 3db14bb5..00000000 --- a/drift_sqflite/example/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/drift_sqflite/example/android/app/src/main/res/values/styles.xml b/drift_sqflite/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index d460d1e9..00000000 --- a/drift_sqflite/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/drift_sqflite/example/android/app/src/profile/AndroidManifest.xml b/drift_sqflite/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index c208884f..00000000 --- a/drift_sqflite/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/drift_sqflite/example/android/build.gradle b/drift_sqflite/example/android/build.gradle deleted file mode 100644 index 4256f917..00000000 --- a/drift_sqflite/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/drift_sqflite/example/android/gradle.properties b/drift_sqflite/example/android/gradle.properties deleted file mode 100644 index 94adc3a3..00000000 --- a/drift_sqflite/example/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/drift_sqflite/example/android/gradle/wrapper/gradle-wrapper.properties b/drift_sqflite/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index bc6a58af..00000000 --- a/drift_sqflite/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#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-6.7-all.zip diff --git a/drift_sqflite/example/android/settings.gradle b/drift_sqflite/example/android/settings.gradle deleted file mode 100644 index 44e62bcf..00000000 --- a/drift_sqflite/example/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/drift_sqflite/example/ios/.gitignore b/drift_sqflite/example/ios/.gitignore deleted file mode 100644 index 7a7f9873..00000000 --- a/drift_sqflite/example/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.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/ephemeral/ -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/drift_sqflite/example/ios/Flutter/AppFrameworkInfo.plist b/drift_sqflite/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 8d4492f9..00000000 --- a/drift_sqflite/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 9.0 - - diff --git a/drift_sqflite/example/ios/Flutter/Debug.xcconfig b/drift_sqflite/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index 592ceee8..00000000 --- a/drift_sqflite/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/drift_sqflite/example/ios/Flutter/Release.xcconfig b/drift_sqflite/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 592ceee8..00000000 --- a/drift_sqflite/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/drift_sqflite/example/ios/Runner.xcodeproj/project.pbxproj b/drift_sqflite/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 6edd238e..00000000 --- a/drift_sqflite/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,481 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - 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 */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 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 = ( - ); - 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 = ""; }; - 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 = ""; }; - 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 = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 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 */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - 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 = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - 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\" embed_and_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; - 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 = 9.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; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; - 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; - 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 = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - 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 = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - 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; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; - 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; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; - 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/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/drift_sqflite/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/drift_sqflite/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/drift_sqflite/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index c87d15a3..00000000 --- a/drift_sqflite/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/drift_sqflite/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/drift_sqflite/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16..00000000 --- a/drift_sqflite/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/drift_sqflite/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/drift_sqflite/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/drift_sqflite/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/drift_sqflite/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/drift_sqflite/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/drift_sqflite/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/drift_sqflite/example/ios/Runner/AppDelegate.swift b/drift_sqflite/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4a..00000000 --- a/drift_sqflite/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -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/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab..00000000 --- a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "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/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada47..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd96..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde1211..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd96..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b860..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b860..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d3..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f585..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2f..00000000 --- a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "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/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b..00000000 --- a/drift_sqflite/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# 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/drift_sqflite/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/drift_sqflite/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7..00000000 --- a/drift_sqflite/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/drift_sqflite/example/ios/Runner/Base.lproj/Main.storyboard b/drift_sqflite/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516..00000000 --- a/drift_sqflite/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/drift_sqflite/example/ios/Runner/Info.plist b/drift_sqflite/example/ios/Runner/Info.plist deleted file mode 100644 index 5baf7a1c..00000000 --- a/drift_sqflite/example/ios/Runner/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Example - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - example - 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/drift_sqflite/example/ios/Runner/Runner-Bridging-Header.h b/drift_sqflite/example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a56..00000000 --- a/drift_sqflite/example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/drift_sqflite/example/lib/bloc.dart b/drift_sqflite/example/lib/bloc.dart deleted file mode 100644 index 89533b82..00000000 --- a/drift_sqflite/example/lib/bloc.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'package:example/database/database.dart'; -import 'package:drift/drift.dart'; -import 'package:rxdart/rxdart.dart'; - -/// Class that keeps information about a category and whether it's selected at -/// the moment. -class CategoryWithActiveInfo { - CategoryWithCount categoryWithCount; - bool isActive; - - CategoryWithActiveInfo(this.categoryWithCount, this.isActive); -} - -class TodoAppBloc { - final Database db; - - // the category that is selected at the moment. null means that we show all - // entries - final BehaviorSubject _activeCategory = - BehaviorSubject.seeded(null); - - late final Stream> _currentEntries; - - /// A stream of entries that should be displayed on the home screen. - Stream> get homeScreenEntries => _currentEntries; - - final BehaviorSubject> _allCategories = - BehaviorSubject(); - Stream> get categories => _allCategories; - - TodoAppBloc() : db = Database() { - // listen for the category to change. Then display all entries that are in - // the current category on the home screen. - _currentEntries = _activeCategory.switchMap(db.watchEntriesInCategory); - - // also watch all categories so that they can be displayed in the navigation - // drawer. - Rx.combineLatest2, Category?, - List>( - db.categoriesWithCount(), - _activeCategory, - (allCategories, selected) { - return allCategories.map((category) { - final isActive = selected?.id == category.category?.id; - - return CategoryWithActiveInfo(category, isActive); - }).toList(); - }, - ).listen(_allCategories.add); - } - - void showCategory(Category? category) { - _activeCategory.add(category); - } - - Future addCategory(String description) async { - final id = await db.createCategory(description); - - showCategory(Category(id: id, description: description)); - } - - void createEntry(String content) { - db.createEntry(TodosCompanion( - content: Value(content), - category: Value(_activeCategory.value?.id), - )); - } - - void updateEntry(TodoEntry entry) { - db.updateEntry(entry); - } - - void deleteEntry(TodoEntry entry) { - db.deleteEntry(entry); - } - - void deleteCategory(Category category) { - // if the category being deleted is the one selected, reset that state by - // showing the entries who aren't in any category - if (_activeCategory.value?.id == category.id) { - showCategory(null); - } - - db.deleteCategory(category); - } - - void close() { - db.close(); - _allCategories.close(); - } -} diff --git a/drift_sqflite/example/lib/database/database.dart b/drift_sqflite/example/lib/database/database.dart deleted file mode 100644 index d579ae9f..00000000 --- a/drift_sqflite/example/lib/database/database.dart +++ /dev/null @@ -1,161 +0,0 @@ -import 'dart:async'; -import 'package:drift_sqflite/drift_sqflite.dart'; -import 'package:drift/drift.dart'; - -part 'database.g.dart'; - -@DataClassName('TodoEntry') -class Todos extends Table { - IntColumn get id => integer().autoIncrement()(); - - TextColumn get content => text()(); - - DateTimeColumn get targetDate => dateTime().nullable()(); - - IntColumn get category => integer() - .nullable() - .customConstraint('NULLABLE REFERENCES categories(id)')(); -} - -@DataClassName('Category') -class Categories extends Table { - IntColumn get id => integer().autoIncrement()(); - - TextColumn get description => text().named('desc')(); -} - -class CategoryWithCount { - CategoryWithCount(this.category, this.count); - - // can be null, in which case we count how many entries don't have a category - final Category? category; - final int count; // amount of entries in this category -} - -class EntryWithCategory { - EntryWithCategory(this.entry, this.category); - - final TodoEntry entry; - final Category? category; -} - -@DriftDatabase( - tables: [Todos, Categories], - queries: { - '_resetCategory': 'UPDATE todos SET category = NULL WHERE category = ?', - '_categoriesWithCount': ''' - SELECT - c.id, - c.desc, - (SELECT COUNT(*) FROM todos WHERE category = c.id) AS amount - FROM categories c - UNION ALL - SELECT null, null, (SELECT COUNT(*) FROM todos WHERE category IS NULL) - ''', - }, -) -class Database extends _$Database { - Database() - : super(SqfliteQueryExecutor.inDatabaseFolder( - path: 'db.sqlite', logStatements: true)); - - @override - int get schemaVersion => 2; - - @override - MigrationStrategy get migration { - return MigrationStrategy( - onCreate: (Migrator m) { - return m.createAll(); - }, - onUpgrade: (Migrator m, int from, int to) async { - if (from == 1) { - await m.addColumn(todos, todos.targetDate); - } - }, - beforeOpen: (details) async { - if (details.wasCreated) { - // create default categories and entries - final workId = await into(categories) - .insert(const CategoriesCompanion(description: Value('Work'))); - - await into(todos).insert(TodosCompanion( - content: const Value('A first todo entry'), - targetDate: Value(DateTime.now()), - )); - - await into(todos).insert( - TodosCompanion( - content: const Value('Rework persistence code'), - category: Value(workId), - targetDate: Value( - DateTime.now().add(const Duration(days: 4)), - ), - ), - ); - } - }, - ); - } - - Stream> categoriesWithCount() { - // the _categoriesWithCount method has been generated automatically based - // on the query declared in the @DriftDatabase annotation - return _categoriesWithCount().map((row) { - final hasId = row.id != null; - final category = - hasId ? Category(id: row.id!, description: row.desc!) : null; - - return CategoryWithCount(category, row.amount); - }).watch(); - } - - /// Watches all entries in the given [category]. If the category is null, all - /// entries will be shown instead. - Stream> watchEntriesInCategory(Category? category) { - final query = select(todos).join( - [leftOuterJoin(categories, categories.id.equalsExp(todos.category))]); - - if (category != null) { - query.where(categories.id.equals(category.id)); - } else { - query.where(categories.id.isNull()); - } - - return query.watch().map((rows) { - // read both the entry and the associated category for each row - return rows.map((row) { - return EntryWithCategory( - row.readTable(todos), - row.readTableOrNull(categories), - ); - }).toList(); - }); - } - - Future createEntry(TodosCompanion entry) { - return into(todos).insert(entry); - } - - /// Updates the row in the database represents this entry by writing the - /// updated data. - Future updateEntry(TodoEntry entry) { - return update(todos).replace(entry); - } - - Future deleteEntry(TodoEntry entry) { - return delete(todos).delete(entry); - } - - Future createCategory(String description) { - return into(categories) - .insert(CategoriesCompanion(description: Value(description))); - } - - Future deleteCategory(Category category) { - return transaction(() async { - await _resetCategory(category.id); - await delete(categories).delete(category); - }); - } -} diff --git a/drift_sqflite/example/lib/database/database.g.dart b/drift_sqflite/example/lib/database/database.g.dart deleted file mode 100644 index e3629753..00000000 --- a/drift_sqflite/example/lib/database/database.g.dart +++ /dev/null @@ -1,480 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ************************************************************************** -// MoorGenerator -// ************************************************************************** - -// ignore_for_file: unnecessary_brace_in_string_interps, unnecessary_this -class TodoEntry extends DataClass implements Insertable { - final int id; - final String content; - final DateTime? targetDate; - final int? category; - TodoEntry( - {required this.id, - required this.content, - this.targetDate, - this.category}); - factory TodoEntry.fromData(Map data, {String? prefix}) { - final effectivePrefix = prefix ?? ''; - return TodoEntry( - id: const IntType() - .mapFromDatabaseResponse(data['${effectivePrefix}id'])!, - content: const StringType() - .mapFromDatabaseResponse(data['${effectivePrefix}content'])!, - targetDate: const DateTimeType() - .mapFromDatabaseResponse(data['${effectivePrefix}target_date']), - category: const IntType() - .mapFromDatabaseResponse(data['${effectivePrefix}category']), - ); - } - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['content'] = Variable(content); - if (!nullToAbsent || targetDate != null) { - map['target_date'] = Variable(targetDate); - } - if (!nullToAbsent || category != null) { - map['category'] = Variable(category); - } - return map; - } - - TodosCompanion toCompanion(bool nullToAbsent) { - return TodosCompanion( - id: Value(id), - content: Value(content), - targetDate: targetDate == null && nullToAbsent - ? const Value.absent() - : Value(targetDate), - category: category == null && nullToAbsent - ? const Value.absent() - : Value(category), - ); - } - - factory TodoEntry.fromJson(Map json, - {ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TodoEntry( - id: serializer.fromJson(json['id']), - content: serializer.fromJson(json['content']), - targetDate: serializer.fromJson(json['targetDate']), - category: serializer.fromJson(json['category']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'content': serializer.toJson(content), - 'targetDate': serializer.toJson(targetDate), - 'category': serializer.toJson(category), - }; - } - - TodoEntry copyWith( - {int? id, String? content, DateTime? targetDate, int? category}) => - TodoEntry( - id: id ?? this.id, - content: content ?? this.content, - targetDate: targetDate ?? this.targetDate, - category: category ?? this.category, - ); - @override - String toString() { - return (StringBuffer('TodoEntry(') - ..write('id: $id, ') - ..write('content: $content, ') - ..write('targetDate: $targetDate, ') - ..write('category: $category') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, content, targetDate, category); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TodoEntry && - other.id == this.id && - other.content == this.content && - other.targetDate == this.targetDate && - other.category == this.category); -} - -class TodosCompanion extends UpdateCompanion { - final Value id; - final Value content; - final Value targetDate; - final Value category; - const TodosCompanion({ - this.id = const Value.absent(), - this.content = const Value.absent(), - this.targetDate = const Value.absent(), - this.category = const Value.absent(), - }); - TodosCompanion.insert({ - this.id = const Value.absent(), - required String content, - this.targetDate = const Value.absent(), - this.category = const Value.absent(), - }) : content = Value(content); - static Insertable custom({ - Expression? id, - Expression? content, - Expression? targetDate, - Expression? category, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (content != null) 'content': content, - if (targetDate != null) 'target_date': targetDate, - if (category != null) 'category': category, - }); - } - - TodosCompanion copyWith( - {Value? id, - Value? content, - Value? targetDate, - Value? category}) { - return TodosCompanion( - id: id ?? this.id, - content: content ?? this.content, - targetDate: targetDate ?? this.targetDate, - category: category ?? this.category, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (content.present) { - map['content'] = Variable(content.value); - } - if (targetDate.present) { - map['target_date'] = Variable(targetDate.value); - } - if (category.present) { - map['category'] = Variable(category.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TodosCompanion(') - ..write('id: $id, ') - ..write('content: $content, ') - ..write('targetDate: $targetDate, ') - ..write('category: $category') - ..write(')')) - .toString(); - } -} - -class $TodosTable extends Todos with TableInfo<$TodosTable, TodoEntry> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $TodosTable(this.attachedDatabase, [this._alias]); - final VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - type: const IntType(), - requiredDuringInsert: false, - defaultConstraints: 'PRIMARY KEY AUTOINCREMENT'); - final VerificationMeta _contentMeta = const VerificationMeta('content'); - @override - late final GeneratedColumn content = GeneratedColumn( - 'content', aliasedName, false, - type: const StringType(), requiredDuringInsert: true); - final VerificationMeta _targetDateMeta = const VerificationMeta('targetDate'); - @override - late final GeneratedColumn targetDate = GeneratedColumn( - 'target_date', aliasedName, true, - type: const IntType(), requiredDuringInsert: false); - final VerificationMeta _categoryMeta = const VerificationMeta('category'); - @override - late final GeneratedColumn category = GeneratedColumn( - 'category', aliasedName, true, - type: const IntType(), - requiredDuringInsert: false, - $customConstraints: 'NULLABLE REFERENCES categories(id)'); - @override - List get $columns => [id, content, targetDate, category]; - @override - String get aliasedName => _alias ?? 'todos'; - @override - String get actualTableName => 'todos'; - @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } - if (data.containsKey('content')) { - context.handle(_contentMeta, - content.isAcceptableOrUnknown(data['content']!, _contentMeta)); - } else if (isInserting) { - context.missing(_contentMeta); - } - if (data.containsKey('target_date')) { - context.handle( - _targetDateMeta, - targetDate.isAcceptableOrUnknown( - data['target_date']!, _targetDateMeta)); - } - if (data.containsKey('category')) { - context.handle(_categoryMeta, - category.isAcceptableOrUnknown(data['category']!, _categoryMeta)); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - TodoEntry map(Map data, {String? tablePrefix}) { - return TodoEntry.fromData(data, - prefix: tablePrefix != null ? '$tablePrefix.' : null); - } - - @override - $TodosTable createAlias(String alias) { - return $TodosTable(attachedDatabase, alias); - } -} - -class Category extends DataClass implements Insertable { - final int id; - final String description; - Category({required this.id, required this.description}); - factory Category.fromData(Map data, {String? prefix}) { - final effectivePrefix = prefix ?? ''; - return Category( - id: const IntType() - .mapFromDatabaseResponse(data['${effectivePrefix}id'])!, - description: const StringType() - .mapFromDatabaseResponse(data['${effectivePrefix}desc'])!, - ); - } - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['desc'] = Variable(description); - return map; - } - - CategoriesCompanion toCompanion(bool nullToAbsent) { - return CategoriesCompanion( - id: Value(id), - description: Value(description), - ); - } - - factory Category.fromJson(Map json, - {ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return Category( - id: serializer.fromJson(json['id']), - description: serializer.fromJson(json['description']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'description': serializer.toJson(description), - }; - } - - Category copyWith({int? id, String? description}) => Category( - id: id ?? this.id, - description: description ?? this.description, - ); - @override - String toString() { - return (StringBuffer('Category(') - ..write('id: $id, ') - ..write('description: $description') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, description); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is Category && - other.id == this.id && - other.description == this.description); -} - -class CategoriesCompanion extends UpdateCompanion { - final Value id; - final Value description; - const CategoriesCompanion({ - this.id = const Value.absent(), - this.description = const Value.absent(), - }); - CategoriesCompanion.insert({ - this.id = const Value.absent(), - required String description, - }) : description = Value(description); - static Insertable custom({ - Expression? id, - Expression? description, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (description != null) 'desc': description, - }); - } - - CategoriesCompanion copyWith({Value? id, Value? description}) { - return CategoriesCompanion( - id: id ?? this.id, - description: description ?? this.description, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (description.present) { - map['desc'] = Variable(description.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('CategoriesCompanion(') - ..write('id: $id, ') - ..write('description: $description') - ..write(')')) - .toString(); - } -} - -class $CategoriesTable extends Categories - with TableInfo<$CategoriesTable, Category> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $CategoriesTable(this.attachedDatabase, [this._alias]); - final VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - type: const IntType(), - requiredDuringInsert: false, - defaultConstraints: 'PRIMARY KEY AUTOINCREMENT'); - final VerificationMeta _descriptionMeta = - const VerificationMeta('description'); - @override - late final GeneratedColumn description = GeneratedColumn( - 'desc', aliasedName, false, - type: const StringType(), requiredDuringInsert: true); - @override - List get $columns => [id, description]; - @override - String get aliasedName => _alias ?? 'categories'; - @override - String get actualTableName => 'categories'; - @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } - if (data.containsKey('desc')) { - context.handle(_descriptionMeta, - description.isAcceptableOrUnknown(data['desc']!, _descriptionMeta)); - } else if (isInserting) { - context.missing(_descriptionMeta); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - Category map(Map data, {String? tablePrefix}) { - return Category.fromData(data, - prefix: tablePrefix != null ? '$tablePrefix.' : null); - } - - @override - $CategoriesTable createAlias(String alias) { - return $CategoriesTable(attachedDatabase, alias); - } -} - -abstract class _$Database extends GeneratedDatabase { - _$Database(QueryExecutor e) : super(SqlTypeSystem.defaultInstance, e); - late final $TodosTable todos = $TodosTable(this); - late final $CategoriesTable categories = $CategoriesTable(this); - Future _resetCategory(int? var1) { - return customUpdate( - 'UPDATE todos SET category = NULL WHERE category = ?', - variables: [Variable(var1)], - updates: {todos}, - updateKind: UpdateKind.update, - ); - } - - Selectable _categoriesWithCount() { - return customSelect( - 'SELECT\n c.id,\n c.desc,\n (SELECT COUNT(*) FROM todos WHERE category = c.id) AS amount\n FROM categories c\n UNION ALL\n SELECT null, null, (SELECT COUNT(*) FROM todos WHERE category IS NULL)', - variables: [], - readsFrom: { - categories, - todos, - }).map((QueryRow row) { - return CategoriesWithCountResult( - id: row.read('id'), - desc: row.read('desc'), - amount: row.read('amount'), - ); - }); - } - - @override - Iterable get allTables => allSchemaEntities.whereType(); - @override - List get allSchemaEntities => [todos, categories]; -} - -class CategoriesWithCountResult { - final int? id; - final String? desc; - final int amount; - CategoriesWithCountResult({ - this.id, - this.desc, - required this.amount, - }); -} diff --git a/drift_sqflite/example/lib/main.dart b/drift_sqflite/example/lib/main.dart deleted file mode 100644 index 58b3a576..00000000 --- a/drift_sqflite/example/lib/main.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:example/bloc.dart'; -import 'package:provider/provider.dart'; -import 'widgets/homescreen.dart'; - -void main() => runApp(const MyApp()); - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Provider( - create: (_) => TodoAppBloc(), - dispose: (_, bloc) => bloc.close(), - child: MaterialApp( - title: 'Drift Demo', - theme: ThemeData( - primarySwatch: Colors.orange, - typography: Typography.material2018(), - ), - home: const HomeScreen(), - ), - ); - } -} diff --git a/drift_sqflite/example/lib/widgets/add_category_dialog.dart b/drift_sqflite/example/lib/widgets/add_category_dialog.dart deleted file mode 100644 index ee00c4a5..00000000 --- a/drift_sqflite/example/lib/widgets/add_category_dialog.dart +++ /dev/null @@ -1,64 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:example/bloc.dart'; -import 'package:provider/provider.dart'; - -class AddCategoryDialog extends StatefulWidget { - const AddCategoryDialog({Key? key}) : super(key: key); - - @override - _AddCategoryDialogState createState() => _AddCategoryDialogState(); -} - -class _AddCategoryDialogState extends State { - final TextEditingController _controller = TextEditingController(); - - @override - Widget build(BuildContext context) { - return Dialog( - child: Padding( - padding: const EdgeInsets.all(8), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.all(8), - child: Text( - 'Add a category', - style: Theme.of(context).textTheme.headline6, - ), - ), - TextField( - controller: _controller, - autofocus: true, - decoration: const InputDecoration( - labelText: 'Name of the category', - ), - onSubmitted: (_) => _addEntry(), - ), - ButtonBar( - children: [ - TextButton( - child: const Text('Add'), - style: ButtonStyle( - foregroundColor: MaterialStateProperty.all( - Theme.of(context).colorScheme.secondary, - ), - ), - onPressed: _addEntry, - ), - ], - ), - ], - ), - ), - ); - } - - void _addEntry() { - if (_controller.text.isNotEmpty) { - Provider.of(context, listen: false) - .addCategory(_controller.text); - Navigator.of(context).pop(); - } - } -} diff --git a/drift_sqflite/example/lib/widgets/categories_drawer.dart b/drift_sqflite/example/lib/widgets/categories_drawer.dart deleted file mode 100644 index ccfd1b32..00000000 --- a/drift_sqflite/example/lib/widgets/categories_drawer.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:example/bloc.dart'; -import 'package:example/widgets/add_category_dialog.dart'; -import 'package:provider/provider.dart'; - -class CategoriesDrawer extends StatelessWidget { - const CategoriesDrawer({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Drawer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - DrawerHeader( - child: Text( - 'Todo-List Demo with drift', - style: Theme.of(context) - .textTheme - .subtitle1 - ?.copyWith(color: Colors.white), - ), - decoration: const BoxDecoration(color: Colors.orange), - ), - Flexible( - child: StreamBuilder>( - stream: Provider.of(context).categories, - builder: (context, snapshot) { - final categories = snapshot.data ?? []; - - return ListView.builder( - itemBuilder: (context, index) { - return _CategoryDrawerEntry(entry: categories[index]); - }, - itemCount: categories.length, - ); - }, - ), - ), - const Spacer(), - Row( - children: [ - TextButton( - child: const Text('Add category'), - style: ButtonStyle( - foregroundColor: MaterialStateProperty.all( - Theme.of(context).colorScheme.secondary, - ), - ), - onPressed: () { - showDialog( - context: context, - builder: (_) => const AddCategoryDialog()); - }, - ), - ], - ), - ], - ), - ); - } -} - -class _CategoryDrawerEntry extends StatelessWidget { - final CategoryWithActiveInfo entry; - - const _CategoryDrawerEntry({Key? key, required this.entry}) : super(key: key); - - @override - Widget build(BuildContext context) { - final category = entry.categoryWithCount.category; - String title; - if (category == null) { - title = 'No category'; - } else { - title = category.description; - } - - final isActive = entry.isActive; - final bloc = Provider.of(context); - - final rowContent = [ - Text( - title, - style: TextStyle( - fontWeight: FontWeight.bold, - color: - isActive ? Theme.of(context).colorScheme.secondary : Colors.black, - ), - ), - Padding( - padding: const EdgeInsets.all(8), - child: Text('${entry.categoryWithCount.count} entries'), - ), - ]; - - // also show a delete button if the category can be deleted - if (category != null) { - rowContent.addAll([ - const Spacer(), - IconButton( - icon: const Icon(Icons.delete_outline), - color: Colors.red, - onPressed: () async { - final confirmed = await showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: const Text('Delete'), - content: Text('Really delete category $title?'), - actions: [ - TextButton( - child: const Text('Cancel'), - onPressed: () { - Navigator.pop(context, false); - }, - ), - TextButton( - child: const Text('Delete'), - style: ButtonStyle( - foregroundColor: MaterialStateProperty.all(Colors.red), - ), - onPressed: () { - Navigator.pop(context, true); - }, - ), - ], - ); - }, - ); - - if (confirmed == true) { - // can be null when the dialog is dismissed - bloc.deleteCategory(category); - } - }, - ), - ]); - } - - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Material( - color: isActive - ? Colors.orangeAccent.withOpacity(0.3) - : Colors.transparent, - borderRadius: BorderRadius.circular(8), - child: InkWell( - onTap: () { - bloc.showCategory(entry.categoryWithCount.category); - Navigator.pop(context); // close the navigation drawer - }, - child: Padding( - padding: const EdgeInsets.all(8), - child: Row( - children: rowContent, - ), - ), - ), - ), - ); - } -} diff --git a/drift_sqflite/example/lib/widgets/homescreen.dart b/drift_sqflite/example/lib/widgets/homescreen.dart deleted file mode 100644 index 75da1efc..00000000 --- a/drift_sqflite/example/lib/widgets/homescreen.dart +++ /dev/null @@ -1,98 +0,0 @@ -import 'package:flutter/material.dart' hide Column; -import 'package:flutter/widgets.dart' as f show Column; -import 'package:example/bloc.dart'; -import 'package:example/database/database.dart'; -import 'package:example/widgets/categories_drawer.dart'; -import 'package:example/widgets/todo_card.dart'; -import 'package:provider/provider.dart'; - -// ignore_for_file: prefer_const_constructors - -class HomeScreen extends StatefulWidget { - const HomeScreen({Key? key}) : super(key: key); - - @override - HomeScreenState createState() { - return HomeScreenState(); - } -} - -/// Shows a list of todos and displays a text input to add another one -class HomeScreenState extends State { - // we only use this to reset the input field at the bottom when a entry has - // been added - final TextEditingController controller = TextEditingController(); - - TodoAppBloc get bloc => Provider.of(context, listen: false); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Todo list'), - ), - drawer: CategoriesDrawer(), - body: StreamBuilder>( - stream: bloc.homeScreenEntries, - builder: (context, snapshot) { - debugPrint(snapshot.toString()); - - if (!snapshot.hasData) { - return const Align( - alignment: Alignment.center, - child: CircularProgressIndicator(), - ); - } - - final activeTodos = snapshot.data!; - - return ListView.builder( - itemCount: activeTodos.length, - itemBuilder: (context, index) { - return TodoCard(activeTodos[index].entry); - }, - ); - }, - ), - bottomSheet: Material( - elevation: 12, - child: SafeArea( - child: Padding( - padding: const EdgeInsets.all(8), - child: f.Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('What needs to be done?'), - Row( - children: [ - Expanded( - child: TextField( - controller: controller, - onSubmitted: (_) => _createTodoEntry(), - ), - ), - IconButton( - icon: Icon(Icons.send), - color: Theme.of(context).colorScheme.secondary, - onPressed: _createTodoEntry, - ), - ], - ), - ], - ), - ), - ), - ), - ); - } - - void _createTodoEntry() { - if (controller.text.isNotEmpty) { - // We write the entry here. Notice how we don't have to call setState() - // or anything - drift will take care of updating the list automatically. - bloc.createEntry(controller.text); - controller.clear(); - } - } -} diff --git a/drift_sqflite/example/lib/widgets/todo_card.dart b/drift_sqflite/example/lib/widgets/todo_card.dart deleted file mode 100644 index a07eeddd..00000000 --- a/drift_sqflite/example/lib/widgets/todo_card.dart +++ /dev/null @@ -1,79 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:example/bloc.dart'; -import 'package:example/database/database.dart'; -import 'package:example/widgets/todo_edit_dialog.dart'; -import 'package:provider/provider.dart'; - -final DateFormat _format = DateFormat.yMMMd(); - -/// Card that displays an entry and an icon button to delete that entry -class TodoCard extends StatelessWidget { - final TodoEntry entry; - - TodoCard(this.entry) : super(key: ObjectKey(entry.id)); - - @override - Widget build(BuildContext context) { - Widget dueDate; - if (entry.targetDate == null) { - dueDate = GestureDetector( - onTap: () { - // BlocProvider.provideBloc(context).db.testTransaction(entry); - }, - child: const Text( - 'No due date set', - style: TextStyle(color: Colors.grey, fontSize: 12), - ), - ); - } else { - dueDate = Text( - _format.format(entry.targetDate!), - style: const TextStyle(fontSize: 12), - ); - } - - return Card( - child: Padding( - padding: const EdgeInsets.all(8), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text(entry.content), - dueDate, - ], - ), - ), - IconButton( - icon: const Icon(Icons.edit), - color: Colors.blue, - onPressed: () { - showDialog( - context: context, - barrierDismissible: false, - builder: (ctx) => TodoEditDialog(entry: entry), - ); - }, - ), - IconButton( - icon: const Icon(Icons.delete), - color: Colors.red, - onPressed: () { - // We delete the entry here. Again, notice how we don't have to - // call setState() or inform the parent widget. Drift will take - // care of updating the underlying data automatically - Provider.of(context, listen: false) - .deleteEntry(entry); - }, - ) - ], - ), - ), - ); - } -} diff --git a/drift_sqflite/example/lib/widgets/todo_edit_dialog.dart b/drift_sqflite/example/lib/widgets/todo_edit_dialog.dart deleted file mode 100644 index 2acd6bbc..00000000 --- a/drift_sqflite/example/lib/widgets/todo_edit_dialog.dart +++ /dev/null @@ -1,110 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:example/bloc.dart'; -import 'package:example/database/database.dart'; -import 'package:provider/provider.dart'; - -final _dateFormat = DateFormat.yMMMd(); - -class TodoEditDialog extends StatefulWidget { - final TodoEntry entry; - - const TodoEditDialog({Key? key, required this.entry}) : super(key: key); - - @override - _TodoEditDialogState createState() => _TodoEditDialogState(); -} - -class _TodoEditDialogState extends State { - final TextEditingController textController = TextEditingController(); - DateTime? _dueDate; - - @override - void initState() { - textController.text = widget.entry.content; - _dueDate = widget.entry.targetDate; - super.initState(); - } - - @override - void dispose() { - textController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - var formattedDate = 'No date set'; - if (_dueDate != null) { - formattedDate = _dateFormat.format(_dueDate!); - } - - return AlertDialog( - title: const Text('Edit entry'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - TextField( - controller: textController, - decoration: const InputDecoration( - hintText: 'What needs to be done?', - helperText: 'Content of entry', - ), - ), - Row( - children: [ - Text(formattedDate), - const Spacer(), - IconButton( - icon: const Icon(Icons.calendar_today), - onPressed: () async { - final now = DateTime.now(); - final initialDate = _dueDate ?? now; - final firstDate = - initialDate.isBefore(now) ? initialDate : now; - - final selectedDate = await showDatePicker( - context: context, - initialDate: initialDate, - firstDate: firstDate, - lastDate: DateTime(3000), - ); - - setState(() { - if (selectedDate != null) _dueDate = selectedDate; - }); - }, - ), - ], - ), - ], - ), - actions: [ - TextButton( - child: const Text('Cancel'), - style: ButtonStyle( - textStyle: MaterialStateProperty.all( - const TextStyle(color: Colors.black), - ), - ), - onPressed: () { - Navigator.pop(context); - }, - ), - TextButton( - child: const Text('Save'), - onPressed: () { - final updatedContent = textController.text; - final entry = widget.entry.copyWith( - content: updatedContent.isNotEmpty ? updatedContent : null, - targetDate: _dueDate, - ); - - Provider.of(context, listen: false).updateEntry(entry); - Navigator.pop(context); - }, - ), - ], - ); - } -} diff --git a/drift_sqflite/example/main.dart b/drift_sqflite/example/main.dart new file mode 100644 index 00000000..89e15b58 --- /dev/null +++ b/drift_sqflite/example/main.dart @@ -0,0 +1,8 @@ +// A full cross-platform example is available here: https://github.com/simolus3/drift/tree/develop/examples/app + +import 'package:drift/drift.dart'; +import 'package:drift_sqflite/drift_sqflite.dart'; + +QueryExecutor executorWithSqflite() { + return SqfliteQueryExecutor.inDatabaseFolder(path: 'app.db'); +} diff --git a/drift_sqflite/example/pubspec.yaml b/drift_sqflite/example/pubspec.yaml deleted file mode 100644 index b753215d..00000000 --- a/drift_sqflite/example/pubspec.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: example -description: Example using drift with drift_sqflite - -publish_to: 'none' - -version: 1.0.0+1 - -environment: - sdk: ">=2.16.1 <3.0.0" - flutter: ^2.10.3 - -dependencies: - drift: - drift_sqflite: - provider: ^6.0.2 - rxdart: ^0.27.3 - intl: ^0.17.0 - flutter: - sdk: flutter - -dev_dependencies: - build_runner: ^2.1.0 - drift_dev: - flutter_lints: ^1.0.0 - -flutter: - uses-material-design: true - -dependency_overrides: - drift: - path: ../../drift - drift_dev: - path: ../../drift_dev - drift_sqflite: - path: ../