I've been trying to use moor in both mobile and web platform and I can't compile mobile platform while web is fine.
Would appreciate any help.
Thanks!
pubspec.yaml
name: flutter_web_app
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.2.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
moor: ^2.0.0
moor_flutter: ^2.0.0
dev_dependencies:
moor_generator: ^2.0.0
build_runner:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
database.dart
import 'dart:core';
import 'package:moor/moor.dart';
import 'package:moor_flutter/moor_flutter.dart';
import 'package:moor/moor_web.dart';
part 'database.g.dart';
@DataClassName("UserEntry")
class User extends Table {
@override
String get tableName => "user";
@override
Set<Column> get primaryKey => {id};
@JsonKey("UserId")
TextColumn get id => text()();
@JsonKey("Compid")
TextColumn get compId => text()();
@JsonKey("CompanyName")
TextColumn get compName => text()();
@JsonKey("UserName")
TextColumn get userName => text()();
@JsonKey("TreeNo")
TextColumn get treeNo => text()();
@JsonKey("Grants")
TextColumn get grants => text()();
@JsonKey("Admin")
TextColumn get admin => text()();
@JsonKey("WrkWhs")
TextColumn get wrkWhs => text()();
@JsonKey("WhsCode")
TextColumn get whsCode => text()();
@JsonKey("UserType")
TextColumn get userType => text()();
@JsonKey("Return")
TextColumn get isReturn => text()();
}
@UseMoor(tables: [User],
queries: {
'_deleteUser': 'DELETE FROM user'
})
class MyDatabase extends _$MyDatabase {
MyDatabase(QueryExecutor e)
: super(e);
@override
int get schemaVersion => 3;
@override
MigrationStrategy get migration =>
MigrationStrategy(onUpgrade: (Migrator m, int from, int to) async {
for (var table in allTables) {
await m.deleteTable(table.actualTableName);
await m.createTable(table);
}
});
Future<UserEntry> getUser() => select(user).getSingle();
Future<int> insertUser(UserEntry entry) {
return into(user).insert(entry);
}
Future<int> deleteUser() {
return _deleteUser();
}
}
main.dart
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:moor/moor_web.dart' as moor_web;
import 'package:moor_flutter/moor_flutter.dart' as moor_flutter;
import 'database.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
MyDatabase _database;
String userId = "";
@override
Widget build(BuildContext context) {
_database ??= kIsWeb
? MyDatabase(moor_web.WebDatabase('app'))
: MyDatabase(moor_flutter.FlutterQueryExecutor.inDatabaseFolder(
path: 'db.sqlite'));
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("User id: $userId"),
RaisedButton(
child: Text("Login"),
onPressed: () {
final response = """
[{"UserId":"1234","Compid":"null","CompanyName":"null","UserName":"null","TreeNo":"null","Grants":"null","Admin":"null","WrkWhs":"null","WhsCode":"null","UserType":"null","Return":"2"}]
""";
final jsonArray = json.decode(response.toString());
final user = UserEntry.fromJson(jsonArray[0]);
_database.insertUser(user).then((_) {
setState(() {
userId = user.id;
});
});
},
)
],
),
),
);
}
}
Logs
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Invalid depfile: /Users/eitanaflalo/FlutterProjects/flutter_web_app/flutter_web_app/.dart_tool/flutter_build/c73eb6e8efe1ae8bbac2c6b31365eadf/kernel_snapshot.d
Invalid depfile: /Users/eitanaflalo/FlutterProjects/flutter_web_app/flutter_web_app/.dart_tool/flutter_build/c73eb6e8efe1ae8bbac2c6b31365eadf/kernel_snapshot.d
Compiler message:
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/moor_web.dart:9:8: Error: Not found: 'dart:html'
import 'dart:html';
^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:2:8: Error: Not found: 'dart:js'
import 'dart:js';
^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:42:9: Error: Type 'JsObject' not found.
final JsObject _obj;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:57:3: Error: Type 'JsObject' not found.
JsObject _createInternally(Uint8List data) {
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:70:9: Error: Type 'JsObject' not found.
final JsObject _obj;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:122:9: Error: Type 'JsObject' not found.
final JsObject _obj;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/web_db.dart:125:17: Error: The getter 'window' isn't defined for the class '_WebDelegate'.
- '_WebDelegate' is from 'package:moor/moor_web.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/moor_web.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
final raw = window.localStorage[_persistenceKey];
^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/web_db.dart:136:7: Error: The getter 'window' isn't defined for the class '_WebDelegate'.
- '_WebDelegate' is from 'package:moor/moor_web.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/moor_web.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
window.localStorage[_persistenceKey] = binStr;
^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/web_db.dart:149:10: Error: The getter 'window' isn't defined for the class '_WebVersionDelegate'.
- '_WebVersionDelegate' is from 'package:moor/moor_web.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/moor_web.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
if (!window.localStorage.containsKey(_versionKey)) {
^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/web_db.dart:152:24: Error: The getter 'window' isn't defined for the class '_WebVersionDelegate'.
- '_WebVersionDelegate' is from 'package:moor/moor_web.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/moor_web.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
final versionStr = window.localStorage[_versionKey];
^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/web_db.dart:159:5: Error: The getter 'window' isn't defined for the class '_WebVersionDelegate'.
- '_WebVersionDelegate' is from 'package:moor/moor_web.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/moor_web.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
window.localStorage[_versionKey] = version.toString();
^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:19:8: Error: Getter not found: 'context'.
if (!context.hasProperty('initSqlJs')) {
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:26:4: Error: Getter not found: 'context'.
(context.callMethod('initSqlJs') as JsObject)
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:26:39: Error: 'JsObject' isn't a type.
(context.callMethod('initSqlJs') as JsObject)
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:37:53: Error: 'JsObject' isn't a type.
_moduleCompleter.complete(SqlJsModule._(module as JsObject));
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:42:9: Error: 'JsObject' isn't a type.
final JsObject _obj;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:50:7: Error: The getter 'context' isn't defined for the class 'SqlJsModule'.
- 'SqlJsModule' is from 'package:moor/src/web/sql_js.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'context'.
context['db'] = dbObj;
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:58:45: Error: 'JsFunction' isn't a type.
final constructor = _obj['Database'] as JsFunction;
^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:61:14: Error: The method 'JsObject' isn't defined for the class 'SqlJsModule'.
- 'SqlJsModule' is from 'package:moor/src/web/sql_js.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart').
Try correcting the name to the name of an existing method, or defining a method named 'JsObject'.
return JsObject(constructor, [data]);
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:63:14: Error: The method 'JsObject' isn't defined for the class 'SqlJsModule'.
- 'SqlJsModule' is from 'package:moor/src/web/sql_js.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart').
Try correcting the name to the name of an existing method, or defining a method named 'JsObject'.
return JsObject(constructor);
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:70:9: Error: 'JsObject' isn't a type.
final JsObject _obj;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:75:54: Error: 'JsObject' isn't a type.
final obj = _obj.callMethod('prepare', [sql]) as JsObject;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:86:16: Error: The getter 'JsArray' isn't defined for the class 'SqlJsDatabase'.
- 'SqlJsDatabase' is from 'package:moor/src/web/sql_js.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'JsArray'.
final ar = JsArray.from(args);
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:101:71: Error: 'JsArray' isn't a type.
.callMethod('exec', const ['SELECT last_insert_rowid();']) as JsArray;
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:102:34: Error: 'JsObject' isn't a type.
final row = results.first as JsObject;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:103:36: Error: 'JsArray' isn't a type.
final data = (row['values'] as JsArray).first as JsArray;
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:103:54: Error: 'JsArray' isn't a type.
final data = (row['values'] as JsArray).first as JsArray;
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:122:9: Error: 'JsObject' isn't a type.
final JsObject _obj;
^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:127:30: Error: The getter 'JsArray' isn't defined for the class 'PreparedStatement'.
- 'PreparedStatement' is from 'package:moor/src/web/sql_js.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'JsArray'.
_obj.callMethod('bind', [JsArray.from(args)]);
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:137:38: Error: 'JsArray' isn't a type.
return _obj.callMethod('get') as JsArray;
^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-2.0.1+1/lib/src/web/sql_js.dart:143:50: Error: 'JsArray' isn't a type.
return (_obj.callMethod('getColumnNames') as JsArray).cast<String>();
^^^^^^^
../../../development/flutter/packages/flutter/lib/src/painting/_network_image_web.dart:64:12: Error: Method not found: 'webOnlyInstantiateImageCodecFromUrl'.
return ui.webOnlyInstantiateImageCodecFromUrl(resolved); // ignore: undefined_function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ahtml; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
#1 asFileUri (package:vm/kernel_front_end.dart:555:37)
<asynchronous suspension>
#2 writeDepfile (package:vm/kernel_front_end.dart:745:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:452:15)
<asynchronous suspension>
#4 _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:38:22)
<asynchronous suspension>
#5 starter (package:flutter_frontend_server/server.dart:149:27)
<asynchronous suspension>
#6 main (file:///b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:8:30)
<asynchronous suspension>
#7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
Exception: Errors during snapshot creation: null
#0 KernelSnapshot.build (package:flutter_tools/src/build_system/targets/dart.dart:182:7)
<asynchronous suspension>
#1 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:526:25)
<asynchronous suspension>
#2 _BuildInstance.invokeTarget.<anonymous closure> (package:flutter_tools/src/build_system/build_system.dart:481:35)
#3 new Future.sync (dart:async/future.dart:222:31)
#4 AsyncMemoizer.runOnce (package:async/src/async_memoizer.dart:43:45)
#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:481:21)
<asynchronous suspension>
<asynchronous suspension>
#6 BuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:419:36)
<asynchronous suspension>
#7 buildWithAssemble (package:flutter_tools/src/bundle.dart:125:48)
<asynchronous suspension>
#8 BundleBuilder.build (package:flutter_tools/src/bundle.dart:75:11)
<asynchronous suspension>
#9 BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:126:25)
<asynchronous suspension>
#10 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:557:18)
<asynchronous suspension>
#11 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:457:33)
<asynchronous suspension>
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:157:29)
<asynchronous suspension>
#13 _rootRun (dart:async/zone.dart:1124:13)
#14 _CustomZone.run (dart:async/zone.dart:1021:19)
#15 _runZoned (dart:async/zone.dart:1516:10)
#16 runZoned (dart:async/zone.dart:1463:12)
#17 AppContext.run (package:flutter_tools/src/base/context.dart:156:18)
<asynchronous suspension>
#18 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:446:20)
#19 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#20 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:416:21)
<asynchronous suspension>
#21 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:157:29)
<asynchronous suspension>
#22 _rootRun (dart:async/zone.dart:1124:13)
#23 _CustomZone.run (dart:async/zone.dart:1021:19)
#24 _runZoned (dart:async/zone.dart:1516:10)
#25 runZoned (dart:async/zone.dart:1463:12)
#26 AppContext.run (package:flutter_tools/src/base/context.dart:156:18)
<asynchronous suspension>
#27 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:367:19)
<asynchronous suspension>
#28 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#29 new Future.sync (dart:async/future.dart:222:31)
#30 CommandRunner.run (package:args/command_runner.dart:112:14)
#31 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:251:18)
#32 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22)
<asynchronous suspension>
#33 _rootRun (dart:async/zone.dart:1124:13)
#34 _CustomZone.run (dart:async/zone.dart:1021:19)
#35 _runZoned (dart:async/zone.dart:1516:10)
#36 runZoned (dart:async/zone.dart:1500:12)
#37 run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>
#38 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:157:29)
<asynchronous suspension>
#39 _rootRun (dart:async/zone.dart:1124:13)
#40 _CustomZone.run (dart:async/zone.dart:1021:19)
#41 _runZoned (dart:async/zone.dart:1516:10)
#42 runZoned (dart:async/zone.dart:1463:12)
#43 AppContext.run (package:flutter_tools/src/base/context.dart:156:18)
<asynchronous suspension>
#44 runInContext (package:flutter_tools/src/context_runner.dart:64:24)
<asynchronous suspension>
#45 run (package:flutter_tools/runner.dart:50:10)
#46 main (package:flutter_tools/executable.dart:65:9)
<asynchronous suspension>
#47 main (file:///Users/eitanaflalo/development/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#48 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#49 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
Failed to build bundle.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/eitanaflalo/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 782
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugX86'.
> Process 'command '/Users/eitanaflalo/development/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
Finished with error: Gradle task assembleDebug failed with exit code 1
The compiler will still try to pull in everything that's in an import, even if it's never used. The setup from this repo should give a good overview on how to use moor across platforms. Basically, you only depend on the moor package in shared code (not moor_flutter, not moor/web.dart). Then, you can extract the code that creates the QueryExecutor in another file (one for each platform) and use conditional exports to glue everything together.
@simolus3 Thank you for your answer, it worked perfectly!
I have now another error I'm getting on Chrome console which prevents my app working properly.
I'm trying to get the user from the database with the following code:
final user = await _database.getUser();
And I'm getting the following error and the rest of the code won't execute:
js_primitives.dart:30
errors.dart:145 Uncaught (in promise) Error: Bad state: Expected exactly one result, but found more than one!
at Object.throw_ [as throw] (errors.dart:194)
at SimpleSelectStatement.new.getSingle (query.dart:116)
at getSingle.next (<anonymous>)
at onValue (async_patch.dart:45)
at _RootZone.runUnary (zone.dart:1379)
at _FutureListener.thenAwait.handleValue (future_impl.dart:137)
at handleValueCallback (future_impl.dart:678)
at Function._propagateToListeners (future_impl.dart:707)
at _Future.immediate.[_completeWithValue] (future_impl.dart:522)
at async._AsyncCallbackEntry.new.callback (future_impl.dart:552)
at Object._microtaskLoop (schedule_microtask.dart:41)
at _startMicrotaskLoop (schedule_microtask.dart:50)
at async_patch.dart:166
Is it by any change related to moor?
P.S. I'm using Provider
This is likely a bug in your application. You're probably using something like select(users).getSingle() in the implementation of getUser(). For getSingle() to work, the select statement must not return more than one row. Can you check whether more than one user could be in the database at the same time? If that should be possible, you probably want a list of users without getSingle. Otherwise, you would probably have to check for inserts and see what's causing more than one user to be written.
I have same issue. I am not even using moor_web or something.
@vimalmistry found the problem?
@luccasmaso Are you getting an error because of dart:html or dart:js not being found? If so, can you check if you're really not importing package:moor/moor_web.dart somewhere? That's the only public library where moor depends on web-only Dart...
If you post the error message you're getting I probably help more.
@simolus3 Sorry about that. Minutes later I figured out that my IDE automatically imported the web lib for one specific file.
No problem. It was my mistake to have moor_web export moor. It's way to easy to accidentally import the wrong one like that. This will be fixed in the next breaking release.
Most helpful comment
No problem. It was my mistake to have
moor_webexportmoor. It's way to easy to accidentally import the wrong one like that. This will be fixed in the next breaking release.