flutter shared preferences value null after restart code example
Example: delete shared preference flutter
import 'dart:async';
import 'package:shared_preferences/shared_preferences.dart';
...
SharedPreferences preferences = await SharedPreferences.getInstance();
await preferences.clear();