sawolabs / flutter-sdk

Passwordless and OTP-less Authentication for your website and app. It helps you to authenticate users via their email or phone number.
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

Problems w/ flutter resolving packages #4

Open bartonhammond opened 2 years ago

bartonhammond commented 2 years ago

Steps to reproduce

1) git clone https://github.com/sawolabs/flutter-sdk.git 2) mv example ../../sawoflutter 3) cd ../../sawoflutter 3.5) flutter create . (there was no "web" directory in the example) 4) copy api/secret key after making hybrid/flutter app 5) flutter pub get 6) flutter run -d chrome

Results

[sawoflutter]$ flutter run -d chrome
Launching lib/main.dart on Chrome in debug mode...
Error: Couldn't resolve the package 'flutter_web_plugins' in
'package:flutter_web_plugins/flutter_web_plugins.dart'.
org-dartlang-app:/web_entrypoint.dart:8:8: Error: Not found:
'package:flutter_web_plugins/flutter_web_plugins.dart'
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
       ^
lib/generated_plugin_registrant.dart:10:8: Error: Not found:
'package:flutter_web_plugins/flutter_web_plugins.dart'
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
       ^
lib/generated_plugin_registrant.dart:8:8: Error: Error when reading
'../../../.pub-cache/hosted/pub.dartlang.org/sawo-0.1.2/lib/': Is a directory
import 'package:sawo/';
       ^
lib/generated_plugin_registrant.dart:13:22: Error: Type 'Registrar' not found.
void registerPlugins(Registrar registrar) {
                     ^^^^^^^^^
org-dartlang-app:/web_entrypoint.dart:14:19: Error: Undefined name
'webPluginRegistrar'.
  registerPlugins(webPluginRegistrar);
                  ^^^^^^^^^^^^^^^^^^
lib/generated_plugin_registrant.dart:13:22: Error: 'Registrar' isn't a type.
void registerPlugins(Registrar registrar) {
                     ^^^^^^^^^
lib/generated_plugin_registrant.dart:14:3: Error: Undefined name 'SawoPlugin'.
  SawoPlugin.registerWith(registrar);
  ^^^^^^^^^^
Unhandled exception:
NoSuchMethodError: The getter 'path' was called on null.
Receiver: null
Tried calling: path
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:68:5)
#1      JavaScriptBundler.compile
(package:frontend_server/src/javascript_bundle.dart:164:65)
<asynchronous suspension>
#2      FrontendCompiler.writeJavascriptBundle
(package:frontend_server/frontend_server.dart:650:32)
<asynchronous suspension>
#3      FrontendCompiler.compile
(package:frontend_server/frontend_server.dart:558:9)
<asynchronous suspension>
#4      listenAndCompile.<anonymous closure>
(package:frontend_server/frontend_server.dart:1135:11)
<asynchronous suspension>
the Dart compiler exited unexpectedly.
Waiting for connection from debug service on Chrome...              8.1s
Failed to compile application.
bartonhammond commented 2 years ago

I added this to pubspec.yaml

  flutter_web_plugins:
    sdk: flutter

And then run flutter run -d chrome with these results:

[sawoflutter]$ flutter run -d chrome
Running "flutter pub get" in sawoflutter...                      1,310ms
Launching lib/main.dart on Chrome in debug mode...
lib/generated_plugin_registrant.dart:8:8: Error: Error when reading
'../../../.pub-cache/hosted/pub.dartlang.org/sawo-0.1.2/lib/': Is a directory
import 'package:sawo/';
       ^
lib/generated_plugin_registrant.dart:14:3: Error: Undefined name 'SawoPlugin'.
  SawoPlugin.registerWith(registrar);
  ^^^^^^^^^^

Here is generated_plugin_resgistrant.dart:

//
// Generated file. Do not edit.
//

// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars

import 'package:sawo/';

import 'package:flutter_web_plugins/flutter_web_plugins.dart';

// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
  SawoPlugin.registerWith(registrar);
  registrar.registerMessageHandler();
}