admin管理员组文章数量:1123776
I'm working on an app that utilizes some preferences for login. For this, I'm using the shared_preferences package. The preferences work fine, but when I made a script to clear them for testing purposes, I get a massive block of errors. I won't post them all here, but this is the first one:
../../../development/flutter/packages/flutter/lib/src/gestures/monodrag.dart:576:35: Error: The method 'Offset' isn't defined for the class 'DragGestureRecognizer'.
- 'DragGestureRecognizer' is from 'package:flutter/src/gestures/monodrag.dart' ('../../../development/flutter/packages/flutter/lib/src/gestures/monodrag.dart').
Try correcting the name to the name of an existing method, or defining a method named 'Offset'.
final Offset updatedDelta = Offset(averageX, averageY) - _lastUpdatedDeltaForPan;
This is a simpler copy of my script:
import 'package:shared_preferences/shared_preferences.dart';
Future<void> main() async {
await _clearPrefs();
print("Preferences cleared successfully.");
}
Future<void> _clearPrefs() async {
final prefs = SharedPreferencesAsync();
await prefs.remove('foo');
}
I'm running the script with dart run
Any help would be much appreciated, as I can't find anything like this online.
本文标签: Why does my flutter script for clearing preferences cause seemingly unrelated errorsStack Overflow
版权声明:本文标题:Why does my flutter script for clearing preferences cause seemingly unrelated errors? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736594726a1945131.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论