这是异常,我得到了在调试控制台,而我试图调试我的应用程序. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Launching lib\main.dart on ONEPLUS A3010 in debug mode...
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:43:3: Error: Type 'GotrueSubscription' not found.
GotrueSubscription? _authSubscription;
^^^^^^^^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:303:5: Error: Type 'AuthOptions' not found.
AuthOptions? options,
^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:43:3: Error: 'GotrueSubscription' isn't a type.
GotrueSubscription? _authSubscription;
^^^^^^^^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:111:16: Error: 'GotrueError' isn't a type.
} on GotrueError catch (error) {
^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:91:58: Error: 'onAuthStateChange' isn't a function or method and can't be invoked.
Supabase.instance.client.auth.onAuthStateChange((event, session) {
^^^^^^^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:109:68: Error: The getter 'data' isn't defined for the class 'AuthResponse'.
- 'AuthResponse' is from 'package:gotrue/src/types/auth_response.dart' ('/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/gotrue-1.11.2/lib/src/types/auth_response.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'data'.
_instance._initialSessionCompleter.complete(response.data);
^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:282:10: Error: 'GotrueError' isn't a type.
} on GotrueError catch (error) {
^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:303:5: Error: 'AuthOptions' isn't a type.
AuthOptions? options,
^^^^^^^^^^^
/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/supabase_flutter-1.0.0-dev.1/lib/src/supabase_auth.dart:305:23: Error: The method 'signIn' isn't defined for the class 'GoTrueClient'.
- 'GoTrueClient' is from 'package:gotrue/src/gotrue_client.dart' ('/C:/Users/saaho/AppData/Local/Pub/Cache/hosted/pub.dev/gotrue-1.11.2/lib/src/gotrue_client.dart').
Try correcting the name to the name of an existing method, or defining a method named 'signIn'.
final res = await signIn(
^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1201
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter dev\flutter\bin\flutter.bat'' 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 4m 25s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
字符串
环境> Flutter :^3.10.2|箭头:^3.0.2
这是我的主要职能。-
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
void main () async {
WidgetsFlutterBinding.ensureInitialized();
await Supabase.initialize(
url: 'https://dwjjiuxwwuwzhjycnwgw.supabase.co',
anonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImR3amppdXh3d3V3emhqeWNud2d3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTEyOTkwODAsImV4cCI6MjAwNjg3NTA4MH0.-_8_qRAu-akqpRuDut2pK80u0ZyPf_dlDS4f3s1Jsf8',
);
await Hive.initFlutter();
await Hive.openBox("MainBox");
runApp(const MyApp());
}
型
1条答案
按热度按时间fjaof16o1#
您使用的是旧的开发者预览版supabase_flutter。通过在pubspec.yaml文件中添加以下内容,尝试使用最新版本。
字符串