INNER CODE UNIT · Dart

DashbookPreferences

bluefireteam/dashbook · lib/src/preferences.dart:5

class DashbookPreferences {
  String? _bookmarkedChapter;

  static const _kBookmarkedChapter = 'bookmarked_chapter';

  Future<void> load() async {
    final preferences = await SharedPreferences.getInstance();

    _bookmarkedChapter = preferences.getString(_kBookmarkedChapter);
  }

  Future<void> _setString(String key, String? value) async {
    final preferences = await SharedPreferences.getInstance();
    if (value == null) {
      await preferences.remove(key);
    } else {
      await preferences.setString(key, value);
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…