Files
Zakaria 1563409cb1
Build / Build for Android (push) Has been cancelled
Build / Build for iOS (push) Has been cancelled
first commit
2026-05-18 14:15:38 -04:00

17 lines
472 B
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart';
class LocaleHelper {
static const boxName = "Locale";
static ValueListenable<Box<Locale?>> get localeListener =>
Hive.box<Locale?>(boxName).listenable();
static Locale? get locale => Hive.box<Locale?>(boxName).get(boxName);
static void setLocale(Locale? locale) {
Hive.box<Locale?>(boxName).put(boxName, locale);
}
}