import 'package:shared_preferences/shared_preferences.dart';

class LocalPref extends Pref {
  @override
  Future<bool> saveString(String key, String value) async {
    final prefs = await SharedPreferences.getInstance();
    return prefs.setString(key, value);
  }

  @override
  Future<String> getString(String key) async {
    final prefs = await SharedPreferences.getInstance();
    return prefs.getString(key) ?? '';
  }
}

abstract class Pref {
  Future<bool> saveString(String key, String value);

  Future<String> getString(String key);
}

class DATA_CONST {
  static const String TOKEN_KEY = "TOKEN_KEY";
  static const String EXPIRED_TIME = "EXPIRED_TIME";
  static const String SHRIMP_LITER = "SHRIMP_LITER";
  static const String SHRIMP_POND_ID = "SHRIMP_POND_ID";
  static const String PUSH_KEY = "PUSH_KEY";
  static const String CURRENT_FULL_NAME = "CURRENT_FULL_NAME";
}
