Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Undefined name 'SqflitePluginWeb' #17

Closed
ristiisa opened this issue Jun 21, 2021 · 3 comments
Closed

Undefined name 'SqflitePluginWeb' #17

ristiisa opened this issue Jun 21, 2021 · 3 comments

Comments

@ristiisa
Copy link

ristiisa commented Jun 21, 2021

I'm not really sure this is a bug or an issue with this library. But asking still...

When I add the dependency to a project the generated_plugin_registrant.dart has some errors:

% flutter analyze 
Running "flutter pub get" in web...                              1,354ms
Analyzing web...                                                        

   info • Unused import: 'package:sqflite_web/sqflite_web.dart' • lib/generated_plugin_registrant.dart:7:8 • unused_import
  error • Undefined name 'SqflitePluginWeb' • lib/generated_plugin_registrant.dart:13:3 • undefined_identifier

A minimal error producing pubspec.yaml:

name: web
description: A new Flutter project.
version: 1.0.0+1
environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  sqflite_web:
    git:
      url: https://github.com/deakjahn/sqflite_web.git
      ref: 16350eaeaeee949db3c073cbc95a5e3f2880f096

flutter:
  uses-material-design: true

I'm asking because the project runs and works in web but tooling seems to be confused about it...

I'm running Flutter stable 2.2.2

@deakjahn
Copy link
Owner

No, that's quite common that the IDE shows errors or wavy underlines while the project still runs. If it does, it's just a nuisance.

Such false errors can usually be suppressed but in this case, this is an automatically generated file, so whatever comment you put there will be removed the next time around...

@shaozict
Copy link

export 'src/sqflite_web_stub.dart' if (dart.library.html) 'src/sqflite_web.dart';
The error should be caused by this. It's not necessary.It should be written as
export 'src/sqflite_web.dart';

@deakjahn
Copy link
Owner

I don't think so. First, it's not an error, it's an IDE warning. Second, it will seemingly go away but the plugin will no longer be able to compile correctly on different platforms then. The if is there for a reason...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants