You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
import 'dart:ui';
import 'package:data/app_setting_data/repository/app_setting_box_repository_impl.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:local_db_core/lib/boxes/box_list/setting_box/app_setting_box.dart'; import 'package:path_provider/path_provider.dart'; import 'package:repositories/app_setting_box_domain/repository/app_setting_box_repository.dart';
class Initializer { Initializer.privateConstructor();
final AppSettingBoxRepository _repository = AppSettingBoxRepositoryImpl(appSettingBox: AppSettingBox()); static final Initializer instance = Initializer.privateConstructor();
factory Initializer() { return instance; }
Future<void> initialHive() async { final dir = await getApplicationDocumentsDirectory(); Hive.init(dir.path); await _repository.openBox(); }
TextDirection getTextDirection() { String? appDirection = _repository.getAppDirection(); if (appDirection == null || appDirection == 'rtl') return TextDirection.rtl; return TextDirection.ltr; }
String? getAppDirection() { return _repository.getAppDirection(); }
void setAppDirection(String value) { _repository.setAppDirection(value); } }
|