sp_util icon indicating copy to clipboard operation
sp_util copied to clipboard

Unhandled Exception: Null check operator used on a null value

Open jeromekai opened this issue 4 years ago • 2 comments

sp 使用的是最新版本

运行时异常 void main() async { await SpUtil.getInstance(); runApp(DemoApp()); .......... }

异常出错位置代码 Future _init() async { _prefs = await SharedPreferences .getInstance();
}

await _lock. synchronized(() async { ................................ 有什么解决办法

jeromekai avatar Aug 12 '21 10:08 jeromekai

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await SpUtil.getInstance();
  runApp(const MyApp());
}

Sky24n avatar Aug 13 '21 07:08 Sky24n

image

wlingf avatar Nov 01 '23 06:11 wlingf