Closed infitech8813 closed 1 year ago
Where did you put this snippet in your files? Can you share the relevant file content here please.
import 'package:houzi_package/houzi_main.dart' as houzi_package; import 'Hooks.dart';
Future
Map<String,dynamic> hooksMap = { "headers" : IconHooks.getHeaderMap(), "propertyDetailPageIcons" : IconHooks.getPropertyDetailPageIconsMap(), "elegantHomeTermsIcons" : IconHooks.getElegantHomeTermsIconMap(), "drawerItems" : CustomDrawerHooks.getDrawerItems(), "widgetItems" : CustomWidgetHooks.getWidgetHook(), "fonts" : CustomFontsHooks.getFontHook(), "propertyItem" : CustomItemDesignHooks.getPropertyItemHook(), "termItem" : CustomItemDesignHooks.getTermItemHook(), "agentItem" : CustomItemDesignHooks.getAgentItemHook(), "agencyItem" : CustomItemDesignHooks.getAgencyItemHook(), "languageNameAndCode" : CustomLanguageHooks.getLanguageCodeAndName(),
};
return houzi_package.main(hooksMap,configurationsFilePath: "assets/configurations/configurations.json");
}
Hello @infitech8813 Go to PROJECT_HOME\houzi_package\lib\houzi_main.dart
And paste this code snippet here, For example:
Future<void> main(Map<String,dynamic> hooksMap, {@required String configurationsFilePath}) async {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp();
await HiveStorageManager.openHiveBox();
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
// Paste here
if (HiveStorageManager.readLanguageSelection() == null) {
HiveStorageManager.storeLanguageSelection(locale: Locale("ar"));
}
GenericMethods.setHooks(hooksMap);
}
Thanks problem solved
I used this method but the app freezes and won't open.
import 'dart:ui'; import 'package:houzi_package/files/hive_storage_files/hive_storage_manager.dart';
if (HiveStorageManager.readLanguageSelection() == null) { HiveStorageManager.storeLanguageSelection(locale: Locale("ar")); }