diff --git a/docs/pubspec.yaml b/docs/pubspec.yaml
index e24140b8..acb71570 100644
--- a/docs/pubspec.yaml
+++ b/docs/pubspec.yaml
@@ -44,8 +44,6 @@ dev_dependencies:
dependency_overrides:
- moor_generator:
- path: ../moor_generator
drift:
path: ../drift
drift_dev:
diff --git a/docs/tool/write_versions.dart b/docs/tool/write_versions.dart
index c04e7125..36e3dd74 100644
--- a/docs/tool/write_versions.dart
+++ b/docs/tool/write_versions.dart
@@ -12,8 +12,6 @@ class _VersionsBuilder extends Builder {
@override
Future build(BuildStep buildStep) async {
const packages = [
- 'moor',
- 'moor_generator',
'sqlparser',
'path',
'build_runner',
diff --git a/drift_dev/lib/integrations/build.dart b/drift_dev/lib/integrations/build.dart
index a33aa6cc..a2062ebf 100644
--- a/drift_dev/lib/integrations/build.dart
+++ b/drift_dev/lib/integrations/build.dart
@@ -2,14 +2,12 @@ import 'package:build/build.dart';
import 'package:drift_dev/src/backends/build/drift_builder.dart';
import 'package:drift_dev/src/backends/build/preprocess_builder.dart';
-Builder driftBuilder(BuilderOptions options) =>
- DriftSharedPartBuilder(options, isForNewDriftPackage: true);
+Builder driftBuilder(BuilderOptions options) => DriftSharedPartBuilder(options);
Builder driftBuilderNotShared(BuilderOptions options) =>
- DriftPartBuilder(options, isForNewDriftPackage: true);
+ DriftPartBuilder(options);
-Builder preparingBuilder(BuilderOptions options) =>
- PreprocessBuilder(isForNewDriftPackage: true);
+Builder preparingBuilder(BuilderOptions options) => PreprocessBuilder();
PostProcessBuilder driftCleanup(BuilderOptions options) {
return const FileDeletingBuilder(['.temp.dart']);
diff --git a/drift_dev/lib/src/backends/build/drift_builder.dart b/drift_dev/lib/src/backends/build/drift_builder.dart
index dbcdbd71..528f1a32 100644
--- a/drift_dev/lib/src/backends/build/drift_builder.dart
+++ b/drift_dev/lib/src/backends/build/drift_builder.dart
@@ -18,15 +18,9 @@ final _flags = Resource(() => _BuilderFlags());
mixin DriftBuilder on Builder {
DriftOptions get options;
- bool get isForNewDriftPackage;
Writer createWriter() {
- return Writer(
- options,
- generationOptions: GenerationOptions(
- writeForMoorPackage: !isForNewDriftPackage,
- ),
- );
+ return Writer(options);
}
Future analyzeDartFile(BuildStep step) async {
@@ -72,18 +66,13 @@ class DriftSharedPartBuilder extends SharedPartBuilder with DriftBuilder {
@override
final DriftOptions options;
- @override
- final bool isForNewDriftPackage;
-
- DriftSharedPartBuilder._(List generators, String name,
- this.options, this.isForNewDriftPackage)
+ DriftSharedPartBuilder._(
+ List generators, String name, this.options)
: super(generators, name);
- factory DriftSharedPartBuilder(BuilderOptions options,
- {bool isForNewDriftPackage = false}) {
+ factory DriftSharedPartBuilder(BuilderOptions options) {
return _createBuilder(options, (generators, parsedOptions) {
- return DriftSharedPartBuilder._(
- generators, 'moor', parsedOptions, isForNewDriftPackage);
+ return DriftSharedPartBuilder._(generators, 'drift', parsedOptions);
});
}
@@ -93,7 +82,7 @@ class DriftSharedPartBuilder extends SharedPartBuilder with DriftBuilder {
if (!flags.didWarnAboutDeprecatedOptions &&
options.enabledDeprecatedOption) {
print('You have the eagerly_load_dart_ast option enabled. The option is '
- 'no longer necessary and will be removed in a future moor version. '
+ 'no longer necessary and will be removed in a future drift version. '
'Consider removing the option from your build.yaml.');
flags.didWarnAboutDeprecatedOptions = true;
}
@@ -106,21 +95,12 @@ class DriftPartBuilder extends PartBuilder with DriftBuilder {
@override
final DriftOptions options;
- @override
- final bool isForNewDriftPackage;
-
- DriftPartBuilder._(List generators, String extension, this.options,
- this.isForNewDriftPackage)
+ DriftPartBuilder._(List generators, String extension, this.options)
: super(generators, extension);
- factory DriftPartBuilder(BuilderOptions options,
- {bool isForNewDriftPackage = false}) {
+ factory DriftPartBuilder(BuilderOptions options) {
return _createBuilder(options, (generators, parsedOptions) {
- return DriftPartBuilder._(
- generators,
- isForNewDriftPackage ? '.drift.dart' : '.moor.dart',
- parsedOptions,
- isForNewDriftPackage);
+ return DriftPartBuilder._(generators, '.drift.dart', parsedOptions);
});
}
}
diff --git a/drift_dev/lib/src/backends/build/preprocess_builder.dart b/drift_dev/lib/src/backends/build/preprocess_builder.dart
index 34c537bc..ef6ec3d3 100644
--- a/drift_dev/lib/src/backends/build/preprocess_builder.dart
+++ b/drift_dev/lib/src/backends/build/preprocess_builder.dart
@@ -26,14 +26,12 @@ import 'package:sqlparser/sqlparser.dart';
class PreprocessBuilder extends Builder {
static const _outputs = ['.temp.dart', '.dart_in_drift'];
- final bool isForNewDriftPackage;
-
- PreprocessBuilder({this.isForNewDriftPackage = false});
+ PreprocessBuilder();
@override
late final Map> buildExtensions = {
'.moor': _outputs,
- if (isForNewDriftPackage) '.drift': _outputs
+ '.drift': _outputs
};
@override
diff --git a/drift_dev/lib/src/cli/commands/schema/generate_utils.dart b/drift_dev/lib/src/cli/commands/schema/generate_utils.dart
index 25297b8d..167d80c7 100644
--- a/drift_dev/lib/src/cli/commands/schema/generate_utils.dart
+++ b/drift_dev/lib/src/cli/commands/schema/generate_utils.dart
@@ -42,8 +42,6 @@ class GenerateUtilsCommand extends Command {
@override
Future run() async {
- final isForMoor = argResults!.arguments.contains('moor_generator');
-
final rest = argResults!.rest;
if (rest.length != 2) {
usageException('Expected input and output directories');
@@ -71,11 +69,10 @@ class GenerateUtilsCommand extends Command {
entities,
argResults?['data-classes'] as bool,
argResults?['companions'] as bool,
- isForMoor,
);
}
- await _writeLibraryFile(outputDir, schema.keys, isForMoor);
+ await _writeLibraryFile(outputDir, schema.keys);
print(
'Wrote ${schema.length + 1} files into ${p.relative(outputDir.path)}');
}
@@ -106,7 +103,6 @@ class GenerateUtilsCommand extends Command {
_ExportedSchema schema,
bool dataClasses,
bool companions,
- bool isForMoor,
) {
// let serialized options take precedence, otherwise use current options
// from project.
@@ -121,20 +117,14 @@ class GenerateUtilsCommand extends Command {
forSchema: version,
writeCompanions: companions,
writeDataClasses: dataClasses,
- writeForMoorPackage: isForMoor,
),
);
final file = File(p.join(output.path, _filenameForVersion(version)));
- final leaf = writer.leaf()
+ writer.leaf()
..writeln(_prefix)
- ..writeln('//@dart=2.12');
-
- if (isForMoor) {
- leaf.writeln("import 'package:moor/moor.dart';");
- } else {
- leaf.writeln("import 'package:drift/drift.dart';");
- }
+ ..writeln('//@dart=2.12')
+ ..writeln("import 'package:drift/drift.dart';");
final db = Database(
declaredQueries: const [],
@@ -146,21 +136,12 @@ class GenerateUtilsCommand extends Command {
return file.writeAsString(_dartfmt.format(writer.writeGenerated()));
}
- Future _writeLibraryFile(
- Directory output, Iterable versions, bool useMoorImports) {
+ Future _writeLibraryFile(Directory output, Iterable versions) {
final buffer = StringBuffer()
..writeln(_prefix)
- ..writeln('//@dart=2.12');
-
- if (useMoorImports) {
- buffer
- ..writeln("import 'package:moor/moor.dart';")
- ..writeln("import 'package:moor_generator/api/migrations.dart';");
- } else {
- buffer
- ..writeln("import 'package:drift/drift.dart';")
- ..writeln("import 'package:drift_dev/api/migrations.dart';");
- }
+ ..writeln('//@dart=2.12')
+ ..writeln("import 'package:drift/drift.dart';")
+ ..writeln("import 'package:drift_dev/api/migrations.dart';");
for (final version in versions) {
buffer.writeln("import '${_filenameForVersion(version)}' as v$version;");
diff --git a/drift_dev/lib/src/writer/tables/data_class_writer.dart b/drift_dev/lib/src/writer/tables/data_class_writer.dart
index a9fc1978..82e3ab13 100644
--- a/drift_dev/lib/src/writer/tables/data_class_writer.dart
+++ b/drift_dev/lib/src/writer/tables/data_class_writer.dart
@@ -18,10 +18,6 @@ class DataClassWriter {
String get serializerType => 'ValueSerializer?';
- String get _runtimeOptions => scope.generationOptions.writeForMoorPackage
- ? 'moorRuntimeOptions'
- : 'driftRuntimeOptions';
-
void write() {
final parentClass = table.customParentClass ?? 'DataClass';
_buffer.write('class ${table.dartTypeCode()} extends $parentClass ');
@@ -104,7 +100,7 @@ class DataClassWriter {
..write('factory $dataClassName.fromJson('
'Map json, {$serializerType serializer}'
') {\n')
- ..write('serializer ??= $_runtimeOptions.defaultSerializer;\n')
+ ..write('serializer ??= driftRuntimeOptions.defaultSerializer;\n')
..write('return $dataClassName(');
for (final column in columns) {
@@ -143,7 +139,7 @@ class DataClassWriter {
void _writeToJson() {
_buffer.write('@override Map toJson('
'{$serializerType serializer}) {\n'
- 'serializer ??= $_runtimeOptions.defaultSerializer;\n'
+ 'serializer ??= driftRuntimeOptions.defaultSerializer;\n'
'return {\n');
for (final column in columns) {
diff --git a/drift_dev/lib/src/writer/writer.dart b/drift_dev/lib/src/writer/writer.dart
index 6d2321dd..78053d8e 100644
--- a/drift_dev/lib/src/writer/writer.dart
+++ b/drift_dev/lib/src/writer/writer.dart
@@ -114,15 +114,10 @@ class GenerationOptions {
/// Whether companions should be generated.
final bool writeCompanions;
- /// Whether we're generating code for the old moor package instead of the
- /// new `drift` package.
- final bool writeForMoorPackage;
-
const GenerationOptions({
this.forSchema,
this.writeDataClasses = true,
this.writeCompanions = true,
- this.writeForMoorPackage = false,
});
/// Whether, instead of generating the full database code, we're only
diff --git a/drift_dev/pubspec.yaml b/drift_dev/pubspec.yaml
index e5309b96..53ca374f 100644
--- a/drift_dev/pubspec.yaml
+++ b/drift_dev/pubspec.yaml
@@ -51,8 +51,6 @@ dev_dependencies:
build_runner: ^2.0.0
build_test: ^2.0.0
json_serializable: ^6.2.0
- # Used to test the migration from moor to drift
- moor: any
executables:
drift_dev:
diff --git a/drift_dev/pubspec_overrides.yaml b/drift_dev/pubspec_overrides.yaml
index 12cdfd77..ba6a3b11 100644
--- a/drift_dev/pubspec_overrides.yaml
+++ b/drift_dev/pubspec_overrides.yaml
@@ -1,7 +1,5 @@
dependency_overrides:
drift:
path: ../drift
- moor:
- path: ../moor
sqlparser:
path: ../sqlparser
diff --git a/drift_dev/test/cli/migrate_test.dart b/drift_dev/test/cli/migrate_test.dart
index a770394b..e522deec 100644
--- a/drift_dev/test/cli/migrate_test.dart
+++ b/drift_dev/test/cli/migrate_test.dart
@@ -34,15 +34,16 @@ Future _setup(Iterable lib,
final driftDevUrl =
config.packages.singleWhere((e) => e.name == 'drift_dev').root;
- final moorFlutterUrl = driftDevUrl.resolve('../moor_flutter/');
+ final moorUrl = driftDevUrl.resolve('../extras/assets/old_moor_package/');
+ final moorFlutterUrl =
+ driftDevUrl.resolve('../extras/assets/old_moor_flutter_package/');
final appUri = '${File(p.join(d.sandbox, 'app')).absolute.uri}/';
final newConfig = PackageConfig([
...config.packages,
Package('app', Uri.parse(appUri),
packageUriRoot: Uri.parse('${appUri}lib/')),
- // Need to fake moor_flutter because drift_dev can't depend on Flutter
- // packages
+ Package('moor', moorUrl, packageUriRoot: Uri.parse('${moorUrl}lib/')),
Package('moor_flutter', moorFlutterUrl,
packageUriRoot: Uri.parse('${moorFlutterUrl}lib/')),
]);
diff --git a/drift_dev/test/writer/data_class_writer_test.dart b/drift_dev/test/writer/data_class_writer_test.dart
index 5f33f87e..1c48cfa8 100644
--- a/drift_dev/test/writer/data_class_writer_test.dart
+++ b/drift_dev/test/writer/data_class_writer_test.dart
@@ -14,7 +14,7 @@ void main() {
'generates const constructor for data classes can companion classes',
() async {
await testBuilder(
- DriftPartBuilder(const BuilderOptions({}), isForNewDriftPackage: true),
+ DriftPartBuilder(const BuilderOptions({})),
const {
'a|lib/main.dart': r'''
import 'package:drift/drift.dart';
@@ -47,7 +47,7 @@ class Database extends _$Database {}
'generates async mapping code for existing row class with async factory',
() async {
await testBuilder(
- DriftPartBuilder(const BuilderOptions({}), isForNewDriftPackage: true),
+ DriftPartBuilder(const BuilderOptions({})),
const {
'a|lib/main.dart': r'''
import 'package:drift/drift.dart';
diff --git a/drift_dev/test/writer/mutable_classes_integration_test.dart b/drift_dev/test/writer/mutable_classes_integration_test.dart
index 79ce91ad..212240b6 100644
--- a/drift_dev/test/writer/mutable_classes_integration_test.dart
+++ b/drift_dev/test/writer/mutable_classes_integration_test.dart
@@ -11,7 +11,7 @@ import 'package:test/test.dart';
const _testInput = r'''
import 'package:drift/drift.dart';
-part 'main.moor.dart';
+part 'main.drift.dart';
class Users extends Table {
IntColumn get id => integer().autoIncrement()();
@@ -34,7 +34,7 @@ void main() {
const {'a|lib/main.dart': _testInput},
reader: await PackageAssetReader.currentIsolate(),
outputs: const {
- 'a|lib/main.moor.dart': _GeneratesWithoutFinalFields(
+ 'a|lib/main.drift.dart': _GeneratesWithoutFinalFields(
{'User', 'UsersCompanion', 'SomeQueryResult'},
),
},
diff --git a/moor_flutter/.gitignore b/extras/assets/old_moor_flutter_package/.gitignore
similarity index 100%
rename from moor_flutter/.gitignore
rename to extras/assets/old_moor_flutter_package/.gitignore
diff --git a/extras/assets/old_moor_flutter_package/README.md b/extras/assets/old_moor_flutter_package/README.md
new file mode 100644
index 00000000..580f354c
--- /dev/null
+++ b/extras/assets/old_moor_flutter_package/README.md
@@ -0,0 +1,5 @@
+This is a scaffold of the old `moor_flutter` package, roughly resembling the latest
+(and discontinued) version of `moor_flutter` on pub.dev.
+
+This package is contained in this repository so that the migration from `moor`
+to `drift`, which is implemented in `drift_dev`, can still be tested.
diff --git a/moor_flutter/lib/moor_flutter.dart b/extras/assets/old_moor_flutter_package/lib/moor_flutter.dart
similarity index 100%
rename from moor_flutter/lib/moor_flutter.dart
rename to extras/assets/old_moor_flutter_package/lib/moor_flutter.dart
diff --git a/extras/assets/old_moor_flutter_package/pubspec.yaml b/extras/assets/old_moor_flutter_package/pubspec.yaml
new file mode 100644
index 00000000..56d8a0d9
--- /dev/null
+++ b/extras/assets/old_moor_flutter_package/pubspec.yaml
@@ -0,0 +1,20 @@
+name: moor_flutter
+description: Flutter implementation of moor, a safe and reactive persistence library for Dart applications
+version: 4.1.0
+repository: https://github.com/simolus3/drift
+homepage: https://drift.simonbinder.eu/
+issue_tracker: https://github.com/simolus3/drift/issues
+
+environment:
+ sdk: '>=2.12.0 <3.0.0'
+
+dependencies:
+ moor: ^4.0.0
+ sqflite: ^2.0.0+3
+ path: ^1.8.0
+ flutter:
+ sdk: flutter
+
+dev_dependencies:
+ flutter_test:
+ sdk: flutter
diff --git a/moor/.gitignore b/extras/assets/old_moor_package/.gitignore
similarity index 100%
rename from moor/.gitignore
rename to extras/assets/old_moor_package/.gitignore
diff --git a/extras/assets/old_moor_package/README.md b/extras/assets/old_moor_package/README.md
new file mode 100644
index 00000000..20042914
--- /dev/null
+++ b/extras/assets/old_moor_package/README.md
@@ -0,0 +1,5 @@
+This is a scaffold of the old `moor` package, roughly resembling the latest
+(and discontinued) version of `moor` on pub.dev.
+
+This package is contained in this repository so that the migration from `moor`
+to `drift`, which is implemented in `drift_dev`, can still be tested.
diff --git a/moor/lib/backends.dart b/extras/assets/old_moor_package/lib/backends.dart
similarity index 100%
rename from moor/lib/backends.dart
rename to extras/assets/old_moor_package/lib/backends.dart
diff --git a/moor/lib/extensions/json1.dart b/extras/assets/old_moor_package/lib/extensions/json1.dart
similarity index 100%
rename from moor/lib/extensions/json1.dart
rename to extras/assets/old_moor_package/lib/extensions/json1.dart
diff --git a/moor/lib/extensions/moor_ffi.dart b/extras/assets/old_moor_package/lib/extensions/moor_ffi.dart
similarity index 100%
rename from moor/lib/extensions/moor_ffi.dart
rename to extras/assets/old_moor_package/lib/extensions/moor_ffi.dart
diff --git a/moor/lib/ffi.dart b/extras/assets/old_moor_package/lib/ffi.dart
similarity index 100%
rename from moor/lib/ffi.dart
rename to extras/assets/old_moor_package/lib/ffi.dart
diff --git a/moor/lib/isolate.dart b/extras/assets/old_moor_package/lib/isolate.dart
similarity index 100%
rename from moor/lib/isolate.dart
rename to extras/assets/old_moor_package/lib/isolate.dart
diff --git a/moor/lib/moor.dart b/extras/assets/old_moor_package/lib/moor.dart
similarity index 100%
rename from moor/lib/moor.dart
rename to extras/assets/old_moor_package/lib/moor.dart
diff --git a/moor/lib/moor_web.dart b/extras/assets/old_moor_package/lib/moor_web.dart
similarity index 100%
rename from moor/lib/moor_web.dart
rename to extras/assets/old_moor_package/lib/moor_web.dart
diff --git a/moor/lib/remote.dart b/extras/assets/old_moor_package/lib/remote.dart
similarity index 100%
rename from moor/lib/remote.dart
rename to extras/assets/old_moor_package/lib/remote.dart
diff --git a/moor/lib/sqlite_keywords.dart b/extras/assets/old_moor_package/lib/sqlite_keywords.dart
similarity index 100%
rename from moor/lib/sqlite_keywords.dart
rename to extras/assets/old_moor_package/lib/sqlite_keywords.dart
diff --git a/moor/lib/src/deprecated.dart b/extras/assets/old_moor_package/lib/src/deprecated.dart
similarity index 100%
rename from moor/lib/src/deprecated.dart
rename to extras/assets/old_moor_package/lib/src/deprecated.dart
diff --git a/moor/pubspec.yaml b/extras/assets/old_moor_package/pubspec.yaml
similarity index 52%
rename from moor/pubspec.yaml
rename to extras/assets/old_moor_package/pubspec.yaml
index 0b81ca89..eb3e8844 100644
--- a/moor/pubspec.yaml
+++ b/extras/assets/old_moor_package/pubspec.yaml
@@ -16,24 +16,3 @@ dependencies:
meta: ^1.3.0
stream_channel: ^2.1.0
sqlite3: ^1.0.0
-
-dev_dependencies:
- build_test: ^2.0.0
- build_runner_core: ^7.0.0
- moor_generator: any
- uuid: ^3.0.0
- path: ^1.8.0
- build_runner: ^2.0.0
- test: ^1.17.0
- mockito: ^5.0.7
- rxdart: ^0.27.0
-
-dependency_overrides:
- drift:
- path: ../drift
- drift_dev:
- path: ../drift_dev
- moor_generator:
- path: ../moor_generator
- sqlparser:
- path: ../sqlparser
diff --git a/moor/CHANGELOG.md b/moor/CHANGELOG.md
deleted file mode 100644
index 2c0d2121..00000000
--- a/moor/CHANGELOG.md
+++ /dev/null
@@ -1,556 +0,0 @@
-## 4.6.1
-
-- Fix the moor analyzer plugin not starting
-
-Version 4.6.1+1 adds information about the name change to the README.
-
-## 4.6.0
-
-- Add `DoUpdate.withExcluded` to refer to the excluded row in an upsert clause.
-- Add optional `where` clause to `DoUpdate` constructors
-
-### Important notice
-
-Moor has been renamed to `drift`. This package will continue to be supported until the next major release (5.0.0),
-no immediate action is needed.
-
-At the next breaking release, moor will be discontinued in favor of the `drift` package.
-Please consider migrating to `drift` at a suitable opportunity.
-Automated migration tooling exists! See https://drift.simonbinder.eu/name for details.
-
-## 4.5.0
-
-- Add `moorRuntimeOptions.debugPrint` option to control which `print` method is used by moor.
-- Add a `rowId` extension on generated tables.
-- Add `NullAwareTypeConverter` to simplify type converters that always map `null` from and to `null`.
-- Kill backing isolates after calling `MoorIsolate.shutdownAll`.
-
-## 4.4.1
-
-- Include latest generator in analyzer plugin
-
-## 4.4.0
-
-- Add `Value.ofNullable` constructor to easily wrap nullable values.
-- Support selecting views declared in a moor file in Dart (with `select`,
- `join` and similar methods)
-- Add the `scoped_dart_components` builder option to generate a function for
- [Dart components in SQL](https://drift.simonbinder.eu/docs/using-sql/moor_files/#dart-components-in-sql).
- The function's parameters reflect tables that are in scope.
-- Add the `UpsertMultiple` class to run multiple upsert clauses in an insert.
- This requires sqlite3 version 3.35 or later.
-- Add the `closeUnderlyingOnClose` argument to `VmDatabase.opened` as an option
- to keep the underlying instance opened when closing the `VmDatabase`.
-- The `tableUpdates` stream now emits the relevant updates instead of `null`.
-- Reflect type converters in generated columns. The `equalsValue` method can be used
- as an equals with a value mapped by a type converter.
-- Improve nullability analysis for SQL queries.
-- __Note__: You have to re-generate sources with `moor_generator` version 4.4.0 after
- upgrading to this version. Apologies for the inconvenience.
-
-## 4.3.2
-
-- Fix `insertReturning` not updating streams
-- Fix streams emitting stale data if a new subscriber attaches immediately
- after an update.
-
-## 4.3.1
-
-- Fix encoding table updates without a kind over isolates
-- Fix deserializing some nullable types in the default value serializer
-
-## 4.3.0
-
-- Support custom, existing classes for rows! See the `@UseRowClass` annotation
- for details.
-- Add `CASE WHEN` expressions with the `caseMatch` method on `Expression`
-- Add `insertReturning` which returns the generated row after an insert
-- Add `min`, `max` and `avg` functions for `DateTime` expressions
-- On supported platforms, cancel pending stream selects when the stream is disposed
- - `moor_flutter` is supported
- - `moor/ffi` is supported when used on a background isolate
-
-## 4.2.1
-
-- Deprecate `readBool`, `readString`, `readInt`, `readDouble`, `readDateTime`
- and `readBlob` in `QueryRow`.
- Use `read` directly (which supports nullable types).
-
-## 4.2.0
-
-- Fixed subqueries not affecting stream updates
-- Throw a `CouldNotRollBackException` when rolling back a transaction throws
-
-## 4.1.0
-
-- Reverted the `SelectableUtils` extension, its members have been added back to the
- `Selectable` class.
-- Add `trim()`, `trimLeft()` and `trimRight()` extensions for text expressions
-- Initial support for sub-queries in the Dart api:
- - `Expression.isInQuery` and `isNotInQuery` for `IS IN (SELECT ...)` matching
- - `subqueryExpression` to use single-column, single-row selects as values
- - `existsQuery` and `notExistsQuery` for `EXISTS` expressions
-- New `package:moor/remote.dart` library to access databases over any `StreamChannel`. The isolate library has been
- rewritten on top of that api.
-
-## 4.0.0-nullsafety.1
-
-- __Breaking__: `getSingle()` and `watchSingle()` are now non-nullable and throw for empty results.
- Use `getSingleOrNull()` and `watchSingleOrNull()` for the old behavior.
-- __Breaking__: Removed `QueryEngine`, its methods have been moved to `DatabaseConnectionUser`
-- __Breaking__: Changed the `args` parameter in `QueryExecutor` methods to `List
diff --git a/moor/analysis_options.yaml b/moor/analysis_options.yaml
deleted file mode 100644
index 8b443153..00000000
--- a/moor/analysis_options.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-#include: ../analysis_options.yaml
-
-analyzer:
- errors:
- public_member_api_docs: warning
- deprecated_member_use_from_same_package: ignore
- exclude:
- - "example_web/**"
- - "**/*.g.dart"
- - "**/*.mocks.dart"
diff --git a/moor/build.yaml b/moor/build.yaml
deleted file mode 100644
index c2e159df..00000000
--- a/moor/build.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-targets:
- $default:
- builders:
- moor_generator:
- options:
- override_hash_and_equals_in_result_sets: true
- use_column_name_as_json_key_when_defined_in_moor_file: true
- generate_connect_constructor: true
- compact_query_methods: true
- write_from_json_string_constructor: true
- raw_result_set_data: true
- apply_converters_on_variables: true
- generate_values_in_copy_with: true
- named_parameters: true
- new_sql_code_generation: true
- scoped_dart_components: true
- sqlite:
- version: "3.35"
- modules:
- - json1
- - fts5
diff --git a/moor/example/example.dart b/moor/example/example.dart
deleted file mode 100644
index 0b7af6d3..00000000
--- a/moor/example/example.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-import 'package:moor/moor.dart';
-
-part 'example.g.dart';
-
-// Define tables that can model a database of recipes.
-
-@DataClassName('Category')
-class Categories extends Table {
- IntColumn get id => integer().autoIncrement()();
- TextColumn get description => text().nullable()();
-}
-
-class Recipes extends Table {
- IntColumn get id => integer().autoIncrement()();
- TextColumn get title => text().withLength(max: 16)();
- TextColumn get instructions => text()();
- IntColumn get category => integer().nullable()();
-}
-
-class Ingredients extends Table {
- IntColumn get id => integer().autoIncrement()();
- TextColumn get name => text()();
- IntColumn get caloriesPer100g => integer().named('calories')();
-}
-
-class IngredientInRecipes extends Table {
- @override
- String get tableName => 'recipe_ingredients';
-
- // We can also specify custom primary keys
- @override
- Set get primaryKey => {recipe, ingredient};
-
- IntColumn get recipe => integer()();
- IntColumn get ingredient => integer()();
-
- IntColumn get amountInGrams => integer().named('amount')();
-}
-
-@UseMoor(
- tables: [Categories, Recipes, Ingredients, IngredientInRecipes],
- queries: {
- // query to load the total weight for each recipe by loading all ingredients
- // and taking the sum of their amountInGrams.
- 'totalWeight': '''
- SELECT r.title, SUM(ir.amount) AS total_weight
- FROM recipes r
- INNER JOIN recipe_ingredients ir ON ir.recipe = r.id
- GROUP BY r.id
- '''
- },
-)
-class Database extends _$Database {
- Database(QueryExecutor e) : super(e);
-
- @override
- int get schemaVersion => 1;
-
- @override
- MigrationStrategy get migration {
- return MigrationStrategy(
- beforeOpen: (details) async {
- // populate data
- await into(categories)
- .insert(const CategoriesCompanion(description: Value('Sweets')));
- },
- );
- }
-}
diff --git a/moor/example/example.g.dart b/moor/example/example.g.dart
deleted file mode 100644
index b6d83daf..00000000
--- a/moor/example/example.g.dart
+++ /dev/null
@@ -1,938 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'example.dart';
-
-// **************************************************************************
-// MoorGenerator
-// **************************************************************************
-
-// ignore_for_file: unnecessary_brace_in_string_interps, unnecessary_this
-class Category extends DataClass implements Insertable {
- final int id;
- final String? description;
- Category({required this.id, this.description});
- factory Category.fromData(Map data, GeneratedDatabase db,
- {String? prefix}) {
- final effectivePrefix = prefix ?? '';
- return Category(
- id: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}id'])!,
- description: const StringType()
- .mapFromDatabaseResponse(data['${effectivePrefix}description']),
- );
- }
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- map['id'] = Variable(id);
- if (!nullToAbsent || description != null) {
- map['description'] = Variable(description);
- }
- return map;
- }
-
- CategoriesCompanion toCompanion(bool nullToAbsent) {
- return CategoriesCompanion(
- id: Value(id),
- description: description == null && nullToAbsent
- ? const Value.absent()
- : Value(description),
- );
- }
-
- factory Category.fromJson(Map json,
- {ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return Category(
- id: serializer.fromJson(json['id']),
- description: serializer.fromJson(json['description']),
- );
- }
- factory Category.fromJsonString(String encodedJson,
- {ValueSerializer? serializer}) =>
- Category.fromJson(
- DataClass.parseJson(encodedJson) as Map,
- serializer: serializer);
- @override
- Map toJson({ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return {
- 'id': serializer.toJson(id),
- 'description': serializer.toJson(description),
- };
- }
-
- Category copyWith(
- {int? id, Value description = const Value.absent()}) =>
- Category(
- id: id ?? this.id,
- description: description.present ? description.value : 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(),
- this.description = const Value.absent(),
- });
- static Insertable custom({
- Expression? id,
- Expression? description,
- }) {
- return RawValuesInsertable({
- if (id != null) 'id': id,
- if (description != null) 'description': 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['description'] = 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> {
- final GeneratedDatabase _db;
- final String? _alias;
- $CategoriesTable(this._db, [this._alias]);
- final VerificationMeta _idMeta = const VerificationMeta('id');
- late final GeneratedColumn id = GeneratedColumn(
- 'id', aliasedName, false,
- typeName: 'INTEGER',
- requiredDuringInsert: false,
- defaultConstraints: 'PRIMARY KEY AUTOINCREMENT');
- final VerificationMeta _descriptionMeta =
- const VerificationMeta('description');
- late final GeneratedColumn description = GeneratedColumn(
- 'description', aliasedName, true,
- typeName: 'TEXT', requiredDuringInsert: false);
- @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('description')) {
- context.handle(
- _descriptionMeta,
- description.isAcceptableOrUnknown(
- data['description']!, _descriptionMeta));
- }
- return context;
- }
-
- @override
- Set get $primaryKey => {id};
- @override
- Category map(Map data, {String? tablePrefix}) {
- return Category.fromData(data, _db,
- prefix: tablePrefix != null ? '$tablePrefix.' : null);
- }
-
- @override
- $CategoriesTable createAlias(String alias) {
- return $CategoriesTable(_db, alias);
- }
-}
-
-class Recipe extends DataClass implements Insertable {
- final int id;
- final String title;
- final String instructions;
- final int? category;
- Recipe(
- {required this.id,
- required this.title,
- required this.instructions,
- this.category});
- factory Recipe.fromData(Map data, GeneratedDatabase db,
- {String? prefix}) {
- final effectivePrefix = prefix ?? '';
- return Recipe(
- id: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}id'])!,
- title: const StringType()
- .mapFromDatabaseResponse(data['${effectivePrefix}title'])!,
- instructions: const StringType()
- .mapFromDatabaseResponse(data['${effectivePrefix}instructions'])!,
- category: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}category']),
- );
- }
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- map['id'] = Variable(id);
- map['title'] = Variable(title);
- map['instructions'] = Variable(instructions);
- if (!nullToAbsent || category != null) {
- map['category'] = Variable(category);
- }
- return map;
- }
-
- RecipesCompanion toCompanion(bool nullToAbsent) {
- return RecipesCompanion(
- id: Value(id),
- title: Value(title),
- instructions: Value(instructions),
- category: category == null && nullToAbsent
- ? const Value.absent()
- : Value(category),
- );
- }
-
- factory Recipe.fromJson(Map json,
- {ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return Recipe(
- id: serializer.fromJson(json['id']),
- title: serializer.fromJson(json['title']),
- instructions: serializer.fromJson(json['instructions']),
- category: serializer.fromJson(json['category']),
- );
- }
- factory Recipe.fromJsonString(String encodedJson,
- {ValueSerializer? serializer}) =>
- Recipe.fromJson(DataClass.parseJson(encodedJson) as Map,
- serializer: serializer);
- @override
- Map toJson({ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return {
- 'id': serializer.toJson(id),
- 'title': serializer.toJson(title),
- 'instructions': serializer.toJson(instructions),
- 'category': serializer.toJson(category),
- };
- }
-
- Recipe copyWith(
- {int? id,
- String? title,
- String? instructions,
- Value category = const Value.absent()}) =>
- Recipe(
- id: id ?? this.id,
- title: title ?? this.title,
- instructions: instructions ?? this.instructions,
- category: category.present ? category.value : this.category,
- );
- @override
- String toString() {
- return (StringBuffer('Recipe(')
- ..write('id: $id, ')
- ..write('title: $title, ')
- ..write('instructions: $instructions, ')
- ..write('category: $category')
- ..write(')'))
- .toString();
- }
-
- @override
- int get hashCode => Object.hash(id, title, instructions, category);
- @override
- bool operator ==(Object other) =>
- identical(this, other) ||
- (other is Recipe &&
- other.id == this.id &&
- other.title == this.title &&
- other.instructions == this.instructions &&
- other.category == this.category);
-}
-
-class RecipesCompanion extends UpdateCompanion {
- final Value id;
- final Value title;
- final Value instructions;
- final Value category;
- const RecipesCompanion({
- this.id = const Value.absent(),
- this.title = const Value.absent(),
- this.instructions = const Value.absent(),
- this.category = const Value.absent(),
- });
- RecipesCompanion.insert({
- this.id = const Value.absent(),
- required String title,
- required String instructions,
- this.category = const Value.absent(),
- }) : title = Value(title),
- instructions = Value(instructions);
- static Insertable custom({
- Expression? id,
- Expression? title,
- Expression? instructions,
- Expression? category,
- }) {
- return RawValuesInsertable({
- if (id != null) 'id': id,
- if (title != null) 'title': title,
- if (instructions != null) 'instructions': instructions,
- if (category != null) 'category': category,
- });
- }
-
- RecipesCompanion copyWith(
- {Value? id,
- Value? title,
- Value? instructions,
- Value? category}) {
- return RecipesCompanion(
- id: id ?? this.id,
- title: title ?? this.title,
- instructions: instructions ?? this.instructions,
- category: category ?? this.category,
- );
- }
-
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- if (id.present) {
- map['id'] = Variable(id.value);
- }
- if (title.present) {
- map['title'] = Variable(title.value);
- }
- if (instructions.present) {
- map['instructions'] = Variable(instructions.value);
- }
- if (category.present) {
- map['category'] = Variable(category.value);
- }
- return map;
- }
-
- @override
- String toString() {
- return (StringBuffer('RecipesCompanion(')
- ..write('id: $id, ')
- ..write('title: $title, ')
- ..write('instructions: $instructions, ')
- ..write('category: $category')
- ..write(')'))
- .toString();
- }
-}
-
-class $RecipesTable extends Recipes with TableInfo<$RecipesTable, Recipe> {
- final GeneratedDatabase _db;
- final String? _alias;
- $RecipesTable(this._db, [this._alias]);
- final VerificationMeta _idMeta = const VerificationMeta('id');
- late final GeneratedColumn id = GeneratedColumn(
- 'id', aliasedName, false,
- typeName: 'INTEGER',
- requiredDuringInsert: false,
- defaultConstraints: 'PRIMARY KEY AUTOINCREMENT');
- final VerificationMeta _titleMeta = const VerificationMeta('title');
- late final GeneratedColumn title = GeneratedColumn(
- 'title', aliasedName, false,
- additionalChecks: GeneratedColumn.checkTextLength(maxTextLength: 16),
- typeName: 'TEXT',
- requiredDuringInsert: true);
- final VerificationMeta _instructionsMeta =
- const VerificationMeta('instructions');
- late final GeneratedColumn instructions = GeneratedColumn(
- 'instructions', aliasedName, false,
- typeName: 'TEXT', requiredDuringInsert: true);
- final VerificationMeta _categoryMeta = const VerificationMeta('category');
- late final GeneratedColumn category = GeneratedColumn(
- 'category', aliasedName, true,
- typeName: 'INTEGER', requiredDuringInsert: false);
- @override
- List get $columns => [id, title, instructions, category];
- @override
- String get aliasedName => _alias ?? 'recipes';
- @override
- String get actualTableName => 'recipes';
- @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('title')) {
- context.handle(
- _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta));
- } else if (isInserting) {
- context.missing(_titleMeta);
- }
- if (data.containsKey('instructions')) {
- context.handle(
- _instructionsMeta,
- instructions.isAcceptableOrUnknown(
- data['instructions']!, _instructionsMeta));
- } else if (isInserting) {
- context.missing(_instructionsMeta);
- }
- if (data.containsKey('category')) {
- context.handle(_categoryMeta,
- category.isAcceptableOrUnknown(data['category']!, _categoryMeta));
- }
- return context;
- }
-
- @override
- Set get $primaryKey => {id};
- @override
- Recipe map(Map data, {String? tablePrefix}) {
- return Recipe.fromData(data, _db,
- prefix: tablePrefix != null ? '$tablePrefix.' : null);
- }
-
- @override
- $RecipesTable createAlias(String alias) {
- return $RecipesTable(_db, alias);
- }
-}
-
-class Ingredient extends DataClass implements Insertable {
- final int id;
- final String name;
- final int caloriesPer100g;
- Ingredient(
- {required this.id, required this.name, required this.caloriesPer100g});
- factory Ingredient.fromData(Map data, GeneratedDatabase db,
- {String? prefix}) {
- final effectivePrefix = prefix ?? '';
- return Ingredient(
- id: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}id'])!,
- name: const StringType()
- .mapFromDatabaseResponse(data['${effectivePrefix}name'])!,
- caloriesPer100g: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}calories'])!,
- );
- }
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- map['id'] = Variable(id);
- map['name'] = Variable(name);
- map['calories'] = Variable(caloriesPer100g);
- return map;
- }
-
- IngredientsCompanion toCompanion(bool nullToAbsent) {
- return IngredientsCompanion(
- id: Value(id),
- name: Value(name),
- caloriesPer100g: Value(caloriesPer100g),
- );
- }
-
- factory Ingredient.fromJson(Map json,
- {ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return Ingredient(
- id: serializer.fromJson(json['id']),
- name: serializer.fromJson(json['name']),
- caloriesPer100g: serializer.fromJson(json['caloriesPer100g']),
- );
- }
- factory Ingredient.fromJsonString(String encodedJson,
- {ValueSerializer? serializer}) =>
- Ingredient.fromJson(
- DataClass.parseJson(encodedJson) as Map,
- serializer: serializer);
- @override
- Map toJson({ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return {
- 'id': serializer.toJson(id),
- 'name': serializer.toJson(name),
- 'caloriesPer100g': serializer.toJson(caloriesPer100g),
- };
- }
-
- Ingredient copyWith({int? id, String? name, int? caloriesPer100g}) =>
- Ingredient(
- id: id ?? this.id,
- name: name ?? this.name,
- caloriesPer100g: caloriesPer100g ?? this.caloriesPer100g,
- );
- @override
- String toString() {
- return (StringBuffer('Ingredient(')
- ..write('id: $id, ')
- ..write('name: $name, ')
- ..write('caloriesPer100g: $caloriesPer100g')
- ..write(')'))
- .toString();
- }
-
- @override
- int get hashCode => Object.hash(id, name, caloriesPer100g);
- @override
- bool operator ==(Object other) =>
- identical(this, other) ||
- (other is Ingredient &&
- other.id == this.id &&
- other.name == this.name &&
- other.caloriesPer100g == this.caloriesPer100g);
-}
-
-class IngredientsCompanion extends UpdateCompanion {
- final Value id;
- final Value name;
- final Value caloriesPer100g;
- const IngredientsCompanion({
- this.id = const Value.absent(),
- this.name = const Value.absent(),
- this.caloriesPer100g = const Value.absent(),
- });
- IngredientsCompanion.insert({
- this.id = const Value.absent(),
- required String name,
- required int caloriesPer100g,
- }) : name = Value(name),
- caloriesPer100g = Value(caloriesPer100g);
- static Insertable custom({
- Expression? id,
- Expression? name,
- Expression? caloriesPer100g,
- }) {
- return RawValuesInsertable({
- if (id != null) 'id': id,
- if (name != null) 'name': name,
- if (caloriesPer100g != null) 'calories': caloriesPer100g,
- });
- }
-
- IngredientsCompanion copyWith(
- {Value? id, Value? name, Value? caloriesPer100g}) {
- return IngredientsCompanion(
- id: id ?? this.id,
- name: name ?? this.name,
- caloriesPer100g: caloriesPer100g ?? this.caloriesPer100g,
- );
- }
-
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- if (id.present) {
- map['id'] = Variable(id.value);
- }
- if (name.present) {
- map['name'] = Variable(name.value);
- }
- if (caloriesPer100g.present) {
- map['calories'] = Variable(caloriesPer100g.value);
- }
- return map;
- }
-
- @override
- String toString() {
- return (StringBuffer('IngredientsCompanion(')
- ..write('id: $id, ')
- ..write('name: $name, ')
- ..write('caloriesPer100g: $caloriesPer100g')
- ..write(')'))
- .toString();
- }
-}
-
-class $IngredientsTable extends Ingredients
- with TableInfo<$IngredientsTable, Ingredient> {
- final GeneratedDatabase _db;
- final String? _alias;
- $IngredientsTable(this._db, [this._alias]);
- final VerificationMeta _idMeta = const VerificationMeta('id');
- late final GeneratedColumn id = GeneratedColumn(
- 'id', aliasedName, false,
- typeName: 'INTEGER',
- requiredDuringInsert: false,
- defaultConstraints: 'PRIMARY KEY AUTOINCREMENT');
- final VerificationMeta _nameMeta = const VerificationMeta('name');
- late final GeneratedColumn name = GeneratedColumn(
- 'name', aliasedName, false,
- typeName: 'TEXT', requiredDuringInsert: true);
- final VerificationMeta _caloriesPer100gMeta =
- const VerificationMeta('caloriesPer100g');
- late final GeneratedColumn caloriesPer100g = GeneratedColumn(
- 'calories', aliasedName, false,
- typeName: 'INTEGER', requiredDuringInsert: true);
- @override
- List get $columns => [id, name, caloriesPer100g];
- @override
- String get aliasedName => _alias ?? 'ingredients';
- @override
- String get actualTableName => 'ingredients';
- @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('name')) {
- context.handle(
- _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta));
- } else if (isInserting) {
- context.missing(_nameMeta);
- }
- if (data.containsKey('calories')) {
- context.handle(
- _caloriesPer100gMeta,
- caloriesPer100g.isAcceptableOrUnknown(
- data['calories']!, _caloriesPer100gMeta));
- } else if (isInserting) {
- context.missing(_caloriesPer100gMeta);
- }
- return context;
- }
-
- @override
- Set get $primaryKey => {id};
- @override
- Ingredient map(Map data, {String? tablePrefix}) {
- return Ingredient.fromData(data, _db,
- prefix: tablePrefix != null ? '$tablePrefix.' : null);
- }
-
- @override
- $IngredientsTable createAlias(String alias) {
- return $IngredientsTable(_db, alias);
- }
-}
-
-class IngredientInRecipe extends DataClass
- implements Insertable {
- final int recipe;
- final int ingredient;
- final int amountInGrams;
- IngredientInRecipe(
- {required this.recipe,
- required this.ingredient,
- required this.amountInGrams});
- factory IngredientInRecipe.fromData(
- Map data, GeneratedDatabase db,
- {String? prefix}) {
- final effectivePrefix = prefix ?? '';
- return IngredientInRecipe(
- recipe: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}recipe'])!,
- ingredient: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}ingredient'])!,
- amountInGrams: const IntType()
- .mapFromDatabaseResponse(data['${effectivePrefix}amount'])!,
- );
- }
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- map['recipe'] = Variable(recipe);
- map['ingredient'] = Variable(ingredient);
- map['amount'] = Variable(amountInGrams);
- return map;
- }
-
- IngredientInRecipesCompanion toCompanion(bool nullToAbsent) {
- return IngredientInRecipesCompanion(
- recipe: Value(recipe),
- ingredient: Value(ingredient),
- amountInGrams: Value(amountInGrams),
- );
- }
-
- factory IngredientInRecipe.fromJson(Map json,
- {ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return IngredientInRecipe(
- recipe: serializer.fromJson(json['recipe']),
- ingredient: serializer.fromJson(json['ingredient']),
- amountInGrams: serializer.fromJson(json['amountInGrams']),
- );
- }
- factory IngredientInRecipe.fromJsonString(String encodedJson,
- {ValueSerializer? serializer}) =>
- IngredientInRecipe.fromJson(
- DataClass.parseJson(encodedJson) as Map,
- serializer: serializer);
- @override
- Map toJson({ValueSerializer? serializer}) {
- serializer ??= moorRuntimeOptions.defaultSerializer;
- return {
- 'recipe': serializer.toJson(recipe),
- 'ingredient': serializer.toJson(ingredient),
- 'amountInGrams': serializer.toJson(amountInGrams),
- };
- }
-
- IngredientInRecipe copyWith(
- {int? recipe, int? ingredient, int? amountInGrams}) =>
- IngredientInRecipe(
- recipe: recipe ?? this.recipe,
- ingredient: ingredient ?? this.ingredient,
- amountInGrams: amountInGrams ?? this.amountInGrams,
- );
- @override
- String toString() {
- return (StringBuffer('IngredientInRecipe(')
- ..write('recipe: $recipe, ')
- ..write('ingredient: $ingredient, ')
- ..write('amountInGrams: $amountInGrams')
- ..write(')'))
- .toString();
- }
-
- @override
- int get hashCode => Object.hash(recipe, ingredient, amountInGrams);
- @override
- bool operator ==(Object other) =>
- identical(this, other) ||
- (other is IngredientInRecipe &&
- other.recipe == this.recipe &&
- other.ingredient == this.ingredient &&
- other.amountInGrams == this.amountInGrams);
-}
-
-class IngredientInRecipesCompanion extends UpdateCompanion {
- final Value recipe;
- final Value ingredient;
- final Value amountInGrams;
- const IngredientInRecipesCompanion({
- this.recipe = const Value.absent(),
- this.ingredient = const Value.absent(),
- this.amountInGrams = const Value.absent(),
- });
- IngredientInRecipesCompanion.insert({
- required int recipe,
- required int ingredient,
- required int amountInGrams,
- }) : recipe = Value(recipe),
- ingredient = Value(ingredient),
- amountInGrams = Value(amountInGrams);
- static Insertable custom({
- Expression? recipe,
- Expression? ingredient,
- Expression? amountInGrams,
- }) {
- return RawValuesInsertable({
- if (recipe != null) 'recipe': recipe,
- if (ingredient != null) 'ingredient': ingredient,
- if (amountInGrams != null) 'amount': amountInGrams,
- });
- }
-
- IngredientInRecipesCompanion copyWith(
- {Value? recipe, Value? ingredient, Value? amountInGrams}) {
- return IngredientInRecipesCompanion(
- recipe: recipe ?? this.recipe,
- ingredient: ingredient ?? this.ingredient,
- amountInGrams: amountInGrams ?? this.amountInGrams,
- );
- }
-
- @override
- Map toColumns(bool nullToAbsent) {
- final map = {};
- if (recipe.present) {
- map['recipe'] = Variable(recipe.value);
- }
- if (ingredient.present) {
- map['ingredient'] = Variable(ingredient.value);
- }
- if (amountInGrams.present) {
- map['amount'] = Variable(amountInGrams.value);
- }
- return map;
- }
-
- @override
- String toString() {
- return (StringBuffer('IngredientInRecipesCompanion(')
- ..write('recipe: $recipe, ')
- ..write('ingredient: $ingredient, ')
- ..write('amountInGrams: $amountInGrams')
- ..write(')'))
- .toString();
- }
-}
-
-class $IngredientInRecipesTable extends IngredientInRecipes
- with TableInfo<$IngredientInRecipesTable, IngredientInRecipe> {
- final GeneratedDatabase _db;
- final String? _alias;
- $IngredientInRecipesTable(this._db, [this._alias]);
- final VerificationMeta _recipeMeta = const VerificationMeta('recipe');
- late final GeneratedColumn recipe = GeneratedColumn(
- 'recipe', aliasedName, false,
- typeName: 'INTEGER', requiredDuringInsert: true);
- final VerificationMeta _ingredientMeta = const VerificationMeta('ingredient');
- late final GeneratedColumn ingredient = GeneratedColumn(
- 'ingredient', aliasedName, false,
- typeName: 'INTEGER', requiredDuringInsert: true);
- final VerificationMeta _amountInGramsMeta =
- const VerificationMeta('amountInGrams');
- late final GeneratedColumn amountInGrams = GeneratedColumn(
- 'amount', aliasedName, false,
- typeName: 'INTEGER', requiredDuringInsert: true);
- @override
- List get $columns => [recipe, ingredient, amountInGrams];
- @override
- String get aliasedName => _alias ?? 'recipe_ingredients';
- @override
- String get actualTableName => 'recipe_ingredients';
- @override
- VerificationContext validateIntegrity(Insertable instance,
- {bool isInserting = false}) {
- final context = VerificationContext();
- final data = instance.toColumns(true);
- if (data.containsKey('recipe')) {
- context.handle(_recipeMeta,
- recipe.isAcceptableOrUnknown(data['recipe']!, _recipeMeta));
- } else if (isInserting) {
- context.missing(_recipeMeta);
- }
- if (data.containsKey('ingredient')) {
- context.handle(
- _ingredientMeta,
- ingredient.isAcceptableOrUnknown(
- data['ingredient']!, _ingredientMeta));
- } else if (isInserting) {
- context.missing(_ingredientMeta);
- }
- if (data.containsKey('amount')) {
- context.handle(
- _amountInGramsMeta,
- amountInGrams.isAcceptableOrUnknown(
- data['amount']!, _amountInGramsMeta));
- } else if (isInserting) {
- context.missing(_amountInGramsMeta);
- }
- return context;
- }
-
- @override
- Set get $primaryKey => {recipe, ingredient};
- @override
- IngredientInRecipe map(Map data, {String? tablePrefix}) {
- return IngredientInRecipe.fromData(data, _db,
- prefix: tablePrefix != null ? '$tablePrefix.' : null);
- }
-
- @override
- $IngredientInRecipesTable createAlias(String alias) {
- return $IngredientInRecipesTable(_db, alias);
- }
-}
-
-abstract class _$Database extends GeneratedDatabase {
- _$Database(QueryExecutor e) : super(SqlTypeSystem.defaultInstance, e);
- _$Database.connect(DatabaseConnection c) : super.connect(c);
- late final $CategoriesTable categories = $CategoriesTable(this);
- late final $RecipesTable recipes = $RecipesTable(this);
- late final $IngredientsTable ingredients = $IngredientsTable(this);
- late final $IngredientInRecipesTable ingredientInRecipes =
- $IngredientInRecipesTable(this);
- Selectable totalWeight() {
- return customSelect(
- 'SELECT r.title, SUM(ir.amount) AS total_weight FROM recipes AS r INNER JOIN recipe_ingredients AS ir ON ir.recipe = r.id GROUP BY r.id',
- variables: [],
- readsFrom: {
- recipes,
- ingredientInRecipes,
- }).map((QueryRow row) {
- return TotalWeightResult(
- row: row,
- title: row.read('title'),
- totalWeight: row.read('total_weight'),
- );
- });
- }
-
- @override
- Iterable get allTables => allSchemaEntities.whereType();
- @override
- List get allSchemaEntities =>
- [categories, recipes, ingredients, ingredientInRecipes];
-}
-
-class TotalWeightResult extends CustomResultSet {
- final String title;
- final int totalWeight;
- TotalWeightResult({
- required QueryRow row,
- required this.title,
- required this.totalWeight,
- }) : super(row);
- @override
- int get hashCode => Object.hash(title, totalWeight);
- @override
- bool operator ==(Object other) =>
- identical(this, other) ||
- (other is TotalWeightResult &&
- other.title == this.title &&
- other.totalWeight == this.totalWeight);
- @override
- String toString() {
- return (StringBuffer('TotalWeightResult(')
- ..write('title: $title, ')
- ..write('totalWeight: $totalWeight')
- ..write(')'))
- .toString();
- }
-}
diff --git a/moor/mono_pkg.yaml b/moor/mono_pkg.yaml
deleted file mode 100644
index 01ae3517..00000000
--- a/moor/mono_pkg.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-dart:
- - stable
-
-stages:
- - analyze:
- - dartanalyzer: --fatal-infos --fatal-warnings lib/ test/
- - dartfmt
- - unit_test:
- - command: pub run build_runner build -v --delete-conflicting-outputs
- - test
\ No newline at end of file
diff --git a/moor/tools/analyzer_plugin/bin/plugin.dart b/moor/tools/analyzer_plugin/bin/plugin.dart
deleted file mode 100644
index 08aefb39..00000000
--- a/moor/tools/analyzer_plugin/bin/plugin.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-//@dart=2.6
-
-import 'dart:convert';
-import 'dart:isolate';
-
-import 'package:moor_generator/integrations/plugin.dart' as plugin;
-import 'package:web_socket_channel/io.dart';
-
-const useDebuggingVariant = false;
-
-void main(List args, SendPort sendPort) {
- if (useDebuggingVariant) {
- _PluginProxy(sendPort).start();
- } else {
- plugin.start(args, sendPort);
- }
-}
-
-// Used during development. See CONTRIBUTING.md in the moor repo on how to debug
-// the plugin.
-class _PluginProxy {
- final SendPort sendToAnalysisServer;
-
- ReceivePort _receive;
- IOWebSocketChannel _channel;
-
- _PluginProxy(this.sendToAnalysisServer);
-
- Future start() async {
- _channel = IOWebSocketChannel.connect('ws://localhost:9999');
- _receive = ReceivePort();
- sendToAnalysisServer.send(_receive.sendPort);
-
- _receive.listen((data) {
- // the server will send messages as maps, convert to json
- _channel.sink.add(json.encode(data));
- });
-
- _channel.stream.listen((data) {
- sendToAnalysisServer.send(json.decode(data as String));
- });
- }
-}
diff --git a/moor/tools/analyzer_plugin/pubspec.yaml b/moor/tools/analyzer_plugin/pubspec.yaml
deleted file mode 100644
index befaa290..00000000
--- a/moor/tools/analyzer_plugin/pubspec.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: analyzer_load_moor_plugin
-version: 1.0.0
-description: This pubspec is a part of moor and determines the version of the moor analyzer to load
-
-environment:
- sdk: '>=2.9.0 <3.0.0'
-
-dependencies:
- moor_generator: ^4.4.1
- web_socket_channel: ^1.0.15
-
-# These overrides are only needed when working on the plugin with useDebuggingVariant = false (not recommended)
-
-#dependency_overrides:
-# moor_generator:
-# path: /path/to/moor/moor_generator
-# sqlparser:
-# path: /path/to/moor/sqlparser
\ No newline at end of file
diff --git a/moor_flutter/.flutter-plugins b/moor_flutter/.flutter-plugins
deleted file mode 100644
index 3e4cc2a8..00000000
--- a/moor_flutter/.flutter-plugins
+++ /dev/null
@@ -1 +0,0 @@
-sqflite=/home/simon/Android/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.1.0/
diff --git a/moor_flutter/.metadata b/moor_flutter/.metadata
deleted file mode 100644
index 6209bc9f..00000000
--- a/moor_flutter/.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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
- channel: stable
-
-project_type: package
diff --git a/moor_flutter/CHANGELOG.md b/moor_flutter/CHANGELOG.md
deleted file mode 100644
index 94bff635..00000000
--- a/moor_flutter/CHANGELOG.md
+++ /dev/null
@@ -1,145 +0,0 @@
-## 4.1.0
-
-- Support query cancellations introduced in moor 4.3.0
-- Clarify that this package has been renamed to `drift`.
-
-## 4.0.0
-
-- Support moor version 4
-- Migrate to null-safety
-
-## 3.1.0
-
-Don't write the schema version to the database if the migration throws an exception.
-
-## 3.0.0
-
-Support `moor` version 3.0. To learn what's new, head over to [its changelog](https://pub.dev/packages/moor).
-
-## 2.1.1
-
-- Fix `runCustom` not using the provided variables ([#406](https://github.com/simolus3/drift/issues/406))
-
-## 2.1.0
-
-- Expose the underlying database from sqflite in `FlutterQueryExecutor`.
- This exists only to make migrations to moor easier.
-
-## 2.0.0
-See the changelog of [moor](https://pub.dev/packages/moor#-changelog-tab-) for details,
-or check out an overview of new features [here](https://drift.simonbinder.eu/v2)
-
-## 1.7.0
-- Support custom columns via type converters. See the [docs](https://drift.simonbinder.eu/type_converters)
-for details on how to use this feature.
-- Transactions now roll back when not completed successfully, they also rethrow the exception
-to make debugging easier.
-- New `backends` api, making it easier to write database drivers that work with moor. Apart from
-`moor_flutter`, new experimental backends can be checked out from git:
- 1. `encrypted_moor`: An encrypted moor database: https://github.com/simolus3/drift/tree/develop/extras/encryption
-- The compiled sql feature is no longer experimental and will stay stable until a major version bump
-- New, experimental support for `.moor` files! Instead of declaring your tables in Dart, you can
- choose to declare them with sql by writing the `CREATE TABLE` statement in a `.moor` file.
- You can then use these tables in the database and with daos by using the `include` parameter
- on `@UseMoor` and `@UseDao`. Again, please notice that this is an experimental api and there
- might be some hiccups. Please report any issues you run into.
-
-## 1.6.0
-- Experimental web support! See [the documentation](https://drift.simonbinder.eu/web) for details.
-- Make transactions easier to use: Thanks to some Dart async magic, you no longer need to run
- queries on the transaction explicitly. This
- ```dart
- Future deleteCategory(Category category) {
- return transaction((t) async {
- await t.delete(categories).delete(category);
- });
- }
- ```
- is now the same as this (notice how we don't have to use the `t.` in front of the delete)
- ```dart
- Future deleteCategory(Category category) {
- return transaction((t) async {
- await delete(categories).delete(category);
- });
- }
- ```
- This makes it much easier to compose operations by extracting them into methods, as you don't
- have to worry about not using the `t` parameter.
-- Moor now provides syntax sugar for list parameters in compiled custom queries
- (`SELECT * FROM entries WHERE id IN ?`)
-- Support `COLLATE` expressions.
-- Date time columns are now comparable
-- The `StringType` now supports arbitrary data from sqlite ([#70](https://github.com/simolus3/drift/pull/70)).
- Thanks, [knaeckeKami](https://github.com/knaeckeKami)!
-- Bugfixes related to stream queries and `LIMIT` clauses.
-
-## 1.5.0
-This version introduces some new concepts and features, which are explained in more detail below.
-Here is a quick overview of the new features:
-- More consistent and reliable callbacks for migrations. You can now use `MigrationStrategy.beforeOpen`
-to run queries after migrations, but before fully opening the database. This is useful to initialize data.
-- Greatly expanded documentation, introduced additional checks to provide more helpful error messages
-- New `getSingle` and `watchSingle` methods on queries: Queries that you know will only
- return one row can now be instructed to return the value directly instead of wrapping it in a list.
-- New "update companion" classes to clearly separate between absent values and explicitly setting
-values back to null - explained below.
-- Experimental support for compiled sql queries: __Moor can now generate typesafe APIs for
- written sql__. Read on to get started.
-
-### Update companions
-Newly introduced "Update companions" allow you to insert or update data more precisely than before.
-Previously, there was no clear separation between "null" and absent values. For instance, let's
-say we had a table "users" that stores an id, a name, and an age. Now, let's say we wanted to set
-the age of a user to null without changing its name. Would we use `User(age: null)`? Here,
-the `name` column would implicitly be set to null, so we can't cleanly separate that. However,
-with `UsersCompanion(age: Value(null))`, we know the difference between `Value(null)` and the
-default `Value.absent()`.
-
-Don't worry, all your existing code will continue to work, this change is fully backwards
-compatible. You might get analyzer warnings about missing required fields. The migration to
-update companions will fix that. Replacing normal classes with their update companions is simple
-and the only thing needed to fix that. The [documentation](https://drift.simonbinder.eu/queries/#updates-and-deletes)
-has been updated to reflect this. If you have additional questions, feel free to
-[create an issue](https://github.com/simolus3/drift/issues/new).
-### Compiled sql queries
-Experimental support for compile time custom statements. Sounds super boring, but it
-actually gives you a fluent way to write queries in pure sql. The moor generator will figure
-out what your queries return and automatically generate the boring mapping part. Head on to
-[the documentation](https://drift.simonbinder.eu/queries/custom) to find out how to use this new feature.
-
-Please note that this feature is in an experimental state: Expect minor, but breaking changes
-in the API and in the generated code. Also, if you run into any issues with this feature,
-[reporting them](https://github.com/simolus3/drift/issues/new) would be super appreciated.
-
-## 1.4.0
-- Added the `RealColumn`, which stores floating point values
-- Better configuration for the serializer with the `JsonKey` annotation and the ability to
-use a custom `ValueSerializer`s
-
-## 1.3.0
-- Moor now supports table joins
- - Added table aliases
-- Default values for columns: Just use the `withDefault` method when declaring a column
- - added expressions that resolve to the current date or time
-- Fixed a crash that would occur if the first operation was a transaction
-- Better support for custom expressions as part of a regular query
-- Faster hashcode implementation in generated data classes
-
-## 1.2.0
-Changes from the moor and moor_generator libraries:
-- __Breaking__: Generated DAO classes are now called `_$YourNameHere`, it used to
-be just `_YourNameHere` (without the dollar sign)
-- Blob data type
-- `insertOrReplace` method for insert statements
-- DAOs can now operate on transactions
-- Custom constraints
-- Query streams are now cached so that equal queries yield identical streams.
- This can improve performance.
-- Generated classes now use lazy getters instead of recalculating fields on each access
-- Data classes can be converted from and to json
-
-## 1.1.0
-- Transactions
-
-## 1.0.0
-- Initial release
diff --git a/moor_flutter/LICENSE b/moor_flutter/LICENSE
deleted file mode 100644
index e4b21941..00000000
--- a/moor_flutter/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2019 Simon Binder
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/moor_flutter/README.md b/moor_flutter/README.md
deleted file mode 100644
index 70761ac5..00000000
--- a/moor_flutter/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# `moor_flutter`
-
-__Important notice__: Moor has been renamed to Drift.
-This package will continue to be supported for a while, but we encourage users to migrate to `drift` and `drift_sqflite`.
-Automated tooling to help you make the switch is available! For more information, see [the documentation](https://drift.simonbinder.eu/name/).
-Thanks yor your understanding!
-
-Please see the homepage of [drift](https://drift.simonbinder.eu/) for details on how to use this package.
diff --git a/moor_flutter/analysis_options.yaml b/moor_flutter/analysis_options.yaml
deleted file mode 100644
index 98d91963..00000000
--- a/moor_flutter/analysis_options.yaml
+++ /dev/null
@@ -1,175 +0,0 @@
-analyzer:
- strong-mode:
- implicit-casts: false
- errors:
- unused_element: error
- unused_import: error
- unused_local_variable: error
- dead_code: error
- public_member_api_docs: ignore # turned on by user-facing subpackages
- deprecated_member_use_from_same_package: ignore
- exclude:
- - "**/*.g.dart"
- # Will be analyzed anyway, nobody knows why ¯\_(ツ)_/¯. We're only analyzing lib/ and test/ as a workaround
- - ".dart_tool/build/entrypoint/build.dart"
- - "tool/**"
- - "**/*.mocks.dart"
-
-# this should always include all rules. Those we don't use are commented out
-linter:
- rules:
- # ERROR RULES
- - avoid_empty_else
- # - avoid_print (all our prints can be turned off)
- - avoid_relative_lib_imports
- - avoid_returning_null_for_future
- # - avoid_slow_async_io
- - avoid_types_as_parameter_names
- - cancel_subscriptions
- - close_sinks
- - comment_references
- - control_flow_in_finally
- # - diagnostic_describe_all_properties (Flutter-specific, not relevant for us)
- - empty_statements
- - hash_and_equals
- # - invariant_booleans (turned off because the lint rule is buggy)
- - iterable_contains_unrelated_type
- - list_remove_unrelated_type
- - literal_only_boolean_expressions
- - no_adjacent_strings_in_list
- - no_duplicate_case_values
- # - prefer_relative_imports (clashes with avoid_relative_lib_imports)
- # - prefer_void_to_null (we do use Null as a type for alwaysThrows functions)
- - test_types_in_equals
- - throw_in_finally
- - unnecessary_statements
- - unrelated_type_equality_checks
- - unsafe_html
- - valid_regexps
- # STYLE RULES
- - always_declare_return_types
- # - always_put_control_body_on_new_line (we don't do this if it fits on the same line)
- # - always_put_required_named_parameters_first (we just don't do this)
- # - always_require_non_null_named_parameters (we don't use assert foo != null for parameters)
- # - always_specify_types (we prefer to omit the type parameter when possible)
- - annotate_overrides
- # - avoid_annotating_with_dynamic (we prefer to make dynamic explicit)
- # - avoid_as (we prefer to make explicit casts explicit!)
- - avoid_bool_literals_in_conditional_expressions
- # - avoid_catches_without_on_clauses (we have a lot of generic catches)
- - avoid_catching_errors
- - avoid_classes_with_only_static_members
- - avoid_double_and_int_checks
- # - avoid_equals_and_hash_code_on_mutable_classes (lint is to generic for transient fields)
- - avoid_field_initializers_in_const_classes
- - avoid_function_literals_in_foreach_calls
- # - avoid_implementing_value_types (maybe we can consider turning this on?)
- - avoid_init_to_null
- - avoid_js_rounded_ints
- - avoid_null_checks_in_equality_operators
- # - avoid_positional_boolean_parameters (there pretty useful when there's only one boolean param)
- # - avoid_private_typedef_functions (they're still useful)
- - avoid_renaming_method_parameters
- - avoid_return_types_on_setters
- - avoid_returning_null
- - avoid_returning_null_for_void
- - avoid_returning_this
- - avoid_setters_without_getters
- - avoid_shadowing_type_parameters
- - avoid_single_cascade_in_expression_statements
- # - avoid_types_on_closure_parameters (the interference isn't THAT good)
- # - avoid_unnecessary_containers (Flutter-specific, not relevant here)
- - avoid_unused_constructor_parameters
- - avoid_void_async
- - await_only_futures
- - camel_case_extensions
- - camel_case_types
- # - cascade_invocations (sometimes the explicit notation is more readable)
- - constant_identifier_names
- - curly_braces_in_flow_control_structures
- - directives_ordering
- - empty_catches
- - empty_constructor_bodies
- - file_names
- # - flutter_style_todos (Flutter-development specific, not relevant here)
- - implementation_imports
- - join_return_with_assignment
- - library_names
- - library_prefixes
- - lines_longer_than_80_chars
- - non_constant_identifier_names
- - null_closures
- - omit_local_variable_types
- # - one_member_abstracts (there are cases where a one-member abstract class makes sense, see moor's Insertable)
- - only_throw_errors
- - overridden_fields
- - package_api_docs
- # - package_prefixed_library_names (this isn't java)
- # - parameter_assignments (we regularly use this to set default values)
- - prefer_adjacent_string_concatenation
- - prefer_asserts_in_initializer_lists
- # - prefer_asserts_with_message (it's annoying to write messages for internal invariants)
- - prefer_collection_literals
- - prefer_conditional_assignment
- - prefer_const_constructors
- - prefer_const_constructors_in_immutables
- - prefer_const_declarations
- - prefer_const_literals_to_create_immutables
- - prefer_constructors_over_static_methods
- - prefer_contains
- # - prefer_double_quotes (we prefer single quotes)
- - prefer_equal_for_default_values
- # - prefer_expression_function_bodies (for multiline expressions, this is ugly to format)
- - prefer_final_fields
- - prefer_final_in_for_each
- - prefer_final_locals
- - prefer_for_elements_to_map_fromIterable
- - prefer_foreach
- - prefer_function_declarations_over_variables
- - prefer_generic_function_type_aliases
- - prefer_if_elements_to_conditional_expressions
- - prefer_if_null_operators
- - prefer_initializing_formals
- - prefer_inlined_adds
- - prefer_int_literals
- - prefer_interpolation_to_compose_strings
- - prefer_is_empty
- - prefer_is_not_empty
- - prefer_is_not_operator
- - prefer_iterable_whereType
- # - prefer_mixin (todo we could consider enabling this)
- - prefer_null_aware_operators
- - prefer_single_quotes
- - prefer_spread_collections
- - prefer_typing_uninitialized_variables
- - provide_deprecation_message
- - public_member_api_docs
- - recursive_getters
- - slash_for_doc_comments
- # - sort_child_properties_last (Flutter specific)
- # - sort_constructors_first (we don't do this)
- # - sort_unnamed_constructors_first
- - type_annotate_public_apis
- - type_init_formals
- - unawaited_futures
- - unnecessary_brace_in_string_interps
- - unnecessary_const
- # - unnecessary_final (we prefer final here)
- - unnecessary_getters_setters
- - unnecessary_lambdas
- - unnecessary_new
- - unnecessary_null_aware_assignments
- - unnecessary_null_in_if_null_operators
- - unnecessary_overrides
- - unnecessary_parenthesis
- - unnecessary_this
- # - use_full_hex_values_for_flutter_colors (Flutter specific)
- - use_function_type_syntax_for_parameters
- - use_rethrow_when_possible
- - use_setters_to_change_properties
- - use_string_buffers
- # - use_to_and_as_if_applicable (false positive on operators)
- - void_checks
- # PUB RULES
- - package_names
-# - sort_pub_dependencies (we prefer to group them by what they do)
\ No newline at end of file
diff --git a/moor_flutter/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/moor_flutter/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
deleted file mode 100644
index aff2f141..00000000
--- a/moor_flutter/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package io.flutter.plugins;
-
-import io.flutter.plugin.common.PluginRegistry;
-import com.tekartik.sqflite.SqflitePlugin;
-
-/**
- * Generated file. Do not edit.
- */
-public final class GeneratedPluginRegistrant {
- public static void registerWith(PluginRegistry registry) {
- if (alreadyRegisteredWith(registry)) {
- return;
- }
- SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
- }
-
- private static boolean alreadyRegisteredWith(PluginRegistry registry) {
- final String key = GeneratedPluginRegistrant.class.getCanonicalName();
- if (registry.hasPlugin(key)) {
- return true;
- }
- registry.registrarFor(key);
- return false;
- }
-}
diff --git a/moor_flutter/example/.gitignore b/moor_flutter/example/.gitignore
deleted file mode 100644
index 47e0b4d6..00000000
--- a/moor_flutter/example/.gitignore
+++ /dev/null
@@ -1,71 +0,0 @@
-# Miscellaneous
-*.class
-*.lock
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.buildlog/
-.history
-.svn/
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# Visual Studio Code related
-.vscode/
-
-# Flutter/Dart/Pub related
-**/doc/api/
-.dart_tool/
-.flutter-plugins
-.packages
-.pub-cache/
-.pub/
-build/
-
-# Android related
-**/android/**/gradle-wrapper.jar
-**/android/.gradle
-**/android/captures/
-**/android/gradlew
-**/android/gradlew.bat
-**/android/local.properties
-**/android/**/GeneratedPluginRegistrant.java
-
-# iOS/XCode related
-**/ios/**/*.mode1v3
-**/ios/**/*.mode2v3
-**/ios/**/*.moved-aside
-**/ios/**/*.pbxuser
-**/ios/**/*.perspectivev3
-**/ios/**/*sync/
-**/ios/**/.sconsign.dblite
-**/ios/**/.tags*
-**/ios/**/.vagrant/
-**/ios/**/DerivedData/
-**/ios/**/Icon?
-**/ios/**/Pods/
-**/ios/**/.symlinks/
-**/ios/**/profile
-**/ios/**/xcuserdata
-**/ios/.generated/
-**/ios/Flutter/App.framework
-**/ios/Flutter/Flutter.framework
-**/ios/Flutter/Generated.xcconfig
-**/ios/Flutter/app.flx
-**/ios/Flutter/app.zip
-**/ios/Flutter/flutter_assets/
-**/ios/ServiceDefinitions.json
-**/ios/Runner/GeneratedPluginRegistrant.*
-
-# Exceptions to above rules.
-!**/ios/**/default.mode1v3
-!**/ios/**/default.mode2v3
-!**/ios/**/default.pbxuser
-!**/ios/**/default.perspectivev3
-!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
diff --git a/moor_flutter/example/.metadata b/moor_flutter/example/.metadata
deleted file mode 100644
index 460bc20b..00000000
--- a/moor_flutter/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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
- channel: stable
-
-project_type: app
diff --git a/moor_flutter/example/android/app/build.gradle b/moor_flutter/example/android/app/build.gradle
deleted file mode 100644
index ad1ba37a..00000000
--- a/moor_flutter/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 30
-
- 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 "eu.simonbinder.moor_example.example"
- minSdkVersion 16
- targetSdkVersion 30
- 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/moor_flutter/example/android/app/src/debug/AndroidManifest.xml b/moor_flutter/example/android/app/src/debug/AndroidManifest.xml
deleted file mode 100644
index 38643255..00000000
--- a/moor_flutter/example/android/app/src/debug/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/moor_flutter/example/android/app/src/main/AndroidManifest.xml b/moor_flutter/example/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 1c658d0b..00000000
--- a/moor_flutter/example/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/android/app/src/main/kotlin/eu/simonbinder/moor_example/example/MainActivity.kt b/moor_flutter/example/android/app/src/main/kotlin/eu/simonbinder/moor_example/example/MainActivity.kt
deleted file mode 100644
index 83e65892..00000000
--- a/moor_flutter/example/android/app/src/main/kotlin/eu/simonbinder/moor_example/example/MainActivity.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package eu.simonbinder.moor_example.example
-
-import io.flutter.embedding.android.FlutterActivity
-
-class MainActivity: FlutterActivity() {
-}
diff --git a/moor_flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml b/moor_flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml
deleted file mode 100644
index f74085f3..00000000
--- a/moor_flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/android/app/src/main/res/drawable/launch_background.xml b/moor_flutter/example/android/app/src/main/res/drawable/launch_background.xml
deleted file mode 100644
index 304732f8..00000000
--- a/moor_flutter/example/android/app/src/main/res/drawable/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/moor_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index db77bb4b..00000000
Binary files a/moor_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/moor_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/moor_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 17987b79..00000000
Binary files a/moor_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/moor_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/moor_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 09d43914..00000000
Binary files a/moor_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/moor_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/moor_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index d5f1c8d3..00000000
Binary files a/moor_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/moor_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/moor_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 4d6372ee..00000000
Binary files a/moor_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/moor_flutter/example/android/app/src/main/res/values-night/styles.xml b/moor_flutter/example/android/app/src/main/res/values-night/styles.xml
deleted file mode 100644
index 449a9f93..00000000
--- a/moor_flutter/example/android/app/src/main/res/values-night/styles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/android/app/src/main/res/values/styles.xml b/moor_flutter/example/android/app/src/main/res/values/styles.xml
deleted file mode 100644
index d74aa35c..00000000
--- a/moor_flutter/example/android/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/android/app/src/profile/AndroidManifest.xml b/moor_flutter/example/android/app/src/profile/AndroidManifest.xml
deleted file mode 100644
index 38643255..00000000
--- a/moor_flutter/example/android/app/src/profile/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/moor_flutter/example/android/build.gradle b/moor_flutter/example/android/build.gradle
deleted file mode 100644
index ed45c658..00000000
--- a/moor_flutter/example/android/build.gradle
+++ /dev/null
@@ -1,29 +0,0 @@
-buildscript {
- ext.kotlin_version = '1.3.50'
- 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}"
- project.evaluationDependsOn(':app')
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/moor_flutter/example/android/gradle.properties b/moor_flutter/example/android/gradle.properties
deleted file mode 100644
index 94adc3a3..00000000
--- a/moor_flutter/example/android/gradle.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-org.gradle.jvmargs=-Xmx1536M
-android.useAndroidX=true
-android.enableJetifier=true
diff --git a/moor_flutter/example/android/gradle/wrapper/gradle-wrapper.properties b/moor_flutter/example/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 595fb867..00000000
--- a/moor_flutter/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-7.2-all.zip
diff --git a/moor_flutter/example/android/settings.gradle b/moor_flutter/example/android/settings.gradle
deleted file mode 100644
index 44e62bcf..00000000
--- a/moor_flutter/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/moor_flutter/example/build.yaml b/moor_flutter/example/build.yaml
deleted file mode 100644
index 41580a28..00000000
--- a/moor_flutter/example/build.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-targets:
- $default:
- builders:
- moor_generator:
- options:
- compact_query_methods: true
\ No newline at end of file
diff --git a/moor_flutter/example/ios/Flutter/AppFrameworkInfo.plist b/moor_flutter/example/ios/Flutter/AppFrameworkInfo.plist
deleted file mode 100644
index 9367d483..00000000
--- a/moor_flutter/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
- 8.0
-
-
diff --git a/moor_flutter/example/ios/Flutter/Debug.xcconfig b/moor_flutter/example/ios/Flutter/Debug.xcconfig
deleted file mode 100644
index 592ceee8..00000000
--- a/moor_flutter/example/ios/Flutter/Debug.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/moor_flutter/example/ios/Flutter/Release.xcconfig b/moor_flutter/example/ios/Flutter/Release.xcconfig
deleted file mode 100644
index 592ceee8..00000000
--- a/moor_flutter/example/ios/Flutter/Release.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/moor_flutter/example/ios/Runner.xcodeproj/project.pbxproj b/moor_flutter/example/ios/Runner.xcodeproj/project.pbxproj
deleted file mode 100644
index 374bf0e0..00000000
--- a/moor_flutter/example/ios/Runner.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,518 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
- 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, ); }; };
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
- 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 = ""; };
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
- 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 = (
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
- 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 = 0910;
- ORGANIZATIONNAME = "The Chromium Authors";
- TargetAttributes = {
- 97C146ED1CF9000F007C117D = {
- CreatedOnToolsVersion = 7.3.1;
- LastSwiftMigration = 0910;
- };
- };
- };
- buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- 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 */,
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets 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_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_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;
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Profile;
- };
- 249021D4217E4FDB00AE95B9 /* Profile */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- DEVELOPMENT_TEAM = S8QB4VV633;
- 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 = eu.simonbinder.moor_example.moorExample;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 4.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_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_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_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_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;
- 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 = eu.simonbinder.moor_example.moorExample;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.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 = eu.simonbinder.moor_example.moorExample;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.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/moor_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/moor_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 1d526a16..00000000
--- a/moor_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/moor_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/moor_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
deleted file mode 100644
index 786d6aad..00000000
--- a/moor_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/moor_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 1d526a16..00000000
--- a/moor_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/moor_flutter/example/ios/Runner/AppDelegate.swift b/moor_flutter/example/ios/Runner/AppDelegate.swift
deleted file mode 100644
index 71cc41e3..00000000
--- a/moor_flutter/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: [UIApplicationLaunchOptionsKey: Any]?
- ) -> Bool {
- GeneratedPluginRegistrant.register(with: self)
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
- }
-}
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index d36b1fab..00000000
--- a/moor_flutter/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/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
deleted file mode 100644
index 3d43d11e..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
deleted file mode 100644
index 28c6bf03..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
deleted file mode 100644
index 2ccbfd96..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
deleted file mode 100644
index f091b6b0..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
deleted file mode 100644
index 4cde1211..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
deleted file mode 100644
index d0ef06e7..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
deleted file mode 100644
index dcdc2306..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
deleted file mode 100644
index 2ccbfd96..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
deleted file mode 100644
index c8f9ed8f..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
deleted file mode 100644
index a6d6b860..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
deleted file mode 100644
index a6d6b860..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
deleted file mode 100644
index 75b2d164..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
deleted file mode 100644
index c4df70d3..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
deleted file mode 100644
index 6a84f41e..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
deleted file mode 100644
index d0e1f585..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
deleted file mode 100644
index 0bedcf2f..00000000
--- a/moor_flutter/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/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
deleted file mode 100644
index 9da19eac..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
deleted file mode 100644
index 9da19eac..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
deleted file mode 100644
index 9da19eac..00000000
Binary files a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ
diff --git a/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/moor_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
deleted file mode 100644
index 89c2725b..00000000
--- a/moor_flutter/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/moor_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/moor_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard
deleted file mode 100644
index f2e259c7..00000000
--- a/moor_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/ios/Runner/Base.lproj/Main.storyboard b/moor_flutter/example/ios/Runner/Base.lproj/Main.storyboard
deleted file mode 100644
index f3c28516..00000000
--- a/moor_flutter/example/ios/Runner/Base.lproj/Main.storyboard
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/moor_flutter/example/ios/Runner/Info.plist b/moor_flutter/example/ios/Runner/Info.plist
deleted file mode 100644
index e17d9d4e..00000000
--- a/moor_flutter/example/ios/Runner/Info.plist
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- moor_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/moor_flutter/example/ios/Runner/Runner-Bridging-Header.h b/moor_flutter/example/ios/Runner/Runner-Bridging-Header.h
deleted file mode 100644
index 7335fdf9..00000000
--- a/moor_flutter/example/ios/Runner/Runner-Bridging-Header.h
+++ /dev/null
@@ -1 +0,0 @@
-#import "GeneratedPluginRegistrant.h"
\ No newline at end of file
diff --git a/moor_flutter/example/lib/bloc.dart b/moor_flutter/example/lib/bloc.dart
deleted file mode 100644
index f748970e..00000000
--- a/moor_flutter/example/lib/bloc.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-import 'package:moor_example/database/database.dart';
-import 'package:moor_flutter/moor_flutter.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/moor_flutter/example/lib/database/database.dart b/moor_flutter/example/lib/database/database.dart
deleted file mode 100644
index d6abe209..00000000
--- a/moor_flutter/example/lib/database/database.dart
+++ /dev/null
@@ -1,160 +0,0 @@
-import 'dart:async';
-import 'package:moor_flutter/moor_flutter.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;
-}
-
-@UseMoor(
- 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(FlutterQueryExecutor.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 @UseMoor 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/moor_flutter/example/lib/database/database.g.dart b/moor_flutter/example/lib/database/database.g.dart
deleted file mode 100644
index a9ab01e9..00000000
--- a/moor_flutter/example/lib/database/database.g.dart
+++ /dev/null
@@ -1,474 +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, GeneratedDatabase db,
- {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 ??= moorRuntimeOptions.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 ??= moorRuntimeOptions.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