home screen developed
This commit is contained in:
parent
0ad4fa8dee
commit
5a58640510
|
|
@ -6,6 +6,10 @@ class CategoryApi {
|
||||||
|
|
||||||
static List<CategoryModel> get categories => [..._categories];
|
static List<CategoryModel> get categories => [..._categories];
|
||||||
|
|
||||||
|
static void clearCategories() {
|
||||||
|
_categories.clear();
|
||||||
|
}
|
||||||
|
|
||||||
static Future<List<CategoryModel>> getDescendantCategories(Map<String, dynamic> params) async {
|
static Future<List<CategoryModel>> getDescendantCategories(Map<String, dynamic> params) async {
|
||||||
if (_categories.length == 0) {
|
if (_categories.length == 0) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -173,4 +173,5 @@ class OrderApi {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ class _CarouselWidgetState extends State<CarouselWidget> {
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (slider.path.trim().length != 0) {
|
if (slider.path.trim().length != 0) {
|
||||||
debugPrint('slider path: ${slider.path}');
|
debugPrint('slider path: ${slider.path}');
|
||||||
|
debugPrint('slider id: ${slider.id}');
|
||||||
final params = slider.path.split('=');
|
final params = slider.path.split('=');
|
||||||
final args = {
|
final args = {
|
||||||
'type': params.first,
|
'type': params.first,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
|
import 'package:elektronika/app/pages/category/controller.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../../app.dart';
|
import '../../../../app.dart';
|
||||||
|
import '../../../home/controller.dart';
|
||||||
|
|
||||||
class LanguageController extends GetxController {
|
class LanguageController extends GetxController {
|
||||||
List<LanguageModel> languages = [...LocalizationService.langs];
|
List<LanguageModel> languages = [...LocalizationService.langs];
|
||||||
|
|
@ -16,10 +18,20 @@ class LanguageController extends GetxController {
|
||||||
groupValue.value = newValue.id;
|
groupValue.value = newValue.id;
|
||||||
LocalizationService().changeLocale(newValue.code);
|
LocalizationService().changeLocale(newValue.code);
|
||||||
setLocale(newValue.code);
|
setLocale(newValue.code);
|
||||||
|
|
||||||
|
resetLocaleSavedData();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getCurrentLocale() async {
|
Future<void> getCurrentLocale() async {
|
||||||
final locale = await getLocale();
|
final locale = await getLocale();
|
||||||
groupValue.value = locale == 'tm' ? 1 : 2;
|
groupValue.value = locale == 'tm' ? 1 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> resetLocaleSavedData() async {
|
||||||
|
await Get.delete<SettingsController>();
|
||||||
|
|
||||||
|
SliderApi.sliders.clear();
|
||||||
|
CategoryApi.categories.clear();
|
||||||
|
CategoryApi.clearCategories();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue