From 7cf644f2fbda44d6224bda20e4677fb3aa30712a Mon Sep 17 00:00:00 2001 From: Moktadir Date: Sat, 16 Sep 2023 06:00:48 +0600 Subject: [PATCH 1/5] Tween Animation --- .../home-with-restAPI/views/home_view.dart | 89 ++++++++++++------- 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/lib/app/modules/example/home-with-restAPI/views/home_view.dart b/lib/app/modules/example/home-with-restAPI/views/home_view.dart index 77a9694..922392d 100755 --- a/lib/app/modules/example/home-with-restAPI/views/home_view.dart +++ b/lib/app/modules/example/home-with-restAPI/views/home_view.dart @@ -34,46 +34,71 @@ class HomeView extends GetView { : RefreshIndicator( color: theme.primaryColor, onRefresh: () async => await controller.getPostList(), - child: Padding( - padding: EdgeInsets.all(18.r), - child: RawScrollbar( - thumbColor: theme.primaryColor, - radius: Radius.circular(100.r), - thickness: 5, - interactive: true, - child: ListView.separated( - itemCount: controller.postList.length, - physics: const BouncingScrollPhysics(), - padding: EdgeInsets.zero, - separatorBuilder: (_, __) => SizedBox( - height: 20.h, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + TweenAnimationBuilder( + tween: Tween(begin: 0, end: 1), + duration: const Duration(milliseconds: 1000), + builder: + (BuildContext context, double value, Widget? child) { + return Opacity( + opacity: value, + child: Padding( + padding: EdgeInsets.only(top: value * 18.r), + child: child, + ), + ); + }, + child: Text( + "GetX Standard", + style: theme.textTheme.displaySmall, ), - itemBuilder: (ctx, index) => SplashContainer( - radius: 15, - onPressed: () { - controller.title.value = - controller.postList[index].title ?? ""; - controller.body.value = - controller.postList[index].body ?? ""; - Get.toNamed(Routes.POST_DETAIL); - }, + ), + Expanded( + child: RawScrollbar( + thumbColor: theme.primaryColor, + radius: Radius.circular(100.r), + thickness: 5, + interactive: true, child: Padding( - padding: EdgeInsets.all(8.r), - child: Center( - child: Text( - controller.postList[index].title ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: MyFonts.headline6TextSize, - fontWeight: FontWeight.w500, - color: theme.primaryColor, + padding: EdgeInsets.all(18.r), + child: ListView.separated( + itemCount: controller.postList.length, + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.zero, + separatorBuilder: (_, __) => SizedBox( + height: 20.h, + ), + itemBuilder: (ctx, index) => SplashContainer( + radius: 15, + onPressed: () { + controller.title.value = + controller.postList[index].title ?? ""; + controller.body.value = + controller.postList[index].body ?? ""; + Get.toNamed(Routes.POST_DETAIL); + }, + child: Padding( + padding: EdgeInsets.all(8.r), + child: Center( + child: Text( + controller.postList[index].title ?? "", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: MyFonts.headline6TextSize, + fontWeight: FontWeight.w500, + color: theme.primaryColor, + ), + ), + ), ), ), ), ), ), ), - ), + ], ), )), ); From 54bab0dc9382c3edbf3d41a4530d820c5634491a Mon Sep 17 00:00:00 2001 From: Moktadir Date: Mon, 18 Sep 2023 05:42:54 +0600 Subject: [PATCH 2/5] new recipe API --- lib/app/data/local/my_hive.dart | 30 +- .../controllers/home_controller.dart | 83 +- .../model/recipes_model.dart | 1092 +++++++++++++++++ .../model/recipes_model.g.dart | 1006 +++++++++++++++ .../home-with-restAPI/views/home_view.dart | 18 +- lib/app/service/REST/api_header.dart | 5 + lib/app/service/REST/api_urls.dart | 10 +- lib/app/service/REST/dio_client.dart | 2 +- lib/main.dart | 2 + 9 files changed, 2213 insertions(+), 35 deletions(-) create mode 100644 lib/app/modules/example/home-with-restAPI/model/recipes_model.dart create mode 100644 lib/app/modules/example/home-with-restAPI/model/recipes_model.g.dart diff --git a/lib/app/data/local/my_hive.dart b/lib/app/data/local/my_hive.dart index 76791c4..cb077ba 100644 --- a/lib/app/data/local/my_hive.dart +++ b/lib/app/data/local/my_hive.dart @@ -1,3 +1,4 @@ +import 'package:getx_standard/app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'package:hive_flutter/hive_flutter.dart'; import '../../modules/example/home-with-restAPI/model/posts.dart'; @@ -6,11 +7,15 @@ class MyHive { // Prevent making an instance of this class MyHive._(); - // Hive box to store movie data + // Hive box to store post data static late Box _postBox; + // Hive box to store recipe data + static late Box _recipeBox; + // Box name, it's like the table name static const String _postBoxName = 'posts'; + static const String _recipeBoxName = 'recipes'; /// Initialize local db (HIVE) /// Pass testPath only if you are testing hive @@ -23,6 +28,7 @@ class MyHive { } await registerAdapters?.call(Hive); await initPostsBox(); + await initRecipesBox(); } /// Initialize post box @@ -46,4 +52,26 @@ class MyHive { return posts .cast(); // Cast the list to the correct type (List) } + + /// Initialize recipe box + static Future initRecipesBox() async { + _recipeBox = await Hive.openBox(_recipeBoxName); + } + + /// Save all recipes to the database + static Future saveAllRecipes(List recipes) async { + try { + await _recipeBox.clear(); // Clear existing data + await _recipeBox.addAll(recipes); // Add all recipes to Hive + } catch (error) { + // Handle error + } + } + + /// Get all recipes from Hive + static List getAllRecipes() { + final recipes = _recipeBox.values.toList(); + return recipes + .cast(); // Cast the list to the correct type (List) + } } diff --git a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart index 52ef7b2..45b7c04 100755 --- a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart +++ b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart @@ -1,5 +1,7 @@ import 'package:get/get.dart'; +import 'package:getx_standard/app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'package:getx_standard/app/service/helper/network_connectivity.dart'; +import 'package:logger/logger.dart'; import '../../../../components/global-widgets/custom_snackbar.dart'; import '../../../../components/navbar/navbar_controller.dart'; @@ -7,7 +9,6 @@ import '../../../../data/local/my_hive.dart'; import '../../../../service/REST/api_urls.dart'; import '../../../../service/REST/dio_client.dart'; import '../../../../service/handler/exception_handler.dart'; -import '../model/posts.dart'; class HomeController extends GetxController with ExceptionHandler { final navController = Get.put(NavbarController()); @@ -15,35 +16,74 @@ class HomeController extends GetxController with ExceptionHandler { RxString title = "".obs; RxString body = "".obs; - /// GET POST LIST 'HIVE IMPLEMENTED' - final postList = RxList(); + final recipes = RxList(); - getPostList() async { + /// GET POST LIST 'HIVE IMPLEMENTED' + // final postList = RxList(); + // + // getPostList() async { + // showLoading(); + // if (await NetworkConnectivity.isNetworkAvailable()) { + // // Fetch posts from the API + // + // var response = + // await DioClient().get(url: ApiUrl.allPosts).catchError(handleError); + // + // if (response == null) return; + // + // postList + // .assignAll((response as List).map((e) => Posts.fromJson(e)).toList()); + // + // // Save fetched posts to Hive for future use + // await MyHive.saveAllPosts(postList); + // + // hideLoading(); + // } else { + // // If offline, try to load from Hive + // + // var posts = MyHive.getAllPosts(); + // + // if (posts.isNotEmpty) { + // // Use posts from Hive if available + // postList.assignAll(posts); + // + // hideLoading(); + // CustomSnackBar.showCustomErrorToast(message: "No network!"); + // return; + // } else { + // isError.value = true; + // + // hideLoading(); + // showErrorDialog("Oops!", "Connection problem"); + // return; + // } + // } + // } + + getRecipes() async { showLoading(); if (await NetworkConnectivity.isNetworkAvailable()) { - // Fetch posts from the API - - var response = - await DioClient().get(url: ApiUrl.allPosts).catchError(handleError); + /// Fetch recipes from the API + var response = await DioClient().get( + url: ApiUrl.allRecipes, + params: {"from": 0, "size": 20}).catchError(handleError); if (response == null) return; - postList - .assignAll((response as List).map((e) => Posts.fromJson(e)).toList()); - - // Save fetched posts to Hive for future use - await MyHive.saveAllPosts(postList); + recipes.assignAll((response["results"] as List) + .map((e) => Results.fromJson(e)) + .toList()); + /// Save fetched posts to Hive for future use + await MyHive.saveAllRecipes(recipes); hideLoading(); + Logger().d(response); } else { - // If offline, try to load from Hive - - var posts = MyHive.getAllPosts(); - - if (posts.isNotEmpty) { - // Use posts from Hive if available - postList.assignAll(posts); + /// If offline, try to load from Hive + var savedRecipes = MyHive.getAllRecipes(); + if (savedRecipes.isNotEmpty) { + recipes.assignAll(savedRecipes); hideLoading(); CustomSnackBar.showCustomErrorToast(message: "No network!"); return; @@ -59,7 +99,8 @@ class HomeController extends GetxController with ExceptionHandler { @override void onReady() async { - await getPostList(); + // await getPostList(); + await getRecipes(); super.onReady(); } diff --git a/lib/app/modules/example/home-with-restAPI/model/recipes_model.dart b/lib/app/modules/example/home-with-restAPI/model/recipes_model.dart new file mode 100644 index 0000000..0b8e703 --- /dev/null +++ b/lib/app/modules/example/home-with-restAPI/model/recipes_model.dart @@ -0,0 +1,1092 @@ +import 'package:hive/hive.dart'; +part 'recipes_model.g.dart'; + +@HiveType(typeId: 1) +class Recipes { + Recipes({ + this.count, + this.results, + }); + + Recipes.fromJson(dynamic json) { + count = json['count']; + if (json['results'] != null) { + results = []; + json['results'].forEach((v) { + results?.add(Results.fromJson(v)); + }); + } + } + @HiveField(0) + int? count; + @HiveField(1) + List? results; + + Map toJson() { + final map = {}; + map['count'] = count; + if (results != null) { + map['results'] = results?.map((v) => v.toJson()).toList(); + } + return map; + } +} + +@HiveType(typeId: 2) +class Results { + Results({ + this.seoPath, + this.brand, + this.name, + this.credits, + this.canonicalId, + this.videoId, + this.language, + this.prepTimeMinutes, + this.description, + this.videoAdContent, + this.instructions, + this.userRatings, + this.videoUrl, + this.topics, + this.seoTitle, + this.nutritionVisibility, + this.country, + this.price, + this.nutrition, + this.aspectRatio, + this.renditions, + this.keywords, + this.tags, + this.totalTimeMinutes, + this.updatedAt, + this.id, + this.slug, + this.servingsNounSingular, + this.showId, + this.compilations, + this.inspiredByUrl, + this.approvedAt, + this.isShoppable, + this.yields, + this.originalVideoUrl, + this.thumbnailAltText, + this.servingsNounPlural, + this.facebookPosts, + this.sections, + this.brandId, + this.tipsAndRatingsEnabled, + this.show, + this.createdAt, + this.totalTimeTier, + this.cookTimeMinutes, + this.promotion, + this.numServings, + this.buzzId, + this.draftStatus, + this.thumbnailUrl, + this.isOneTop, + this.beautyUrl, + }); + + Results.fromJson(dynamic json) { + seoPath = json['seo_path']; + brand = json['brand']; + name = json['name']; + if (json['credits'] != null) { + credits = []; + json['credits'].forEach((v) { + credits?.add(Credits.fromJson(v)); + }); + } + canonicalId = json['canonical_id']; + videoId = json['video_id']; + language = json['language']; + prepTimeMinutes = json['prep_time_minutes']; + description = json['description']; + videoAdContent = json['video_ad_content']; + if (json['instructions'] != null) { + instructions = []; + json['instructions'].forEach((v) { + instructions?.add(Instructions.fromJson(v)); + }); + } + userRatings = json['user_ratings'] != null + ? UserRatings.fromJson(json['user_ratings']) + : null; + videoUrl = json['video_url']; + if (json['topics'] != null) { + topics = []; + json['topics'].forEach((v) { + topics?.add(Topics.fromJson(v)); + }); + } + seoTitle = json['seo_title']; + nutritionVisibility = json['nutrition_visibility']; + country = json['country']; + price = json['price'] != null ? Price.fromJson(json['price']) : null; + nutrition = json['nutrition'] != null + ? Nutrition.fromJson(json['nutrition']) + : null; + aspectRatio = json['aspect_ratio']; + if (json['renditions'] != null) { + renditions = []; + json['renditions'].forEach((v) { + renditions?.add(Renditions.fromJson(v)); + }); + } + keywords = json['keywords']; + if (json['tags'] != null) { + tags = []; + json['tags'].forEach((v) { + tags?.add(Tags.fromJson(v)); + }); + } + totalTimeMinutes = json['total_time_minutes']; + updatedAt = json['updated_at']; + id = json['id']; + slug = json['slug']; + servingsNounSingular = json['servings_noun_singular']; + showId = json['show_id']; + if (json['compilations'] != null) { + compilations = []; + json['compilations'].forEach((v) { + compilations?.add(Compilations.fromJson(v)); + }); + } + inspiredByUrl = json['inspired_by_url']; + approvedAt = json['approved_at']; + isShoppable = json['is_shoppable']; + yields = json['yields']; + originalVideoUrl = json['original_video_url']; + thumbnailAltText = json['thumbnail_alt_text']; + servingsNounPlural = json['servings_noun_plural']; + + if (json['sections'] != null) { + sections = []; + json['sections'].forEach((v) { + sections?.add(Sections.fromJson(v)); + }); + } + brandId = json['brand_id']; + tipsAndRatingsEnabled = json['tips_and_ratings_enabled']; + show = json['show'] != null ? Show.fromJson(json['show']) : null; + createdAt = json['created_at']; + totalTimeTier = json['total_time_tier'] != null + ? TotalTimeTier.fromJson(json['total_time_tier']) + : null; + cookTimeMinutes = json['cook_time_minutes']; + promotion = json['promotion']; + numServings = json['num_servings']; + buzzId = json['buzz_id']; + draftStatus = json['draft_status']; + thumbnailUrl = json['thumbnail_url']; + isOneTop = json['is_one_top']; + beautyUrl = json['beauty_url']; + } + @HiveField(0) + String? seoPath; + @HiveField(1) + dynamic brand; + @HiveField(2) + String? name; + @HiveField(3) + List? credits; + @HiveField(4) + String? canonicalId; + @HiveField(5) + int? videoId; + @HiveField(6) + String? language; + @HiveField(7) + int? prepTimeMinutes; + @HiveField(8) + String? description; + @HiveField(9) + String? videoAdContent; + @HiveField(10) + List? instructions; + @HiveField(11) + UserRatings? userRatings; + @HiveField(12) + String? videoUrl; + @HiveField(13) + List? topics; + @HiveField(14) + String? seoTitle; + @HiveField(15) + String? nutritionVisibility; + @HiveField(16) + String? country; + @HiveField(17) + Price? price; + @HiveField(18) + Nutrition? nutrition; + @HiveField(19) + String? aspectRatio; + @HiveField(20) + List? renditions; + @HiveField(21) + String? keywords; + @HiveField(22) + List? tags; + @HiveField(23) + dynamic totalTimeMinutes; + @HiveField(24) + int? updatedAt; + @HiveField(25) + int? id; + @HiveField(26) + String? slug; + @HiveField(27) + String? servingsNounSingular; + @HiveField(28) + int? showId; + @HiveField(29) + List? compilations; + @HiveField(30) + dynamic inspiredByUrl; + @HiveField(31) + int? approvedAt; + @HiveField(32) + bool? isShoppable; + @HiveField(33) + String? yields; + @HiveField(34) + String? originalVideoUrl; + @HiveField(35) + String? thumbnailAltText; + @HiveField(36) + String? servingsNounPlural; + @HiveField(37) + List? facebookPosts; + @HiveField(38) + List? sections; + @HiveField(39) + dynamic brandId; + @HiveField(40) + bool? tipsAndRatingsEnabled; + @HiveField(41) + Show? show; + @HiveField(42) + int? createdAt; + @HiveField(43) + TotalTimeTier? totalTimeTier; + @HiveField(44) + int? cookTimeMinutes; + @HiveField(45) + String? promotion; + @HiveField(46) + int? numServings; + @HiveField(47) + dynamic buzzId; + @HiveField(48) + String? draftStatus; + @HiveField(49) + String? thumbnailUrl; + @HiveField(50) + bool? isOneTop; + @HiveField(51) + dynamic beautyUrl; + + Map toJson() { + final map = {}; + map['seo_path'] = seoPath; + map['brand'] = brand; + map['name'] = name; + if (credits != null) { + map['credits'] = credits?.map((v) => v.toJson()).toList(); + } + map['canonical_id'] = canonicalId; + map['video_id'] = videoId; + map['language'] = language; + map['prep_time_minutes'] = prepTimeMinutes; + map['description'] = description; + map['video_ad_content'] = videoAdContent; + if (instructions != null) { + map['instructions'] = instructions?.map((v) => v.toJson()).toList(); + } + if (userRatings != null) { + map['user_ratings'] = userRatings?.toJson(); + } + map['video_url'] = videoUrl; + if (topics != null) { + map['topics'] = topics?.map((v) => v.toJson()).toList(); + } + map['seo_title'] = seoTitle; + map['nutrition_visibility'] = nutritionVisibility; + map['country'] = country; + if (price != null) { + map['price'] = price?.toJson(); + } + if (nutrition != null) { + map['nutrition'] = nutrition?.toJson(); + } + map['aspect_ratio'] = aspectRatio; + if (renditions != null) { + map['renditions'] = renditions?.map((v) => v.toJson()).toList(); + } + map['keywords'] = keywords; + if (tags != null) { + map['tags'] = tags?.map((v) => v.toJson()).toList(); + } + map['total_time_minutes'] = totalTimeMinutes; + map['updated_at'] = updatedAt; + map['id'] = id; + map['slug'] = slug; + map['servings_noun_singular'] = servingsNounSingular; + map['show_id'] = showId; + if (compilations != null) { + map['compilations'] = compilations?.map((v) => v.toJson()).toList(); + } + map['inspired_by_url'] = inspiredByUrl; + map['approved_at'] = approvedAt; + map['is_shoppable'] = isShoppable; + map['yields'] = yields; + map['original_video_url'] = originalVideoUrl; + map['thumbnail_alt_text'] = thumbnailAltText; + map['servings_noun_plural'] = servingsNounPlural; + if (facebookPosts != null) { + map['facebook_posts'] = facebookPosts?.map((v) => v.toJson()).toList(); + } + if (sections != null) { + map['sections'] = sections?.map((v) => v.toJson()).toList(); + } + map['brand_id'] = brandId; + map['tips_and_ratings_enabled'] = tipsAndRatingsEnabled; + if (show != null) { + map['show'] = show?.toJson(); + } + map['created_at'] = createdAt; + if (totalTimeTier != null) { + map['total_time_tier'] = totalTimeTier?.toJson(); + } + map['cook_time_minutes'] = cookTimeMinutes; + map['promotion'] = promotion; + map['num_servings'] = numServings; + map['buzz_id'] = buzzId; + map['draft_status'] = draftStatus; + map['thumbnail_url'] = thumbnailUrl; + map['is_one_top'] = isOneTop; + map['beauty_url'] = beautyUrl; + return map; + } +} + +@HiveType(typeId: 3) +class TotalTimeTier { + TotalTimeTier({ + this.tier, + this.displayTier, + }); + + TotalTimeTier.fromJson(dynamic json) { + tier = json['tier']; + displayTier = json['display_tier']; + } + @HiveField(0) + String? tier; + @HiveField(1) + String? displayTier; + + Map toJson() { + final map = {}; + map['tier'] = tier; + map['display_tier'] = displayTier; + return map; + } +} + +@HiveType(typeId: 4) +class Show { + Show({ + this.id, + this.name, + }); + + Show.fromJson(dynamic json) { + id = json['id']; + name = json['name']; + } + @HiveField(0) + int? id; + @HiveField(1) + String? name; + + Map toJson() { + final map = {}; + map['id'] = id; + map['name'] = name; + return map; + } +} + +@HiveType(typeId: 5) +class Sections { + Sections({ + this.components, + this.name, + this.position, + }); + + Sections.fromJson(dynamic json) { + if (json['components'] != null) { + components = []; + json['components'].forEach((v) { + components?.add(Components.fromJson(v)); + }); + } + name = json['name']; + position = json['position']; + } + @HiveField(0) + List? components; + @HiveField(1) + dynamic name; + @HiveField(2) + int? position; + + Map toJson() { + final map = {}; + if (components != null) { + map['components'] = components?.map((v) => v.toJson()).toList(); + } + map['name'] = name; + map['position'] = position; + return map; + } +} + +@HiveType(typeId: 6) +class Components { + Components({ + this.ingredient, + this.id, + this.position, + this.measurements, + this.rawText, + this.extraComment, + }); + + Components.fromJson(dynamic json) { + ingredient = json['ingredient'] != null + ? Ingredient.fromJson(json['ingredient']) + : null; + id = json['id']; + position = json['position']; + if (json['measurements'] != null) { + measurements = []; + json['measurements'].forEach((v) { + measurements?.add(Measurements.fromJson(v)); + }); + } + rawText = json['raw_text']; + extraComment = json['extra_comment']; + } + @HiveField(0) + Ingredient? ingredient; + @HiveField(1) + int? id; + @HiveField(2) + int? position; + @HiveField(3) + List? measurements; + @HiveField(4) + String? rawText; + @HiveField(5) + String? extraComment; + + Map toJson() { + final map = {}; + if (ingredient != null) { + map['ingredient'] = ingredient?.toJson(); + } + map['id'] = id; + map['position'] = position; + if (measurements != null) { + map['measurements'] = measurements?.map((v) => v.toJson()).toList(); + } + map['raw_text'] = rawText; + map['extra_comment'] = extraComment; + return map; + } +} + +@HiveType(typeId: 7) +class Measurements { + Measurements({ + this.quantity, + this.id, + this.unit, + }); + + Measurements.fromJson(dynamic json) { + quantity = json['quantity']; + id = json['id']; + unit = json['unit'] != null ? Unit.fromJson(json['unit']) : null; + } + @HiveField(0) + String? quantity; + @HiveField(1) + int? id; + @HiveField(2) + Unit? unit; + + Map toJson() { + final map = {}; + map['quantity'] = quantity; + map['id'] = id; + if (unit != null) { + map['unit'] = unit?.toJson(); + } + return map; + } +} + +@HiveType(typeId: 8) +class Unit { + Unit({ + this.system, + this.name, + this.displayPlural, + this.displaySingular, + this.abbreviation, + }); + + Unit.fromJson(dynamic json) { + system = json['system']; + name = json['name']; + displayPlural = json['display_plural']; + displaySingular = json['display_singular']; + abbreviation = json['abbreviation']; + } + @HiveField(0) + String? system; + @HiveField(1) + String? name; + @HiveField(2) + String? displayPlural; + @HiveField(3) + String? displaySingular; + @HiveField(4) + String? abbreviation; + + Map toJson() { + final map = {}; + map['system'] = system; + map['name'] = name; + map['display_plural'] = displayPlural; + map['display_singular'] = displaySingular; + map['abbreviation'] = abbreviation; + return map; + } +} + +@HiveType(typeId: 9) +class Ingredient { + Ingredient({ + this.updatedAt, + this.name, + this.createdAt, + this.displayPlural, + this.id, + this.displaySingular, + }); + + Ingredient.fromJson(dynamic json) { + updatedAt = json['updated_at']; + name = json['name']; + createdAt = json['created_at']; + displayPlural = json['display_plural']; + id = json['id']; + displaySingular = json['display_singular']; + } + @HiveField(0) + int? updatedAt; + @HiveField(1) + String? name; + @HiveField(2) + int? createdAt; + @HiveField(3) + String? displayPlural; + @HiveField(4) + int? id; + @HiveField(5) + String? displaySingular; + + Map toJson() { + final map = {}; + map['updated_at'] = updatedAt; + map['name'] = name; + map['created_at'] = createdAt; + map['display_plural'] = displayPlural; + map['id'] = id; + map['display_singular'] = displaySingular; + return map; + } +} + +@HiveType(typeId: 10) +class Compilations { + Compilations({ + this.approvedAt, + this.slug, + this.language, + this.thumbnailUrl, + this.videoUrl, + this.name, + this.canonicalId, + this.videoId, + this.keywords, + this.thumbnailAltText, + this.draftStatus, + this.beautyUrl, + this.buzzId, + this.isShoppable, + this.description, + this.facebookPosts, + this.show, + this.createdAt, + this.id, + this.promotion, + this.aspectRatio, + this.country, + }); + + Compilations.fromJson(dynamic json) { + approvedAt = json['approved_at']; + slug = json['slug']; + language = json['language']; + thumbnailUrl = json['thumbnail_url']; + videoUrl = json['video_url']; + name = json['name']; + canonicalId = json['canonical_id']; + videoId = json['video_id']; + keywords = json['keywords']; + thumbnailAltText = json['thumbnail_alt_text']; + draftStatus = json['draft_status']; + beautyUrl = json['beauty_url']; + buzzId = json['buzz_id']; + isShoppable = json['is_shoppable']; + description = json['description']; + + if (json['show'] != null) { + show = []; + json['show'].forEach((v) { + show?.add(Show.fromJson(v)); + }); + } + createdAt = json['created_at']; + id = json['id']; + promotion = json['promotion']; + aspectRatio = json['aspect_ratio']; + country = json['country']; + } + @HiveField(0) + int? approvedAt; + @HiveField(1) + String? slug; + @HiveField(2) + String? language; + @HiveField(3) + String? thumbnailUrl; + @HiveField(4) + String? videoUrl; + @HiveField(5) + String? name; + @HiveField(6) + String? canonicalId; + @HiveField(7) + int? videoId; + @HiveField(8) + dynamic keywords; + @HiveField(9) + String? thumbnailAltText; + @HiveField(10) + String? draftStatus; + @HiveField(11) + dynamic beautyUrl; + @HiveField(12) + dynamic buzzId; + @HiveField(13) + bool? isShoppable; + @HiveField(14) + String? description; + @HiveField(15) + List? facebookPosts; + @HiveField(16) + List? show; + @HiveField(17) + int? createdAt; + @HiveField(18) + int? id; + @HiveField(19) + String? promotion; + @HiveField(20) + String? aspectRatio; + @HiveField(21) + String? country; + + Map toJson() { + final map = {}; + map['approved_at'] = approvedAt; + map['slug'] = slug; + map['language'] = language; + map['thumbnail_url'] = thumbnailUrl; + map['video_url'] = videoUrl; + map['name'] = name; + map['canonical_id'] = canonicalId; + map['video_id'] = videoId; + map['keywords'] = keywords; + map['thumbnail_alt_text'] = thumbnailAltText; + map['draft_status'] = draftStatus; + map['beauty_url'] = beautyUrl; + map['buzz_id'] = buzzId; + map['is_shoppable'] = isShoppable; + map['description'] = description; + if (facebookPosts != null) { + map['facebook_posts'] = facebookPosts?.map((v) => v.toJson()).toList(); + } + if (show != null) { + map['show'] = show?.map((v) => v.toJson()).toList(); + } + map['created_at'] = createdAt; + map['id'] = id; + map['promotion'] = promotion; + map['aspect_ratio'] = aspectRatio; + map['country'] = country; + return map; + } +} + +@HiveType(typeId: 11) +class Tags { + Tags({ + this.type, + this.rootTagType, + this.name, + this.id, + this.displayName, + }); + + Tags.fromJson(dynamic json) { + type = json['type']; + rootTagType = json['root_tag_type']; + name = json['name']; + id = json['id']; + displayName = json['display_name']; + } + @HiveField(0) + String? type; + @HiveField(1) + String? rootTagType; + @HiveField(2) + String? name; + @HiveField(3) + int? id; + @HiveField(4) + String? displayName; + + Map toJson() { + final map = {}; + map['type'] = type; + map['root_tag_type'] = rootTagType; + map['name'] = name; + map['id'] = id; + map['display_name'] = displayName; + return map; + } +} + +@HiveType(typeId: 12) +class Renditions { + Renditions({ + this.maximumBitRate, + this.height, + this.container, + this.posterUrl, + this.contentType, + this.aspect, + this.width, + this.name, + this.fileSize, + this.url, + this.duration, + this.bitRate, + this.minimumBitRate, + }); + + Renditions.fromJson(dynamic json) { + maximumBitRate = json['maximum_bit_rate']; + height = json['height']; + container = json['container']; + posterUrl = json['poster_url']; + contentType = json['content_type']; + aspect = json['aspect']; + width = json['width']; + name = json['name']; + fileSize = json['file_size']; + url = json['url']; + duration = json['duration']; + bitRate = json['bit_rate']; + minimumBitRate = json['minimum_bit_rate']; + } + @HiveField(0) + dynamic maximumBitRate; + @HiveField(1) + int? height; + @HiveField(2) + String? container; + @HiveField(3) + String? posterUrl; + @HiveField(4) + String? contentType; + @HiveField(5) + String? aspect; + @HiveField(6) + int? width; + @HiveField(7) + String? name; + @HiveField(8) + int? fileSize; + @HiveField(9) + String? url; + @HiveField(10) + int? duration; + @HiveField(11) + int? bitRate; + @HiveField(12) + dynamic minimumBitRate; + + Map toJson() { + final map = {}; + map['maximum_bit_rate'] = maximumBitRate; + map['height'] = height; + map['container'] = container; + map['poster_url'] = posterUrl; + map['content_type'] = contentType; + map['aspect'] = aspect; + map['width'] = width; + map['name'] = name; + map['file_size'] = fileSize; + map['url'] = url; + map['duration'] = duration; + map['bit_rate'] = bitRate; + map['minimum_bit_rate'] = minimumBitRate; + return map; + } +} + +@HiveType(typeId: 13) +class Nutrition { + Nutrition({ + this.fat, + this.calories, + this.sugar, + this.carbohydrates, + this.fiber, + this.updatedAt, + this.protein, + }); + + Nutrition.fromJson(dynamic json) { + fat = json['fat']; + calories = json['calories']; + sugar = json['sugar']; + carbohydrates = json['carbohydrates']; + fiber = json['fiber']; + updatedAt = json['updated_at']; + protein = json['protein']; + } + @HiveField(0) + int? fat; + @HiveField(1) + int? calories; + @HiveField(2) + int? sugar; + @HiveField(3) + int? carbohydrates; + @HiveField(4) + int? fiber; + @HiveField(5) + String? updatedAt; + @HiveField(6) + int? protein; + + Map toJson() { + final map = {}; + map['fat'] = fat; + map['calories'] = calories; + map['sugar'] = sugar; + map['carbohydrates'] = carbohydrates; + map['fiber'] = fiber; + map['updated_at'] = updatedAt; + map['protein'] = protein; + return map; + } +} + +@HiveType(typeId: 14) +class Price { + Price({ + this.total, + this.updatedAt, + this.portion, + this.consumptionTotal, + this.consumptionPortion, + }); + + Price.fromJson(dynamic json) { + total = json['total']; + updatedAt = json['updated_at']; + portion = json['portion']; + consumptionTotal = json['consumption_total']; + consumptionPortion = json['consumption_portion']; + } + @HiveField(0) + int? total; + @HiveField(1) + String? updatedAt; + @HiveField(2) + int? portion; + @HiveField(3) + int? consumptionTotal; + @HiveField(4) + int? consumptionPortion; + + Map toJson() { + final map = {}; + map['total'] = total; + map['updated_at'] = updatedAt; + map['portion'] = portion; + map['consumption_total'] = consumptionTotal; + map['consumption_portion'] = consumptionPortion; + return map; + } +} + +@HiveType(typeId: 15) +class Topics { + Topics({ + this.name, + this.slug, + }); + + Topics.fromJson(dynamic json) { + name = json['name']; + slug = json['slug']; + } + @HiveField(0) + String? name; + @HiveField(1) + String? slug; + + Map toJson() { + final map = {}; + map['name'] = name; + map['slug'] = slug; + return map; + } +} + +@HiveType(typeId: 16) +class UserRatings { + UserRatings({ + this.countPositive, + this.score, + this.countNegative, + }); + + UserRatings.fromJson(dynamic json) { + countPositive = json['count_positive']; + score = json['score']; + countNegative = json['count_negative']; + } + @HiveField(0) + int? countPositive; + @HiveField(1) + double? score; + @HiveField(2) + int? countNegative; + + Map toJson() { + final map = {}; + map['count_positive'] = countPositive; + map['score'] = score; + map['count_negative'] = countNegative; + return map; + } +} + +@HiveType(typeId: 17) +class Instructions { + Instructions({ + this.startTime, + this.appliance, + this.endTime, + this.temperature, + this.id, + this.position, + this.displayText, + }); + + Instructions.fromJson(dynamic json) { + startTime = json['start_time']; + appliance = json['appliance']; + endTime = json['end_time']; + temperature = json['temperature']; + id = json['id']; + position = json['position']; + displayText = json['display_text']; + } + @HiveField(0) + int? startTime; + @HiveField(1) + dynamic appliance; + @HiveField(2) + int? endTime; + @HiveField(3) + dynamic temperature; + @HiveField(4) + int? id; + @HiveField(5) + int? position; + @HiveField(6) + String? displayText; + + Map toJson() { + final map = {}; + map['start_time'] = startTime; + map['appliance'] = appliance; + map['end_time'] = endTime; + map['temperature'] = temperature; + map['id'] = id; + map['position'] = position; + map['display_text'] = displayText; + return map; + } +} + +@HiveType(typeId: 18) +class Credits { + Credits({ + this.name, + this.type, + }); + + Credits.fromJson(dynamic json) { + name = json['name']; + type = json['type']; + } + @HiveField(0) + String? name; + @HiveField(1) + String? type; + + Map toJson() { + final map = {}; + map['name'] = name; + map['type'] = type; + return map; + } +} diff --git a/lib/app/modules/example/home-with-restAPI/model/recipes_model.g.dart b/lib/app/modules/example/home-with-restAPI/model/recipes_model.g.dart new file mode 100644 index 0000000..b2c4c59 --- /dev/null +++ b/lib/app/modules/example/home-with-restAPI/model/recipes_model.g.dart @@ -0,0 +1,1006 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recipes_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class RecipesAdapter extends TypeAdapter { + @override + final int typeId = 1; + + @override + Recipes read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Recipes( + count: fields[0] as int?, + results: (fields[1] as List?)?.cast(), + ); + } + + @override + void write(BinaryWriter writer, Recipes obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.count) + ..writeByte(1) + ..write(obj.results); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RecipesAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class ResultsAdapter extends TypeAdapter { + @override + final int typeId = 2; + + @override + Results read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Results( + seoPath: fields[0] as String?, + brand: fields[1] as dynamic, + name: fields[2] as String?, + credits: (fields[3] as List?)?.cast(), + canonicalId: fields[4] as String?, + videoId: fields[5] as int?, + language: fields[6] as String?, + prepTimeMinutes: fields[7] as int?, + description: fields[8] as String?, + videoAdContent: fields[9] as String?, + instructions: (fields[10] as List?)?.cast(), + userRatings: fields[11] as UserRatings?, + videoUrl: fields[12] as String?, + topics: (fields[13] as List?)?.cast(), + seoTitle: fields[14] as String?, + nutritionVisibility: fields[15] as String?, + country: fields[16] as String?, + price: fields[17] as Price?, + nutrition: fields[18] as Nutrition?, + aspectRatio: fields[19] as String?, + renditions: (fields[20] as List?)?.cast(), + keywords: fields[21] as String?, + tags: (fields[22] as List?)?.cast(), + totalTimeMinutes: fields[23] as dynamic, + updatedAt: fields[24] as int?, + id: fields[25] as int?, + slug: fields[26] as String?, + servingsNounSingular: fields[27] as String?, + showId: fields[28] as int?, + compilations: (fields[29] as List?)?.cast(), + inspiredByUrl: fields[30] as dynamic, + approvedAt: fields[31] as int?, + isShoppable: fields[32] as bool?, + yields: fields[33] as String?, + originalVideoUrl: fields[34] as String?, + thumbnailAltText: fields[35] as String?, + servingsNounPlural: fields[36] as String?, + facebookPosts: (fields[37] as List?)?.cast(), + sections: (fields[38] as List?)?.cast(), + brandId: fields[39] as dynamic, + tipsAndRatingsEnabled: fields[40] as bool?, + show: fields[41] as Show?, + createdAt: fields[42] as int?, + totalTimeTier: fields[43] as TotalTimeTier?, + cookTimeMinutes: fields[44] as int?, + promotion: fields[45] as String?, + numServings: fields[46] as int?, + buzzId: fields[47] as dynamic, + draftStatus: fields[48] as String?, + thumbnailUrl: fields[49] as String?, + isOneTop: fields[50] as bool?, + beautyUrl: fields[51] as dynamic, + ); + } + + @override + void write(BinaryWriter writer, Results obj) { + writer + ..writeByte(52) + ..writeByte(0) + ..write(obj.seoPath) + ..writeByte(1) + ..write(obj.brand) + ..writeByte(2) + ..write(obj.name) + ..writeByte(3) + ..write(obj.credits) + ..writeByte(4) + ..write(obj.canonicalId) + ..writeByte(5) + ..write(obj.videoId) + ..writeByte(6) + ..write(obj.language) + ..writeByte(7) + ..write(obj.prepTimeMinutes) + ..writeByte(8) + ..write(obj.description) + ..writeByte(9) + ..write(obj.videoAdContent) + ..writeByte(10) + ..write(obj.instructions) + ..writeByte(11) + ..write(obj.userRatings) + ..writeByte(12) + ..write(obj.videoUrl) + ..writeByte(13) + ..write(obj.topics) + ..writeByte(14) + ..write(obj.seoTitle) + ..writeByte(15) + ..write(obj.nutritionVisibility) + ..writeByte(16) + ..write(obj.country) + ..writeByte(17) + ..write(obj.price) + ..writeByte(18) + ..write(obj.nutrition) + ..writeByte(19) + ..write(obj.aspectRatio) + ..writeByte(20) + ..write(obj.renditions) + ..writeByte(21) + ..write(obj.keywords) + ..writeByte(22) + ..write(obj.tags) + ..writeByte(23) + ..write(obj.totalTimeMinutes) + ..writeByte(24) + ..write(obj.updatedAt) + ..writeByte(25) + ..write(obj.id) + ..writeByte(26) + ..write(obj.slug) + ..writeByte(27) + ..write(obj.servingsNounSingular) + ..writeByte(28) + ..write(obj.showId) + ..writeByte(29) + ..write(obj.compilations) + ..writeByte(30) + ..write(obj.inspiredByUrl) + ..writeByte(31) + ..write(obj.approvedAt) + ..writeByte(32) + ..write(obj.isShoppable) + ..writeByte(33) + ..write(obj.yields) + ..writeByte(34) + ..write(obj.originalVideoUrl) + ..writeByte(35) + ..write(obj.thumbnailAltText) + ..writeByte(36) + ..write(obj.servingsNounPlural) + ..writeByte(37) + ..write(obj.facebookPosts) + ..writeByte(38) + ..write(obj.sections) + ..writeByte(39) + ..write(obj.brandId) + ..writeByte(40) + ..write(obj.tipsAndRatingsEnabled) + ..writeByte(41) + ..write(obj.show) + ..writeByte(42) + ..write(obj.createdAt) + ..writeByte(43) + ..write(obj.totalTimeTier) + ..writeByte(44) + ..write(obj.cookTimeMinutes) + ..writeByte(45) + ..write(obj.promotion) + ..writeByte(46) + ..write(obj.numServings) + ..writeByte(47) + ..write(obj.buzzId) + ..writeByte(48) + ..write(obj.draftStatus) + ..writeByte(49) + ..write(obj.thumbnailUrl) + ..writeByte(50) + ..write(obj.isOneTop) + ..writeByte(51) + ..write(obj.beautyUrl); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ResultsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class TotalTimeTierAdapter extends TypeAdapter { + @override + final int typeId = 3; + + @override + TotalTimeTier read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return TotalTimeTier( + tier: fields[0] as String?, + displayTier: fields[1] as String?, + ); + } + + @override + void write(BinaryWriter writer, TotalTimeTier obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.tier) + ..writeByte(1) + ..write(obj.displayTier); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TotalTimeTierAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class ShowAdapter extends TypeAdapter { + @override + final int typeId = 4; + + @override + Show read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Show( + id: fields[0] as int?, + name: fields[1] as String?, + ); + } + + @override + void write(BinaryWriter writer, Show obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.name); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ShowAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class SectionsAdapter extends TypeAdapter { + @override + final int typeId = 5; + + @override + Sections read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Sections( + components: (fields[0] as List?)?.cast(), + name: fields[1] as dynamic, + position: fields[2] as int?, + ); + } + + @override + void write(BinaryWriter writer, Sections obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.components) + ..writeByte(1) + ..write(obj.name) + ..writeByte(2) + ..write(obj.position); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SectionsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class ComponentsAdapter extends TypeAdapter { + @override + final int typeId = 6; + + @override + Components read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Components( + ingredient: fields[0] as Ingredient?, + id: fields[1] as int?, + position: fields[2] as int?, + measurements: (fields[3] as List?)?.cast(), + rawText: fields[4] as String?, + extraComment: fields[5] as String?, + ); + } + + @override + void write(BinaryWriter writer, Components obj) { + writer + ..writeByte(6) + ..writeByte(0) + ..write(obj.ingredient) + ..writeByte(1) + ..write(obj.id) + ..writeByte(2) + ..write(obj.position) + ..writeByte(3) + ..write(obj.measurements) + ..writeByte(4) + ..write(obj.rawText) + ..writeByte(5) + ..write(obj.extraComment); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComponentsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class MeasurementsAdapter extends TypeAdapter { + @override + final int typeId = 7; + + @override + Measurements read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Measurements( + quantity: fields[0] as String?, + id: fields[1] as int?, + unit: fields[2] as Unit?, + ); + } + + @override + void write(BinaryWriter writer, Measurements obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.quantity) + ..writeByte(1) + ..write(obj.id) + ..writeByte(2) + ..write(obj.unit); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MeasurementsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class UnitAdapter extends TypeAdapter { + @override + final int typeId = 8; + + @override + Unit read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Unit( + system: fields[0] as String?, + name: fields[1] as String?, + displayPlural: fields[2] as String?, + displaySingular: fields[3] as String?, + abbreviation: fields[4] as String?, + ); + } + + @override + void write(BinaryWriter writer, Unit obj) { + writer + ..writeByte(5) + ..writeByte(0) + ..write(obj.system) + ..writeByte(1) + ..write(obj.name) + ..writeByte(2) + ..write(obj.displayPlural) + ..writeByte(3) + ..write(obj.displaySingular) + ..writeByte(4) + ..write(obj.abbreviation); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UnitAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class IngredientAdapter extends TypeAdapter { + @override + final int typeId = 9; + + @override + Ingredient read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Ingredient( + updatedAt: fields[0] as int?, + name: fields[1] as String?, + createdAt: fields[2] as int?, + displayPlural: fields[3] as String?, + id: fields[4] as int?, + displaySingular: fields[5] as String?, + ); + } + + @override + void write(BinaryWriter writer, Ingredient obj) { + writer + ..writeByte(6) + ..writeByte(0) + ..write(obj.updatedAt) + ..writeByte(1) + ..write(obj.name) + ..writeByte(2) + ..write(obj.createdAt) + ..writeByte(3) + ..write(obj.displayPlural) + ..writeByte(4) + ..write(obj.id) + ..writeByte(5) + ..write(obj.displaySingular); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IngredientAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class CompilationsAdapter extends TypeAdapter { + @override + final int typeId = 10; + + @override + Compilations read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Compilations( + approvedAt: fields[0] as int?, + slug: fields[1] as String?, + language: fields[2] as String?, + thumbnailUrl: fields[3] as String?, + videoUrl: fields[4] as String?, + name: fields[5] as String?, + canonicalId: fields[6] as String?, + videoId: fields[7] as int?, + keywords: fields[8] as dynamic, + thumbnailAltText: fields[9] as String?, + draftStatus: fields[10] as String?, + beautyUrl: fields[11] as dynamic, + buzzId: fields[12] as dynamic, + isShoppable: fields[13] as bool?, + description: fields[14] as String?, + facebookPosts: (fields[15] as List?)?.cast(), + show: (fields[16] as List?)?.cast(), + createdAt: fields[17] as int?, + id: fields[18] as int?, + promotion: fields[19] as String?, + aspectRatio: fields[20] as String?, + country: fields[21] as String?, + ); + } + + @override + void write(BinaryWriter writer, Compilations obj) { + writer + ..writeByte(22) + ..writeByte(0) + ..write(obj.approvedAt) + ..writeByte(1) + ..write(obj.slug) + ..writeByte(2) + ..write(obj.language) + ..writeByte(3) + ..write(obj.thumbnailUrl) + ..writeByte(4) + ..write(obj.videoUrl) + ..writeByte(5) + ..write(obj.name) + ..writeByte(6) + ..write(obj.canonicalId) + ..writeByte(7) + ..write(obj.videoId) + ..writeByte(8) + ..write(obj.keywords) + ..writeByte(9) + ..write(obj.thumbnailAltText) + ..writeByte(10) + ..write(obj.draftStatus) + ..writeByte(11) + ..write(obj.beautyUrl) + ..writeByte(12) + ..write(obj.buzzId) + ..writeByte(13) + ..write(obj.isShoppable) + ..writeByte(14) + ..write(obj.description) + ..writeByte(15) + ..write(obj.facebookPosts) + ..writeByte(16) + ..write(obj.show) + ..writeByte(17) + ..write(obj.createdAt) + ..writeByte(18) + ..write(obj.id) + ..writeByte(19) + ..write(obj.promotion) + ..writeByte(20) + ..write(obj.aspectRatio) + ..writeByte(21) + ..write(obj.country); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CompilationsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class TagsAdapter extends TypeAdapter { + @override + final int typeId = 11; + + @override + Tags read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Tags( + type: fields[0] as String?, + rootTagType: fields[1] as String?, + name: fields[2] as String?, + id: fields[3] as int?, + displayName: fields[4] as String?, + ); + } + + @override + void write(BinaryWriter writer, Tags obj) { + writer + ..writeByte(5) + ..writeByte(0) + ..write(obj.type) + ..writeByte(1) + ..write(obj.rootTagType) + ..writeByte(2) + ..write(obj.name) + ..writeByte(3) + ..write(obj.id) + ..writeByte(4) + ..write(obj.displayName); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TagsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class RenditionsAdapter extends TypeAdapter { + @override + final int typeId = 12; + + @override + Renditions read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Renditions( + maximumBitRate: fields[0] as dynamic, + height: fields[1] as int?, + container: fields[2] as String?, + posterUrl: fields[3] as String?, + contentType: fields[4] as String?, + aspect: fields[5] as String?, + width: fields[6] as int?, + name: fields[7] as String?, + fileSize: fields[8] as int?, + url: fields[9] as String?, + duration: fields[10] as int?, + bitRate: fields[11] as int?, + minimumBitRate: fields[12] as dynamic, + ); + } + + @override + void write(BinaryWriter writer, Renditions obj) { + writer + ..writeByte(13) + ..writeByte(0) + ..write(obj.maximumBitRate) + ..writeByte(1) + ..write(obj.height) + ..writeByte(2) + ..write(obj.container) + ..writeByte(3) + ..write(obj.posterUrl) + ..writeByte(4) + ..write(obj.contentType) + ..writeByte(5) + ..write(obj.aspect) + ..writeByte(6) + ..write(obj.width) + ..writeByte(7) + ..write(obj.name) + ..writeByte(8) + ..write(obj.fileSize) + ..writeByte(9) + ..write(obj.url) + ..writeByte(10) + ..write(obj.duration) + ..writeByte(11) + ..write(obj.bitRate) + ..writeByte(12) + ..write(obj.minimumBitRate); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RenditionsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class NutritionAdapter extends TypeAdapter { + @override + final int typeId = 13; + + @override + Nutrition read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Nutrition( + fat: fields[0] as int?, + calories: fields[1] as int?, + sugar: fields[2] as int?, + carbohydrates: fields[3] as int?, + fiber: fields[4] as int?, + updatedAt: fields[5] as String?, + protein: fields[6] as int?, + ); + } + + @override + void write(BinaryWriter writer, Nutrition obj) { + writer + ..writeByte(7) + ..writeByte(0) + ..write(obj.fat) + ..writeByte(1) + ..write(obj.calories) + ..writeByte(2) + ..write(obj.sugar) + ..writeByte(3) + ..write(obj.carbohydrates) + ..writeByte(4) + ..write(obj.fiber) + ..writeByte(5) + ..write(obj.updatedAt) + ..writeByte(6) + ..write(obj.protein); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NutritionAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class PriceAdapter extends TypeAdapter { + @override + final int typeId = 14; + + @override + Price read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Price( + total: fields[0] as int?, + updatedAt: fields[1] as String?, + portion: fields[2] as int?, + consumptionTotal: fields[3] as int?, + consumptionPortion: fields[4] as int?, + ); + } + + @override + void write(BinaryWriter writer, Price obj) { + writer + ..writeByte(5) + ..writeByte(0) + ..write(obj.total) + ..writeByte(1) + ..write(obj.updatedAt) + ..writeByte(2) + ..write(obj.portion) + ..writeByte(3) + ..write(obj.consumptionTotal) + ..writeByte(4) + ..write(obj.consumptionPortion); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PriceAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class TopicsAdapter extends TypeAdapter { + @override + final int typeId = 15; + + @override + Topics read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Topics( + name: fields[0] as String?, + slug: fields[1] as String?, + ); + } + + @override + void write(BinaryWriter writer, Topics obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.name) + ..writeByte(1) + ..write(obj.slug); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopicsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class UserRatingsAdapter extends TypeAdapter { + @override + final int typeId = 16; + + @override + UserRatings read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return UserRatings( + countPositive: fields[0] as int?, + score: fields[1] as double?, + countNegative: fields[2] as int?, + ); + } + + @override + void write(BinaryWriter writer, UserRatings obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.countPositive) + ..writeByte(1) + ..write(obj.score) + ..writeByte(2) + ..write(obj.countNegative); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UserRatingsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class InstructionsAdapter extends TypeAdapter { + @override + final int typeId = 17; + + @override + Instructions read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Instructions( + startTime: fields[0] as int?, + appliance: fields[1] as dynamic, + endTime: fields[2] as int?, + temperature: fields[3] as dynamic, + id: fields[4] as int?, + position: fields[5] as int?, + displayText: fields[6] as String?, + ); + } + + @override + void write(BinaryWriter writer, Instructions obj) { + writer + ..writeByte(7) + ..writeByte(0) + ..write(obj.startTime) + ..writeByte(1) + ..write(obj.appliance) + ..writeByte(2) + ..write(obj.endTime) + ..writeByte(3) + ..write(obj.temperature) + ..writeByte(4) + ..write(obj.id) + ..writeByte(5) + ..write(obj.position) + ..writeByte(6) + ..write(obj.displayText); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is InstructionsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class CreditsAdapter extends TypeAdapter { + @override + final int typeId = 18; + + @override + Credits read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Credits( + name: fields[0] as String?, + type: fields[1] as String?, + ); + } + + @override + void write(BinaryWriter writer, Credits obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.name) + ..writeByte(1) + ..write(obj.type); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CreditsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/app/modules/example/home-with-restAPI/views/home_view.dart b/lib/app/modules/example/home-with-restAPI/views/home_view.dart index 922392d..1e51282 100755 --- a/lib/app/modules/example/home-with-restAPI/views/home_view.dart +++ b/lib/app/modules/example/home-with-restAPI/views/home_view.dart @@ -30,10 +30,10 @@ class HomeView extends GetView { centerTitle: true, ), body: Obx(() => controller.isError.value == true - ? EmptyWidget(onPressed: () async => await controller.getPostList()) + ? EmptyWidget(onPressed: () async => await controller.getRecipes()) : RefreshIndicator( color: theme.primaryColor, - onRefresh: () async => await controller.getPostList(), + onRefresh: () async => await controller.getRecipes(), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -64,7 +64,7 @@ class HomeView extends GetView { child: Padding( padding: EdgeInsets.all(18.r), child: ListView.separated( - itemCount: controller.postList.length, + itemCount: controller.recipes.length, physics: const BouncingScrollPhysics(), padding: EdgeInsets.zero, separatorBuilder: (_, __) => SizedBox( @@ -73,17 +73,17 @@ class HomeView extends GetView { itemBuilder: (ctx, index) => SplashContainer( radius: 15, onPressed: () { - controller.title.value = - controller.postList[index].title ?? ""; - controller.body.value = - controller.postList[index].body ?? ""; - Get.toNamed(Routes.POST_DETAIL); + // controller.title.value = + // controller.postList[index].title ?? ""; + // controller.body.value = + // controller.postList[index].body ?? ""; + // Get.toNamed(Routes.POST_DETAIL); }, child: Padding( padding: EdgeInsets.all(8.r), child: Center( child: Text( - controller.postList[index].title ?? "", + controller.recipes[index].name ?? "", textAlign: TextAlign.center, style: TextStyle( fontSize: MyFonts.headline6TextSize, diff --git a/lib/app/service/REST/api_header.dart b/lib/app/service/REST/api_header.dart index 8baedc7..399e25f 100755 --- a/lib/app/service/REST/api_header.dart +++ b/lib/app/service/REST/api_header.dart @@ -1,4 +1,9 @@ class Header { + // RAPID API HEADER + static Map rapidApiHeader = { + "X-RapidAPI-Key": "05741bc39bmsh35c797d07e59651p13baa5jsn936cd89ffe07", + "X-RapidAPI-Host": "tasty.p.rapidapi.com", + }; // SECURE HEADER static Map secureHeader = { "Authorization": "Bearer 'token'", diff --git a/lib/app/service/REST/api_urls.dart b/lib/app/service/REST/api_urls.dart index 0da99a6..19b4dbf 100755 --- a/lib/app/service/REST/api_urls.dart +++ b/lib/app/service/REST/api_urls.dart @@ -1,6 +1,10 @@ class ApiUrl { /// Base URL - static const baseUrl = "https://jsonplaceholder.typicode.com"; - static const allPosts = "$baseUrl/posts"; - static const postDetail = "$baseUrl/posts/"; + // static const baseUrl = "https://jsonplaceholder.typicode.com"; + // static const allPosts = "$baseUrl/posts"; + // static const postDetail = "$baseUrl/posts/"; + + /// + static const baseUrl = "https://tasty.p.rapidapi.com/recipes"; + static const allRecipes = "$baseUrl/list"; } diff --git a/lib/app/service/REST/dio_client.dart b/lib/app/service/REST/dio_client.dart index 1f6e13f..727a9a8 100755 --- a/lib/app/service/REST/dio_client.dart +++ b/lib/app/service/REST/dio_client.dart @@ -20,7 +20,7 @@ class DioClient { try { var response = await Dio() .get(url, - options: Options(headers: Header.defaultHeader), + options: Options(headers: Header.rapidApiHeader), queryParameters: params) .timeout(const Duration(seconds: TIME_OUT_DURATION)); diff --git a/lib/main.dart b/lib/main.dart index 2447beb..0de5605 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,7 @@ import 'package:getx_standard/app/data/local/my_hive.dart'; import 'app/data/local/my_shared_pref.dart'; import 'app/modules/example/home-with-restAPI/model/posts.dart'; +import 'app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'app/routes/app_pages.dart'; import 'config/theme/my_theme.dart'; import 'config/translations/localization_service.dart'; @@ -20,6 +21,7 @@ Future main() async { // init hive and adapters await MyHive.init(registerAdapters: (hive) { hive.registerAdapter(PostsAdapter()); + hive.registerAdapter(RecipesAdapter()); //myHive.registerAdapter(OtherAdapter()); }); From 7102996be74d9d59f0b3f836e3205816f1391bce Mon Sep 17 00:00:00 2001 From: Moktadir Date: Tue, 19 Sep 2023 08:23:12 +0600 Subject: [PATCH 3/5] Recipe Api --- ios/Podfile | 8 +- ios/Podfile.lock | 2 +- .../global-widgets/network_image_box.dart | 56 +++++++++++++ lib/app/data/local/my_hive.dart | 41 ++-------- .../controllers/home_controller.dart | 45 +---------- .../home-with-restAPI/model/posts.dart | 34 -------- .../home-with-restAPI/model/posts.g.dart | 50 ------------ .../home-with-restAPI/views/home_view.dart | 80 ++++++++++++++----- lib/app/service/REST/api_exceptions.dart | 7 +- lib/app/service/REST/api_urls.dart | 5 -- lib/app/service/helper/dialog_helper.dart | 1 + lib/config/theme/light_theme_colors.dart | 2 +- lib/main.dart | 20 ++++- lib/utils/constants.dart | 1 + 14 files changed, 156 insertions(+), 196 deletions(-) create mode 100644 lib/app/components/global-widgets/network_image_box.dart delete mode 100755 lib/app/modules/example/home-with-restAPI/model/posts.dart delete mode 100644 lib/app/modules/example/home-with-restAPI/model/posts.g.dart diff --git a/ios/Podfile b/ios/Podfile index 2b94a20..9b1c699 100755 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '11.0' + platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -40,5 +40,11 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + xcconfig_path = config.base_configuration_reference.real_path + xcconfig = File.read(xcconfig_path) + xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") + File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } + end end end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ffe559c..c6087a5 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -978,6 +978,6 @@ SPEC CHECKSUMS: SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 -PODFILE CHECKSUM: fff3348f19d060f45045a9c9fbca3a264147c2f7 +PODFILE CHECKSUM: 31828bab3e9d729b44fbc0ec3dfe1a185a87bd4b COCOAPODS: 1.12.1 diff --git a/lib/app/components/global-widgets/network_image_box.dart b/lib/app/components/global-widgets/network_image_box.dart new file mode 100644 index 0000000..e416e2e --- /dev/null +++ b/lib/app/components/global-widgets/network_image_box.dart @@ -0,0 +1,56 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:lottie/lottie.dart'; + +import '../../../utils/constants.dart'; + +class NetworkImageBox extends StatelessWidget { + const NetworkImageBox({ + super.key, + required this.url, + }); + + final String url; + + @override + Widget build(BuildContext context) { + return CachedNetworkImage( + height: 110.sp, + width: 110.sp, + imageUrl: url, + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.white, width: 1), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(18.r), + image: DecorationImage( + image: imageProvider, + fit: BoxFit.cover, + ), + ), + ), + placeholder: (context, url) => Lottie.asset( + 'animations/image_loader.json', + height: 120.sp, + repeat: true, + reverse: true, + fit: BoxFit.cover, + ), + errorWidget: (context, url, error) => Container( + height: 300.sp, + width: 300.sp, + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: const Color(0xffF3F3F3), + border: Border.all(color: Colors.white, width: 1), + shape: BoxShape.circle, + ), + child: Image.asset( + AppImages.kNoImage, + fit: BoxFit.contain, + ), + ), + ); + } +} diff --git a/lib/app/data/local/my_hive.dart b/lib/app/data/local/my_hive.dart index cb077ba..817ca6a 100644 --- a/lib/app/data/local/my_hive.dart +++ b/lib/app/data/local/my_hive.dart @@ -1,20 +1,16 @@ import 'package:getx_standard/app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'package:hive_flutter/hive_flutter.dart'; - -import '../../modules/example/home-with-restAPI/model/posts.dart'; +import 'package:logger/logger.dart'; class MyHive { // Prevent making an instance of this class MyHive._(); - // Hive box to store post data - static late Box _postBox; - // Hive box to store recipe data static late Box _recipeBox; // Box name, it's like the table name - static const String _postBoxName = 'posts'; + static const String _recipeBoxName = 'recipes'; /// Initialize local db (HIVE) @@ -27,30 +23,8 @@ class MyHive { await Hive.initFlutter(); } await registerAdapters?.call(Hive); - await initPostsBox(); - await initRecipesBox(); - } - - /// Initialize post box - static Future initPostsBox() async { - _postBox = await Hive.openBox(_postBoxName); - } - /// Save all posts to the database - static Future saveAllPosts(List posts) async { - try { - await _postBox.clear(); // Clear existing data - await _postBox.addAll(posts); // Add all posts to Hive - } catch (error) { - // Handle error - } - } - - /// Get all posts from Hive - static List getAllPosts() { - final posts = _postBox.values.toList(); - return posts - .cast(); // Cast the list to the correct type (List) + await initRecipesBox(); } /// Initialize recipe box @@ -61,17 +35,16 @@ class MyHive { /// Save all recipes to the database static Future saveAllRecipes(List recipes) async { try { - await _recipeBox.clear(); // Clear existing data - await _recipeBox.addAll(recipes); // Add all recipes to Hive + await _recipeBox.clear(); + await _recipeBox.addAll(recipes); } catch (error) { - // Handle error + Logger().e("$error"); } } /// Get all recipes from Hive static List getAllRecipes() { final recipes = _recipeBox.values.toList(); - return recipes - .cast(); // Cast the list to the correct type (List) + return recipes.cast(); } } diff --git a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart index 45b7c04..074d029 100755 --- a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart +++ b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart @@ -1,7 +1,6 @@ import 'package:get/get.dart'; import 'package:getx_standard/app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'package:getx_standard/app/service/helper/network_connectivity.dart'; -import 'package:logger/logger.dart'; import '../../../../components/global-widgets/custom_snackbar.dart'; import '../../../../components/navbar/navbar_controller.dart'; @@ -18,47 +17,7 @@ class HomeController extends GetxController with ExceptionHandler { final recipes = RxList(); - /// GET POST LIST 'HIVE IMPLEMENTED' - // final postList = RxList(); - // - // getPostList() async { - // showLoading(); - // if (await NetworkConnectivity.isNetworkAvailable()) { - // // Fetch posts from the API - // - // var response = - // await DioClient().get(url: ApiUrl.allPosts).catchError(handleError); - // - // if (response == null) return; - // - // postList - // .assignAll((response as List).map((e) => Posts.fromJson(e)).toList()); - // - // // Save fetched posts to Hive for future use - // await MyHive.saveAllPosts(postList); - // - // hideLoading(); - // } else { - // // If offline, try to load from Hive - // - // var posts = MyHive.getAllPosts(); - // - // if (posts.isNotEmpty) { - // // Use posts from Hive if available - // postList.assignAll(posts); - // - // hideLoading(); - // CustomSnackBar.showCustomErrorToast(message: "No network!"); - // return; - // } else { - // isError.value = true; - // - // hideLoading(); - // showErrorDialog("Oops!", "Connection problem"); - // return; - // } - // } - // } + /// GET ALL RECIPES LIST 'HIVE IMPLEMENTED' getRecipes() async { showLoading(); @@ -77,7 +36,6 @@ class HomeController extends GetxController with ExceptionHandler { /// Save fetched posts to Hive for future use await MyHive.saveAllRecipes(recipes); hideLoading(); - Logger().d(response); } else { /// If offline, try to load from Hive var savedRecipes = MyHive.getAllRecipes(); @@ -99,7 +57,6 @@ class HomeController extends GetxController with ExceptionHandler { @override void onReady() async { - // await getPostList(); await getRecipes(); super.onReady(); diff --git a/lib/app/modules/example/home-with-restAPI/model/posts.dart b/lib/app/modules/example/home-with-restAPI/model/posts.dart deleted file mode 100755 index d09f45b..0000000 --- a/lib/app/modules/example/home-with-restAPI/model/posts.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:hive/hive.dart'; - -part 'posts.g.dart'; // This is the generated Hive type adapter file - -@HiveType(typeId: 0) // Replace 0 with a unique integer identifier for this type -class Posts extends HiveObject { - @HiveField(0) - int? userId; - - @HiveField(1) - int? id; - - @HiveField(2) - String? title; - - @HiveField(3) - String? body; - - Posts({ - this.userId, - this.id, - this.title, - this.body, - }); - - factory Posts.fromJson(Map json) { - return Posts( - userId: json['userId'], - id: json['id'], - title: json['title'], - body: json['body'], - ); - } -} diff --git a/lib/app/modules/example/home-with-restAPI/model/posts.g.dart b/lib/app/modules/example/home-with-restAPI/model/posts.g.dart deleted file mode 100644 index 9fd6a5f..0000000 --- a/lib/app/modules/example/home-with-restAPI/model/posts.g.dart +++ /dev/null @@ -1,50 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'posts.dart'; - -// ************************************************************************** -// TypeAdapterGenerator -// ************************************************************************** - -class PostsAdapter extends TypeAdapter { - @override - final int typeId = 0; - - @override - Posts read(BinaryReader reader) { - final numOfFields = reader.readByte(); - final fields = { - for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), - }; - return Posts( - userId: fields[0] as int?, - id: fields[1] as int?, - title: fields[2] as String?, - body: fields[3] as String?, - ); - } - - @override - void write(BinaryWriter writer, Posts obj) { - writer - ..writeByte(4) - ..writeByte(0) - ..write(obj.userId) - ..writeByte(1) - ..write(obj.id) - ..writeByte(2) - ..write(obj.title) - ..writeByte(3) - ..write(obj.body); - } - - @override - int get hashCode => typeId.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is PostsAdapter && - runtimeType == other.runtimeType && - typeId == other.typeId; -} diff --git a/lib/app/modules/example/home-with-restAPI/views/home_view.dart b/lib/app/modules/example/home-with-restAPI/views/home_view.dart index 1e51282..8138b70 100755 --- a/lib/app/modules/example/home-with-restAPI/views/home_view.dart +++ b/lib/app/modules/example/home-with-restAPI/views/home_view.dart @@ -6,7 +6,7 @@ import 'package:iconly/iconly.dart'; import '../../../../../config/theme/my_fonts.dart'; import '../../../../components/global-widgets/empty_widget.dart'; -import '../../../../routes/app_pages.dart'; +import '../../../../components/global-widgets/network_image_box.dart'; import '../controllers/home_controller.dart'; class HomeView extends GetView { @@ -18,7 +18,7 @@ class HomeView extends GetView { return Scaffold( appBar: AppBar( - title: const Text('All Posts'), + title: const Text('Tasty'), actions: [ IconButton( onPressed: () => controller.navController.selectedIndex.value = 1, @@ -72,24 +72,64 @@ class HomeView extends GetView { ), itemBuilder: (ctx, index) => SplashContainer( radius: 15, - onPressed: () { - // controller.title.value = - // controller.postList[index].title ?? ""; - // controller.body.value = - // controller.postList[index].body ?? ""; - // Get.toNamed(Routes.POST_DETAIL); - }, - child: Padding( - padding: EdgeInsets.all(8.r), - child: Center( - child: Text( - controller.recipes[index].name ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: MyFonts.headline6TextSize, - fontWeight: FontWeight.w500, - color: theme.primaryColor, - ), + onPressed: () {}, + child: SizedBox( + height: 110.sp, + child: Padding( + padding: EdgeInsets.all(8.r), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SplashContainer( + radius: 15, + onPressed: () {}, + child: NetworkImageBox( + url: controller + .recipes[index].thumbnailUrl ?? + "", + ), + ), + SizedBox(width: 10.sp), + Expanded( + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + controller.recipes[index].name ?? + "", + textAlign: TextAlign.left, + style: TextStyle( + fontSize: + MyFonts.headline5TextSize, + fontWeight: FontWeight.w500, + color: theme.primaryColor, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + Flexible( + child: Text( + controller.recipes[index] + .description ?? + "No description", + textAlign: TextAlign.left, + style: TextStyle( + fontSize: + MyFonts.headline6TextSize, + fontWeight: FontWeight.w400, + color: theme.hintColor, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + ], ), ), ), diff --git a/lib/app/service/REST/api_exceptions.dart b/lib/app/service/REST/api_exceptions.dart index 256d16f..2e223aa 100755 --- a/lib/app/service/REST/api_exceptions.dart +++ b/lib/app/service/REST/api_exceptions.dart @@ -4,6 +4,7 @@ import 'package:getx_standard/config/translations/strings_enum.dart'; class DioExceptions implements Exception { String message = ""; + DioExceptions.fromDioError(DioException dioException) { switch (dioException.type) { case DioExceptionType.cancel: @@ -15,13 +16,13 @@ class DioExceptions implements Exception { case DioExceptionType.receiveTimeout: message = Strings.receiveTimeout.tr; break; + case DioExceptionType.sendTimeout: + message = Strings.sendTimeout.tr; + break; case DioExceptionType.badResponse: message = _handleError(dioException.response!.statusCode!.toInt(), dioException.response!.data); break; - case DioExceptionType.sendTimeout: - message = Strings.sendTimeout.tr; - break; case DioExceptionType.unknown: message = Strings.connectionProblem.tr; break; diff --git a/lib/app/service/REST/api_urls.dart b/lib/app/service/REST/api_urls.dart index 19b4dbf..f18a89d 100755 --- a/lib/app/service/REST/api_urls.dart +++ b/lib/app/service/REST/api_urls.dart @@ -1,10 +1,5 @@ class ApiUrl { /// Base URL - // static const baseUrl = "https://jsonplaceholder.typicode.com"; - // static const allPosts = "$baseUrl/posts"; - // static const postDetail = "$baseUrl/posts/"; - - /// static const baseUrl = "https://tasty.p.rapidapi.com/recipes"; static const allRecipes = "$baseUrl/list"; } diff --git a/lib/app/service/helper/dialog_helper.dart b/lib/app/service/helper/dialog_helper.dart index b02603a..81fe931 100755 --- a/lib/app/service/helper/dialog_helper.dart +++ b/lib/app/service/helper/dialog_helper.dart @@ -105,6 +105,7 @@ class DialogHelper { ), ), ), + barrierColor: Colors.transparent, ); } diff --git a/lib/config/theme/light_theme_colors.dart b/lib/config/theme/light_theme_colors.dart index 17b83dd..63b6056 100755 --- a/lib/config/theme/light_theme_colors.dart +++ b/lib/config/theme/light_theme_colors.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class LightThemeColors { //dark swatch - static const Color primaryColor = Color(0xFF0071ED); + static const Color primaryColor = Colors.deepOrangeAccent; static const Color accentColor = Color(0xFFD9EDE1); //APPBAR diff --git a/lib/main.dart b/lib/main.dart index 0de5605..58e4326 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,7 +5,6 @@ import 'package:get/get.dart'; import 'package:getx_standard/app/data/local/my_hive.dart'; import 'app/data/local/my_shared_pref.dart'; -import 'app/modules/example/home-with-restAPI/model/posts.dart'; import 'app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'app/routes/app_pages.dart'; import 'config/theme/my_theme.dart'; @@ -20,9 +19,24 @@ Future main() async { // init hive and adapters await MyHive.init(registerAdapters: (hive) { - hive.registerAdapter(PostsAdapter()); hive.registerAdapter(RecipesAdapter()); - //myHive.registerAdapter(OtherAdapter()); + hive.registerAdapter(ResultsAdapter()); + hive.registerAdapter(TotalTimeTierAdapter()); + hive.registerAdapter(ShowAdapter()); + hive.registerAdapter(SectionsAdapter()); + hive.registerAdapter(ComponentsAdapter()); + hive.registerAdapter(MeasurementsAdapter()); + hive.registerAdapter(UnitAdapter()); + hive.registerAdapter(IngredientAdapter()); + hive.registerAdapter(CompilationsAdapter()); + hive.registerAdapter(TagsAdapter()); + hive.registerAdapter(RenditionsAdapter()); + hive.registerAdapter(NutritionAdapter()); + hive.registerAdapter(PriceAdapter()); + hive.registerAdapter(TopicsAdapter()); + hive.registerAdapter(UserRatingsAdapter()); + hive.registerAdapter(InstructionsAdapter()); + hive.registerAdapter(CreditsAdapter()); }); // Device info diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index f0bace4..4dda607 100755 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -1,5 +1,6 @@ class AppImages { static String get kAppIcon => 'assets/images/icon-splash/app_icon.png'; + static String get kNoImage => 'assets/images/no_image.png'; } class Onboarding { From 77916cb965be35ab2802ad313021f832e4577253 Mon Sep 17 00:00:00 2001 From: Moktadir Date: Thu, 21 Sep 2023 05:06:56 +0600 Subject: [PATCH 4/5] new Ui with new rest api --- animations/apiError.json | 2075 ++++++++++++++++- ios/Runner/Info.plist | 4 +- .../global-widgets/network_image_box.dart | 4 +- .../global-widgets/splash_container.dart | 1 + lib/app/data/local/hive/hive_adapters.dart | 27 + lib/app/data/local/{ => hive}/my_hive.dart | 0 .../controllers/graphql_controller.dart | 4 +- .../controllers/home_controller.dart | 56 +- .../home-with-restAPI/views/home_view.dart | 218 +- lib/app/service/REST/api_header.dart | 12 +- lib/app/service/REST/api_urls.dart | 5 +- lib/app/service/REST/dio_client.dart | 66 +- .../service/handler/exception_handler.dart | 6 +- lib/app/service/helper/dialog_helper.dart | 34 +- lib/config/theme/light_theme_colors.dart | 2 +- lib/config/theme/my_fonts.dart | 3 +- lib/config/theme/my_styles.dart | 10 +- .../translations/ar_AR/ar_ar_translation.dart | 2 +- .../translations/en_US/en_us_translation.dart | 2 +- lib/config/translations/strings_enum.dart | 2 +- lib/main.dart | 26 +- 21 files changed, 2356 insertions(+), 203 deletions(-) create mode 100644 lib/app/data/local/hive/hive_adapters.dart rename lib/app/data/local/{ => hive}/my_hive.dart (100%) diff --git a/animations/apiError.json b/animations/apiError.json index 5918240..c3095b0 100755 --- a/animations/apiError.json +++ b/animations/apiError.json @@ -1 +1,2074 @@ -{"v":"5.4.1","fr":29.9700012207031,"ip":0,"op":150.000006109625,"w":150,"h":150,"nm":"Bag-anim","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"ref","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p667_1_0p167_0p167"],"t":0,"s":[0],"e":[-21]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p667_1_0p167_0p167"],"t":8,"s":[-21],"e":[185.2]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":26,"s":[185.2],"e":[180]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":30,"s":[180],"e":[180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p667_1_0p167_0p167"],"t":98.828,"s":[180],"e":[200]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p667_1_0p167_0p167"],"t":103.828,"s":[200],"e":[-5]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.333],"y":[0]},"n":["0p833_0p833_0p333_0"],"t":124.22,"s":[-5],"e":[0]},{"t":127.000005172816}],"ix":10},"p":{"a":0,"k":[75,75,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[30,30,100],"ix":6}},"ao":0,"ip":0,"op":152.000006191087,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Eye R","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[85.25,75,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-5.625,-12.875],[-5.625,-4.25]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.917647058824,0.388235294118,0.4,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.333],"y":[0]},"n":["0p833_0p833_0p333_0"],"t":42,"s":[0],"e":[100]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p833_1_0p167_0"],"t":55,"s":[100],"e":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0]},"n":["0p833_0p833_0p167_0"],"t":88.828,"s":[100],"e":[0]},{"t":98.8275040253266}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":42.0000017106951,"op":153.000006231818,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Eye L","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[75,75,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-5.625,-12.875],[-5.625,-4.25]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.917647058824,0.388235294118,0.4,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.333],"y":[0]},"n":["0p833_0p833_0p333_0"],"t":42,"s":[0],"e":[100]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p833_1_0p167_0"],"t":49.99,"s":[100],"e":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0]},"n":["0p833_0p833_0p167_0"],"t":86.828,"s":[100],"e":[0]},{"t":96.8275039438649}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":42.0000017106951,"op":152.000006191087,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"mouth","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50.313,-63.333,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[333.333,333.333,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-13.875],[0,14.625]],"o":[[0,13.875],[0,-14.625]],"v":[[-11.125,21],[11.25,21]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.917647063732,0.388235300779,0.40000000596,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"handle","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p667_1_0p167_0p167"],"t":36,"s":[100],"e":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p667_1_0p167_0"],"t":46.57,"s":[0],"e":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p667_1_0p167_0p167"],"t":86.828,"s":[0],"e":[100]},{"t":95.8275039031341}],"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":152.000006191087,"st":-899.000036617021,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"bag-outside","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50.313,-63.333,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[333.333,333.333,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-13.875],[0,14.625]],"o":[[0,13.875],[0,-14.625]],"v":[[-11.125,21],[11.25,21]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.556862771511,0.556862771511,0.57647061348,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"handle","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,-3.313],[0,0],[0,0],[0,2.75]],"o":[[0,0],[0,0],[0,3.313],[0,0],[0,0],[0,-2.75]],"v":[[23.938,15.938],[-24.097,15.975],[-24.125,53.438],[-21.109,57.375],[21.25,57.313],[23.938,54.375]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.556862771511,0.556862771511,0.57647061348,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.976470588235,0.976470588235,0.976470588235,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"bag","np":3,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":152.000006191087,"st":-899.000036617021,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"bag-inside","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,-63.333,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[333.333,333.333,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[16.625,10.5],[-16.75,10.5],[-23.875,15.75],[-14.875,36],[13.5,35.75],[24,15.625]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.556862771511,0.556862771511,0.57647061348,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.733333333333,0.760784313725,0.788235294118,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":151.000006150356,"st":0,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"BG","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[78,71,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[94.964,94.964,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[142,142],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.997878011068,0.819607962814,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.976470588235,0.976470588235,0.976470588235,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-3,4],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[103.512,103.512],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":153.000006231818,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{ + "v": "4.6.3", + "fr": 24, + "ip": 0, + "op": 21, + "w": 320, + "h": 320, + "nm": "checklist", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "Shape Layer 13", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 300 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 3, + "ty": 4, + "nm": "Shape Layer 12", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 250 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 4, + "ty": 4, + "nm": "Shape Layer 11", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 200 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 5, + "ty": 4, + "nm": "Shape Layer 10", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 150 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 6, + "ty": 4, + "nm": "Shape Layer 9", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 100 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 7, + "ty": 4, + "nm": "Shape Layer 8", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 50 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 8, + "ty": 4, + "nm": "Shape Layer 7", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 0 }, + "p": { "a": 0, "k": [160, 159.5, 0] }, + "a": { "a": 0, "k": [0, -34, 0] }, + "s": { "a": 0, "k": [100, 100, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667], "y": [1, 1] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p667_1_0p167_0p167", "0p667_1_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 17 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.667, "y": 1 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p667_1_0p167_0p167", + "t": 6, + "s": [-8.142, -92.147], + "e": [-7.675, -162.544], + "to": [0.07779947668314, -11.7327470779419], + "ti": [-0.07779947668314, 11.7327470779419] + }, + { "t": 17 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [83.981, 100], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p667_1_0p167_0p167"], + "t": 6, + "s": [20.367], + "e": [6.367] + }, + { "t": 17 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + }, + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833], "y": [0.833, 0.833] }, + "o": { "x": [0.167, 0.167], "y": [0.167, 0.167] }, + "n": ["0p833_0p833_0p167_0p167", "0p833_0p833_0p167_0p167"], + "t": 6, + "s": [15.021, 15.021], + "e": [0, 0] + }, + { "t": 21 } + ] + }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 17 } + ] + }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.833 }, + "o": { "x": 0.167, "y": 0.167 }, + "n": "0p833_0p833_0p167_0p167", + "t": 6, + "s": [16.585, -99.759], + "e": [28.521, -187.495], + "to": [1.9892578125, -14.6227216720581], + "ti": [-1.9892578125, 14.6227216720581] + }, + { "t": 21 } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [97.419, 116], "ix": 3 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "n": ["0p833_0p833_0p167_0p167"], + "t": 6, + "s": [14.733], + "e": [8.733] + }, + { "t": 21 } + ], + "ix": 6 + }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 2, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 9, + "ty": 4, + "nm": "Shape Layer 5", + "parent": 11, + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 0 }, + "p": { "a": 0, "k": [0.8, -0.641, 0] }, + "a": { "a": 0, "k": [0, 0, 0] }, + "s": { "a": 0, "k": [7.39, 7.39, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [-6.977, 7], + [6.973, -7] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [-6.977, 7], + [6.973, -7] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": -90, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 1, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "mm", + "mm": 2, + "nm": "Merge Paths 1", + "mn": "ADBE Vector Filter - Merge", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [1, 1, 1, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 4, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [200, 200], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Combined Shape", + "np": 4, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 7, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 10, + "ty": 4, + "nm": "Shape Layer 6", + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 4, + "s": [50], + "e": [0] + }, + { "t": 14 } + ] + }, + "r": { "a": 0, "k": 0 }, + "p": { "a": 0, "k": [160, 160, 0] }, + "a": { "a": 0, "k": [0, 0, 0] }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 0.667] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0.333] }, + "n": ["0p667_1_0p333_0", "0p667_1_0p333_0", "0p667_0p667_0p333_0p333"], + "t": 4, + "s": [100, 100, 100], + "e": [1085, 1085, 100] + }, + { "t": 14 } + ] + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [19.779, 19.779] }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { "a": 0, "k": [0.8274509, 0.1843137, 0.1843137, 1] }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-0.068, 0.036], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + } + ], + "ip": 4, + "op": 22, + "st": -23, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 11, + "ty": 4, + "nm": "Shape Layer 4", + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 6, + "s": [30], + "e": [100] + }, + { "t": 9 } + ] + }, + "r": { "a": 0, "k": 0 }, + "p": { "a": 0, "k": [160.312, 161.188, 0] }, + "a": { "a": 0, "k": [0.812, -0.562, 0] }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 0.667] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0.333] }, + "n": ["0p667_1_0p333_0", "0p667_1_0p333_0", "0p667_0p667_0p333_0p333"], + "t": 6, + "s": [100, 100, 100], + "e": [1087, 1087, 100] + }, + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 0.667] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0.333] }, + "n": ["0p667_1_0p333_0", "0p667_1_0p333_0", "0p667_0p667_0p333_0p333"], + "t": 11, + "s": [1087, 1087, 100], + "e": [866, 866, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [0.833, 0.833, 0.833] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0.333] }, + "n": ["0p833_0p833_0p333_0", "0p833_0p833_0p333_0", "0p833_0p833_0p333_0p333"], + "t": 13, + "s": [866, 866, 100], + "e": [878, 878, 100] + }, + { "t": 16 } + ] + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [10.068, 10.068] }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "fl", + "c": { "a": 0, "k": [0.8274509, 0.1843137, 0.1843137, 1] }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { "a": 0, "k": [0.784, -0.716], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + } + ], + "ip": 6, + "op": 22, + "st": -19, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 12, + "ty": 4, + "nm": "Shape Layer 3", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 0 }, + "p": { "a": 0, "k": [161, 160, 0] }, + "a": { "a": 0, "k": [0, 0, 0] }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 0.667] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0.333] }, + "n": ["0p667_1_0p333_0", "0p667_1_0p333_0", "0p667_0p667_0p333_0p333"], + "t": 3, + "s": [100, 100, 100], + "e": [224, 224, 100] + }, + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 0.667] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0.333] }, + "n": ["0p667_1_0p333_0", "0p667_1_0p333_0", "0p667_0p667_0p333_0p333"], + "t": 4, + "s": [224, 224, 100], + "e": [476, 476, 100] + }, + { "t": 8 } + ] + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [6.009, 6.009] }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "st", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 4, + "s": [0.8274509, 0.1843137, 0.1843137, 1], + "e": [0.8274509, 0.1843137, 0.1843137, 1] + }, + { "t": 8 } + ] + }, + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 4, + "s": [0], + "e": [100] + }, + { "t": 5 } + ] + }, + "w": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 4, + "s": [3], + "e": [0] + }, + { "t": 8 } + ] + }, + "lc": 1, + "lj": 1, + "ml": 4, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke" + }, + { + "ty": "fl", + "c": { "a": 0, "k": [0.8274509, 0.1843137, 0.1843137, 1] }, + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 3, + "s": [100], + "e": [99] + }, + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "n": ["0p667_1_0p333_0"], + "t": 4, + "s": [99], + "e": [0] + }, + { "t": 5 } + ] + }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-0.338, 0.065], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [649.112, 649.112], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 2", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + } + ], + "ip": 3, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + }, + { + "ddd": 0, + "ind": 13, + "ty": 4, + "nm": "Shape Layer 2", + "ks": { + "o": { "a": 0, "k": 100 }, + "r": { "a": 0, "k": 0 }, + "p": { "a": 0, "k": [160.142, 159.987, 0] }, + "a": { "a": 0, "k": [0, 0, 0] }, + "s": { "a": 0, "k": [377.603, 377.603, 100] } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [22.315, 22.315] }, + "p": { "a": 0, "k": [0, 0] }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse" + }, + { + "ty": "st", + "c": { "a": 0, "k": [0.8352941, 0.8352941, 0.8352941, 1] }, + "o": { "a": 0, "k": 100 }, + "w": { "a": 0, "k": 1 }, + "lc": 1, + "lj": 1, + "ml": 4, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke" + }, + { + "ty": "fl", + "c": { "a": 0, "k": [1, 1, 1, 1] }, + "o": { "a": 0, "k": 100 }, + "r": 1, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill" + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-0.038, 0.003], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "ix": 1, + "mn": "ADBE Vector Group" + } + ], + "ip": -21, + "op": 22, + "st": -21, + "bm": 0, + "sr": 1 + } + ] +} diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index dd3bcee..739f3f3 100755 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - GetX Standard + GetX Standard CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - GetX Standard + GetX Standard CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/app/components/global-widgets/network_image_box.dart b/lib/app/components/global-widgets/network_image_box.dart index e416e2e..fefda44 100644 --- a/lib/app/components/global-widgets/network_image_box.dart +++ b/lib/app/components/global-widgets/network_image_box.dart @@ -9,9 +9,11 @@ class NetworkImageBox extends StatelessWidget { const NetworkImageBox({ super.key, required this.url, + required this.radius, }); final String url; + final num radius; @override Widget build(BuildContext context) { @@ -23,7 +25,7 @@ class NetworkImageBox extends StatelessWidget { decoration: BoxDecoration( border: Border.all(color: Colors.white, width: 1), shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(18.r), + borderRadius: BorderRadius.circular(radius.r), image: DecorationImage( image: imageProvider, fit: BoxFit.cover, diff --git a/lib/app/components/global-widgets/splash_container.dart b/lib/app/components/global-widgets/splash_container.dart index 7630ca3..d1e2b09 100644 --- a/lib/app/components/global-widgets/splash_container.dart +++ b/lib/app/components/global-widgets/splash_container.dart @@ -23,6 +23,7 @@ class SplashContainer extends StatelessWidget { splashFactory: InkSplash.splashFactory, highlightColor: theme.primaryColor.withOpacity(.3), borderRadius: BorderRadius.circular(radius.r), + radius: 60.r, onTap: onPressed, child: Ink( decoration: BoxDecoration( diff --git a/lib/app/data/local/hive/hive_adapters.dart b/lib/app/data/local/hive/hive_adapters.dart new file mode 100644 index 0000000..f6d48eb --- /dev/null +++ b/lib/app/data/local/hive/hive_adapters.dart @@ -0,0 +1,27 @@ +import '../../../modules/example/home-with-restAPI/model/recipes_model.dart'; +import 'my_hive.dart'; + +class HiveAdapters { + static Future registerAll() async { + await MyHive.init(registerAdapters: (hive) { + hive.registerAdapter(RecipesAdapter()); + hive.registerAdapter(ResultsAdapter()); + hive.registerAdapter(TotalTimeTierAdapter()); + hive.registerAdapter(ShowAdapter()); + hive.registerAdapter(SectionsAdapter()); + hive.registerAdapter(ComponentsAdapter()); + hive.registerAdapter(MeasurementsAdapter()); + hive.registerAdapter(UnitAdapter()); + hive.registerAdapter(IngredientAdapter()); + hive.registerAdapter(CompilationsAdapter()); + hive.registerAdapter(TagsAdapter()); + hive.registerAdapter(RenditionsAdapter()); + hive.registerAdapter(NutritionAdapter()); + hive.registerAdapter(PriceAdapter()); + hive.registerAdapter(TopicsAdapter()); + hive.registerAdapter(UserRatingsAdapter()); + hive.registerAdapter(InstructionsAdapter()); + hive.registerAdapter(CreditsAdapter()); + }); + } +} diff --git a/lib/app/data/local/my_hive.dart b/lib/app/data/local/hive/my_hive.dart similarity index 100% rename from lib/app/data/local/my_hive.dart rename to lib/app/data/local/hive/my_hive.dart diff --git a/lib/app/modules/example/home-with-graphql/controllers/graphql_controller.dart b/lib/app/modules/example/home-with-graphql/controllers/graphql_controller.dart index eb837c8..a87e15f 100755 --- a/lib/app/modules/example/home-with-graphql/controllers/graphql_controller.dart +++ b/lib/app/modules/example/home-with-graphql/controllers/graphql_controller.dart @@ -1,4 +1,6 @@ +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:getx_standard/app/modules/example/home-with-restAPI/controllers/home_controller.dart'; import 'package:getx_standard/app/service/handler/exception_handler.dart'; import '../../../../components/navbar/navbar_controller.dart'; @@ -62,7 +64,7 @@ class GraphQLController extends GetxController with ExceptionHandler { @override void onReady() async { await getAlbums(); - + Get.find().bottomPadding.value = 18.sp; super.onReady(); } } diff --git a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart index 074d029..88f6c17 100755 --- a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart +++ b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart @@ -1,31 +1,53 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:getx_standard/app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'package:getx_standard/app/service/helper/network_connectivity.dart'; import '../../../../components/global-widgets/custom_snackbar.dart'; import '../../../../components/navbar/navbar_controller.dart'; -import '../../../../data/local/my_hive.dart'; +import '../../../../data/local/hive/my_hive.dart'; import '../../../../service/REST/api_urls.dart'; import '../../../../service/REST/dio_client.dart'; import '../../../../service/handler/exception_handler.dart'; class HomeController extends GetxController with ExceptionHandler { final navController = Get.put(NavbarController()); + final scrollController = ScrollController(); + + RxDouble bottomPadding = 18.sp.obs; RxString title = "".obs; RxString body = "".obs; final recipes = RxList(); + scrollPositionTracker() { + scrollController.addListener(() { + if (scrollController.position.pixels > + scrollController.position.minScrollExtent + 5) { + bottomPadding.value = 18.sp; + // position in Top + } + if (scrollController.position.pixels >= + scrollController.position.maxScrollExtent) { + bottomPadding.value = 130.sp; + // position in Bottom + } + }); + } + /// GET ALL RECIPES LIST 'HIVE IMPLEMENTED' getRecipes() async { showLoading(); if (await NetworkConnectivity.isNetworkAvailable()) { /// Fetch recipes from the API - var response = await DioClient().get( - url: ApiUrl.allRecipes, - params: {"from": 0, "size": 20}).catchError(handleError); + var response = await DioClient() + .get( + url: ApiUrl.allRecipes, + ) + .catchError(handleError); if (response == null) return; @@ -58,7 +80,31 @@ class HomeController extends GetxController with ExceptionHandler { @override void onReady() async { await getRecipes(); - + // scrollController.addListener(() { + // if (scrollController.position.atEdge) { + // bool isTop = scrollController.position.pixels == 0; + // if (isTop) { + // bottomPadding.value = 18.sp; + // print('At the top'); + // } else { + // bottomPadding.value = 50.sp; + // print('At the bottom'); + // } + // } + // }); super.onReady(); } + + @override + void onInit() { + super.onInit(); + + scrollPositionTracker(); + } + + @override + void dispose() { + scrollController.dispose(); + super.dispose(); + } } diff --git a/lib/app/modules/example/home-with-restAPI/views/home_view.dart b/lib/app/modules/example/home-with-restAPI/views/home_view.dart index 8138b70..45feb51 100755 --- a/lib/app/modules/example/home-with-restAPI/views/home_view.dart +++ b/lib/app/modules/example/home-with-restAPI/views/home_view.dart @@ -3,8 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:getx_standard/app/components/global-widgets/splash_container.dart'; import 'package:iconly/iconly.dart'; +import 'package:iconsax/iconsax.dart'; -import '../../../../../config/theme/my_fonts.dart'; import '../../../../components/global-widgets/empty_widget.dart'; import '../../../../components/global-widgets/network_image_box.dart'; import '../controllers/home_controller.dart'; @@ -29,118 +29,142 @@ class HomeView extends GetView { ], centerTitle: true, ), - body: Obx(() => controller.isError.value == true - ? EmptyWidget(onPressed: () async => await controller.getRecipes()) - : RefreshIndicator( - color: theme.primaryColor, - onRefresh: () async => await controller.getRecipes(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - TweenAnimationBuilder( - tween: Tween(begin: 0, end: 1), - duration: const Duration(milliseconds: 1000), - builder: - (BuildContext context, double value, Widget? child) { - return Opacity( - opacity: value, - child: Padding( - padding: EdgeInsets.only(top: value * 18.r), - child: child, - ), - ); - }, - child: Text( - "GetX Standard", - style: theme.textTheme.displaySmall, - ), - ), - Expanded( - child: RawScrollbar( - thumbColor: theme.primaryColor, - radius: Radius.circular(100.r), - thickness: 5, - interactive: true, - child: Padding( - padding: EdgeInsets.all(18.r), - child: ListView.separated( - itemCount: controller.recipes.length, - physics: const BouncingScrollPhysics(), - padding: EdgeInsets.zero, - separatorBuilder: (_, __) => SizedBox( - height: 20.h, - ), - itemBuilder: (ctx, index) => SplashContainer( - radius: 15, - onPressed: () {}, - child: SizedBox( - height: 110.sp, - child: Padding( - padding: EdgeInsets.all(8.r), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SplashContainer( - radius: 15, - onPressed: () {}, - child: NetworkImageBox( - url: controller - .recipes[index].thumbnailUrl ?? - "", + body: Obx( + () => controller.isError.value == true + ? EmptyWidget(onPressed: () async => await controller.getRecipes()) + : RefreshIndicator( + color: theme.primaryColor, + onRefresh: () async => await controller.getRecipes(), + child: Padding( + padding: EdgeInsets.fromLTRB( + 18.sp, 18.sp, 18.sp, controller.bottomPadding.value), + child: GridView.builder( + itemCount: controller.recipes.length, + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.zero, + controller: controller.scrollController, + itemBuilder: (context, index) => Stack( + alignment: Alignment.topCenter, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SplashContainer( + radius: 15, + onPressed: () {}, + child: Container( + width: 150.sp, + height: 170.sp, + padding: EdgeInsets.fromLTRB( + 10.sp, 46.sp, 10.sp, 12.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.r), + color: Colors.grey.shade200 + .withOpacity(0.5)), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + TweenAnimationBuilder( + tween: Tween(begin: 0, end: 1), + duration: + const Duration(milliseconds: 1500), + builder: (BuildContext context, + double value, Widget? child) { + return Opacity( + opacity: value, + child: Padding( + padding: EdgeInsets.only( + top: value * 18.r), + child: child, + ), + ); + }, + child: Text( + controller.recipes[index].name ?? "", + style: theme.textTheme.titleLarge, + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), ), - ), - SizedBox(width: 10.sp), - Expanded( - child: Column( + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, children: [ Text( - controller.recipes[index].name ?? - "", - textAlign: TextAlign.left, - style: TextStyle( - fontSize: - MyFonts.headline5TextSize, - fontWeight: FontWeight.w500, - color: theme.primaryColor, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + "${controller.recipes[index].prepTimeMinutes ?? ""} Mins", + style: theme.textTheme.bodySmall, ), - Flexible( - child: Text( - controller.recipes[index] - .description ?? - "No description", - textAlign: TextAlign.left, - style: TextStyle( - fontSize: - MyFonts.headline6TextSize, - fontWeight: FontWeight.w400, - color: theme.hintColor, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), + SizedBox( + height: 30.sp, + width: 30.sp, + child: SplashContainer( + radius: 100, + onPressed: () {}, + child: Icon( + Iconsax.save_add, + size: 16.sp, + color: theme.primaryColor, + )), ), ], ), - ), - ], + ], + ), + )), + ], + ), + Positioned( + top: 30.sp, + child: SizedBox( + height: 100.sp, + width: 100.sp, + child: NetworkImageBox( + url: controller.recipes[index].thumbnailUrl ?? "", + radius: 100, + ), + ), + ), + Positioned( + right: 10.sp, + top: 55.sp, + child: Container( + height: 28.sp, + width: 58.sp, + padding: EdgeInsets.symmetric(horizontal: 8.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50.r), + color: const Color(0xffFFE1B3), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.star, + color: const Color(0xffFFAD30), + size: 18.sp, ), - ), + Text(controller + .recipes[index].userRatings!.score! + .toStringAsFixed(1)), + ], ), ), ), - ), + ], + ), + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + childAspectRatio: 2 / 3, ), ), - ], + ), ), - )), + ), ); } } diff --git a/lib/app/service/REST/api_header.dart b/lib/app/service/REST/api_header.dart index 399e25f..cfcaf5a 100755 --- a/lib/app/service/REST/api_header.dart +++ b/lib/app/service/REST/api_header.dart @@ -1,15 +1,11 @@ class Header { - // RAPID API HEADER - static Map rapidApiHeader = { - "X-RapidAPI-Key": "05741bc39bmsh35c797d07e59651p13baa5jsn936cd89ffe07", - "X-RapidAPI-Host": "tasty.p.rapidapi.com", - }; // SECURE HEADER static Map secureHeader = { "Authorization": "Bearer 'token'", 'Accept': 'application/json', 'Content-Type': 'application/json', }; + // DEFAULT HEADER static Map defaultHeader = { 'Accept': 'application/json', @@ -28,4 +24,10 @@ class Header { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }; + + /// ***************** PERSONAL CUSTOM API HEADER ***************** /// + // RAPID API HEADER + static Map rapidApiHeader = { + "X-RapidAPI-Key": "05741bc39bmsh35c797d07e59651p13baa5jsn936cd89ffe07", + }; } diff --git a/lib/app/service/REST/api_urls.dart b/lib/app/service/REST/api_urls.dart index f18a89d..e933117 100755 --- a/lib/app/service/REST/api_urls.dart +++ b/lib/app/service/REST/api_urls.dart @@ -1,5 +1,6 @@ class ApiUrl { /// Base URL - static const baseUrl = "https://tasty.p.rapidapi.com/recipes"; - static const allRecipes = "$baseUrl/list"; + static const baseUrl = "https://tasty.p.rapidapi.com"; + static const allRecipes = "$baseUrl/recipes/list"; + static const allTags = "$baseUrl/tags/list"; } diff --git a/lib/app/service/REST/dio_client.dart b/lib/app/service/REST/dio_client.dart index 727a9a8..521e0f4 100755 --- a/lib/app/service/REST/dio_client.dart +++ b/lib/app/service/REST/dio_client.dart @@ -9,7 +9,12 @@ import 'package:dio/dio.dart'; import 'api_header.dart'; class DioClient { - static const int TIME_OUT_DURATION = 20; + static const int TIME_OUT_DURATION = 2000; + BaseOptions baseOptions = BaseOptions( + connectTimeout: const Duration(seconds: TIME_OUT_DURATION), + receiveTimeout: const Duration(seconds: TIME_OUT_DURATION), + sendTimeout: const Duration(seconds: TIME_OUT_DURATION), + ); //GET @@ -18,11 +23,9 @@ class DioClient { Map? params, }) async { try { - var response = await Dio() - .get(url, - options: Options(headers: Header.rapidApiHeader), - queryParameters: params) - .timeout(const Duration(seconds: TIME_OUT_DURATION)); + var response = await Dio(baseOptions).get(url, + options: Options(headers: Header.rapidApiHeader), + queryParameters: params); return response.data; } catch (e) { @@ -36,12 +39,10 @@ class DioClient { {required String url, Map? params, dynamic body}) async { var payload = json.encode(body); try { - var response = await Dio() - .post(url, - options: Options(headers: Header.defaultHeader), - queryParameters: params, - data: payload) - .timeout(const Duration(seconds: TIME_OUT_DURATION)); + var response = await Dio(baseOptions).post(url, + options: Options(headers: Header.defaultHeader), + queryParameters: params, + data: payload); return response.data; } catch (e) { @@ -55,12 +56,10 @@ class DioClient { {required String url, Map? params, dynamic body}) async { var payload = json.encode(body); try { - var response = await Dio() - .patch(url, - options: Options(headers: Header.defaultHeader), - queryParameters: params, - data: payload) - .timeout(const Duration(seconds: TIME_OUT_DURATION)); + var response = await Dio(baseOptions).patch(url, + options: Options(headers: Header.defaultHeader), + queryParameters: params, + data: payload); return response.data; } catch (e) { rethrow; @@ -73,12 +72,10 @@ class DioClient { {required String url, Map? params, dynamic body}) async { var payload = json.encode(body); try { - var response = await Dio() - .delete(url, - options: Options(headers: Header.defaultHeader), - queryParameters: params, - data: payload) - .timeout(const Duration(seconds: TIME_OUT_DURATION)); + var response = await Dio(baseOptions).delete(url, + options: Options(headers: Header.defaultHeader), + queryParameters: params, + data: payload); return response.data; } catch (e) { rethrow; @@ -88,6 +85,7 @@ class DioClient { //MULTIPART FOR MULTIPLE FILE UPLOAD List? docFileList = []; + Future multipartRequest({ required String url, Map? params, @@ -102,12 +100,10 @@ class DioClient { } try { - var response = await Dio() - .post(url, - options: Options(headers: Header.defaultMultipartHeader), - queryParameters: params, - data: formData) - .timeout(const Duration(seconds: TIME_OUT_DURATION)); + var response = await Dio(baseOptions).post(url, + options: Options(headers: Header.defaultMultipartHeader), + queryParameters: params, + data: formData); return response.data; } catch (e) { rethrow; @@ -128,12 +124,10 @@ class DioClient { } try { - var response = await Dio() - .post(url, - options: Options(headers: Header.defaultMultipartHeader), - queryParameters: params, - data: formData) - .timeout(const Duration(seconds: TIME_OUT_DURATION)); + var response = await Dio(baseOptions).post(url, + options: Options(headers: Header.defaultMultipartHeader), + queryParameters: params, + data: formData); return response.data; } catch (e) { rethrow; diff --git a/lib/app/service/handler/exception_handler.dart b/lib/app/service/handler/exception_handler.dart index f67e49f..7c28e08 100755 --- a/lib/app/service/handler/exception_handler.dart +++ b/lib/app/service/handler/exception_handler.dart @@ -19,7 +19,7 @@ mixin class ExceptionHandler { var errorText = DioExceptions.fromDioError(error).toString(); - showErrorDialog(Strings.oops.tr, errorText); + showErrorDialog(Strings.ohNo.tr, errorText); Logger().e(errorText); } @@ -31,10 +31,10 @@ mixin class ExceptionHandler { try { Map onlyMessage = jsonDecode(errorText); - showErrorDialog(Strings.oops.tr, onlyMessage["message"]); + showErrorDialog(Strings.ohNo.tr, onlyMessage["message"]); Logger().e(onlyMessage); } catch (e) { - showErrorDialog(Strings.oops.tr, errorText); + showErrorDialog(Strings.ohNo.tr, errorText); Logger().e(errorText); } } diff --git a/lib/app/service/helper/dialog_helper.dart b/lib/app/service/helper/dialog_helper.dart index 81fe931..c4b5778 100755 --- a/lib/app/service/helper/dialog_helper.dart +++ b/lib/app/service/helper/dialog_helper.dart @@ -16,46 +16,46 @@ class DialogHelper { Get.dialog( Dialog( elevation: 6, - shadowColor: LightThemeColors.primaryColor, + shadowColor: LightThemeColors.primaryColor.withOpacity(.5), + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)), child: Padding( padding: const EdgeInsets.all(16.0), child: Column( mainAxisSize: MainAxisSize.min, children: [ + Lottie.asset( + 'animations/apiError.json', + height: 120.sp, + repeat: true, + reverse: true, + fit: BoxFit.cover, + ), Text( title, style: TextStyle( color: Colors.redAccent, fontWeight: FontWeight.w400, - fontSize: 16.sp, + fontSize: 14.sp, ), - maxLines: 4, - overflow: TextOverflow.ellipsis, ), - SizedBox(height: 5.h), - Lottie.asset( - 'animations/apiError.json', - height: 120.h, - repeat: true, - reverse: true, - fit: BoxFit.cover, - ), - SizedBox(height: 20.h), + SizedBox(height: 20.sp), AnimatedTextKit(repeatForever: true, animatedTexts: [ ColorizeAnimatedText(description, - textStyle: Get.textTheme.headlineMedium as TextStyle, + textStyle: Get.textTheme.headlineSmall as TextStyle, textAlign: TextAlign.center, colors: [ - Colors.purple, + Colors.red, Colors.blue, Colors.yellow, Colors.red, ]), ]), - SizedBox(height: 30.h), + SizedBox(height: 30.sp), SizedBox( - width: 100.w, + width: 100.sp, child: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: Colors.red), onPressed: () { if (Get.isDialogOpen!) Get.back(); }, diff --git a/lib/config/theme/light_theme_colors.dart b/lib/config/theme/light_theme_colors.dart index 63b6056..baa2833 100755 --- a/lib/config/theme/light_theme_colors.dart +++ b/lib/config/theme/light_theme_colors.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class LightThemeColors { //dark swatch - static const Color primaryColor = Colors.deepOrangeAccent; + static const Color primaryColor = Color(0xFF40A76A); static const Color accentColor = Color(0xFFD9EDE1); //APPBAR diff --git a/lib/config/theme/my_fonts.dart b/lib/config/theme/my_fonts.dart index 2299fd8..58154fc 100755 --- a/lib/config/theme/my_fonts.dart +++ b/lib/config/theme/my_fonts.dart @@ -29,8 +29,9 @@ class MyFonts { static double get appBarTittleSize => 18.sp; // body font size - static double get body1TextSize => 13.sp; + static double get body1TextSize => 15.sp; static double get body2TextSize => 13.sp; + static double get body3TextSize => 10.sp; // headlines font size static double get headline1TextSize => 50.sp; diff --git a/lib/config/theme/my_styles.dart b/lib/config/theme/my_styles.dart index b63cf02..701740d 100755 --- a/lib/config/theme/my_styles.dart +++ b/lib/config/theme/my_styles.dart @@ -47,6 +47,11 @@ class MyStyles { color: isLightTheme ? LightThemeColors.bodyTextColor : DarkThemeColors.bodyTextColor), + bodySmall: (MyFonts.bodyTextStyle).copyWith( + fontSize: MyFonts.body3TextSize, + color: isLightTheme + ? LightThemeColors.bodyTextColor + : DarkThemeColors.bodyTextColor), displayLarge: (MyFonts.headlineTextStyle).copyWith( fontSize: MyFonts.headline1TextSize, fontWeight: FontWeight.bold, @@ -83,11 +88,6 @@ class MyStyles { color: isLightTheme ? LightThemeColors.headlinesTextColor : DarkThemeColors.headlinesTextColor), - bodySmall: TextStyle( - color: isLightTheme - ? LightThemeColors.captionTextColor - : DarkThemeColors.captionTextColor, - fontSize: MyFonts.captionTextSize), ); static ChipThemeData getChipTheme({required bool isLightTheme}) { diff --git a/lib/config/translations/ar_AR/ar_ar_translation.dart b/lib/config/translations/ar_AR/ar_ar_translation.dart index 5ca4916..5cda6cb 100755 --- a/lib/config/translations/ar_AR/ar_ar_translation.dart +++ b/lib/config/translations/ar_AR/ar_ar_translation.dart @@ -17,7 +17,7 @@ final Map arAR = { /// Strings.changeTheme: 'تغيير الثيم', Strings.changeLanguage: 'تغيير اللغة', - Strings.oops: "أُووبس!", + Strings.ohNo: "أوه لا...", Strings.okay: "تمام", Strings.refresh: "ينعش!", Strings.empty: "فارغة أو لا توجد بيانات!", diff --git a/lib/config/translations/en_US/en_us_translation.dart b/lib/config/translations/en_US/en_us_translation.dart index 7de1a3d..0baa224 100755 --- a/lib/config/translations/en_US/en_us_translation.dart +++ b/lib/config/translations/en_US/en_us_translation.dart @@ -17,7 +17,7 @@ const Map enUs = { /// Strings.changeTheme: 'Change theme', Strings.changeLanguage: 'Change language', - Strings.oops: "Oops!", + Strings.ohNo: "Oh, no...", Strings.okay: "Okay", Strings.refresh: "refresh!", Strings.empty: "Empty or No data!", diff --git a/lib/config/translations/strings_enum.dart b/lib/config/translations/strings_enum.dart index 0b5b90e..062d6fb 100755 --- a/lib/config/translations/strings_enum.dart +++ b/lib/config/translations/strings_enum.dart @@ -15,7 +15,7 @@ class Strings { /// static const String changeTheme = 'change_theme'; static const String changeLanguage = 'change_language'; - static const String oops = "Oops!"; + static const String ohNo = "Oh, no..."; static const String okay = "Okay"; static const String refresh = "refresh!"; static const String empty = "Empty or No data!"; diff --git a/lib/main.dart b/lib/main.dart index 58e4326..0616682 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:getx_standard/app/data/local/my_hive.dart'; +import 'package:getx_standard/app/data/local/hive/hive_adapters.dart'; import 'app/data/local/my_shared_pref.dart'; -import 'app/modules/example/home-with-restAPI/model/recipes_model.dart'; import 'app/routes/app_pages.dart'; import 'config/theme/my_theme.dart'; import 'config/translations/localization_service.dart'; @@ -18,26 +17,7 @@ Future main() async { ); // init hive and adapters - await MyHive.init(registerAdapters: (hive) { - hive.registerAdapter(RecipesAdapter()); - hive.registerAdapter(ResultsAdapter()); - hive.registerAdapter(TotalTimeTierAdapter()); - hive.registerAdapter(ShowAdapter()); - hive.registerAdapter(SectionsAdapter()); - hive.registerAdapter(ComponentsAdapter()); - hive.registerAdapter(MeasurementsAdapter()); - hive.registerAdapter(UnitAdapter()); - hive.registerAdapter(IngredientAdapter()); - hive.registerAdapter(CompilationsAdapter()); - hive.registerAdapter(TagsAdapter()); - hive.registerAdapter(RenditionsAdapter()); - hive.registerAdapter(NutritionAdapter()); - hive.registerAdapter(PriceAdapter()); - hive.registerAdapter(TopicsAdapter()); - hive.registerAdapter(UserRatingsAdapter()); - hive.registerAdapter(InstructionsAdapter()); - hive.registerAdapter(CreditsAdapter()); - }); + await HiveAdapters.registerAll(); // Device info // DeviceInfoHelper.initializeDeviceInfo(); @@ -74,7 +54,7 @@ Future main() async { ); }, - initialRoute: AppPages.ONBOARDING, + initialRoute: AppPages.NAV, // first screen to show when app is running defaultTransition: Transition.circularReveal, From 008bd7ff83f7032f73c0715fc206f04033ab565e Mon Sep 17 00:00:00 2001 From: Moktadir Date: Wed, 27 Sep 2023 14:49:24 +0600 Subject: [PATCH 5/5] done --- ios/Podfile.lock | 82 +++++++++--------- .../global-widgets/custom_snackbar.dart | 4 +- .../controllers/home_controller.dart | 41 ++++----- pubspec.lock | 86 +++++++++---------- pubspec.yaml | 16 ++-- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 7 files changed, 119 insertions(+), 114 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index c6087a5..95d4356 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -634,8 +634,8 @@ PODS: - BoringSSL-GRPC/Implementation (0.0.24): - BoringSSL-GRPC/Interface (= 0.0.24) - BoringSSL-GRPC/Interface (0.0.24) - - cloud_firestore (4.9.1): - - Firebase/Firestore (= 10.12.0) + - cloud_firestore (4.9.2): + - Firebase/Firestore (= 10.15.0) - firebase_core - Flutter - nanopb (< 2.30910.0, >= 2.30908.0) @@ -678,42 +678,43 @@ PODS: - file_picker (0.0.1): - DKImagePickerController/PhotoGallery - Flutter - - Firebase/Auth (10.12.0): + - Firebase/Auth (10.15.0): - Firebase/CoreOnly - - FirebaseAuth (~> 10.12.0) - - Firebase/CoreOnly (10.12.0): - - FirebaseCore (= 10.12.0) - - Firebase/Firestore (10.12.0): + - FirebaseAuth (~> 10.15.0) + - Firebase/CoreOnly (10.15.0): + - FirebaseCore (= 10.15.0) + - Firebase/Firestore (10.15.0): - Firebase/CoreOnly - - FirebaseFirestore (~> 10.12.0) - - Firebase/Messaging (10.12.0): + - FirebaseFirestore (~> 10.15.0) + - Firebase/Messaging (10.15.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 10.12.0) - - firebase_auth (4.9.0): - - Firebase/Auth (= 10.12.0) + - FirebaseMessaging (~> 10.15.0) + - firebase_auth (4.10.0): + - Firebase/Auth (= 10.15.0) - firebase_core - Flutter - - firebase_core (2.15.1): - - Firebase/CoreOnly (= 10.12.0) + - firebase_core (2.16.0): + - Firebase/CoreOnly (= 10.15.0) - Flutter - - firebase_messaging (14.6.7): - - Firebase/Messaging (= 10.12.0) + - firebase_messaging (14.6.8): + - Firebase/Messaging (= 10.15.0) - firebase_core - Flutter - - FirebaseAppCheckInterop (10.13.0) - - FirebaseAuth (10.12.0): + - FirebaseAppCheckInterop (10.15.0) + - FirebaseAuth (10.15.0): - FirebaseAppCheckInterop (~> 10.0) - FirebaseCore (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/Environment (~> 7.8) - GTMSessionFetcher/Core (< 4.0, >= 2.1) - - FirebaseCore (10.12.0): + - RecaptchaInterop (~> 100.0) + - FirebaseCore (10.15.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreInternal (10.13.0): + - FirebaseCoreInternal (10.15.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseFirestore (10.12.0): + - FirebaseFirestore (10.15.0): - abseil/algorithm (~> 1.20220623.0) - abseil/base (~> 1.20220623.0) - abseil/container/flat_hash_map (~> 1.20220623.0) @@ -726,12 +727,12 @@ PODS: - "gRPC-C++ (~> 1.50.1)" - leveldb-library (~> 1.22) - nanopb (< 2.30910.0, >= 2.30908.0) - - FirebaseInstallations (10.13.0): + - FirebaseInstallations (10.15.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.12.0): + - FirebaseMessaging (10.15.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.2) @@ -847,9 +848,10 @@ PODS: - FlutterMacOS - PromisesObjC (2.3.1) - ReachabilitySwift (5.0.0) - - SDWebImage (5.17.0): - - SDWebImage/Core (= 5.17.0) - - SDWebImage/Core (5.17.0) + - RecaptchaInterop (100.0.0) + - SDWebImage (5.18.2): + - SDWebImage/Core (= 5.18.2) + - SDWebImage/Core (5.18.2) - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS @@ -900,6 +902,7 @@ SPEC REPOS: - nanopb - PromisesObjC - ReachabilitySwift + - RecaptchaInterop - SDWebImage - SwiftyGif - TOCropViewController @@ -939,23 +942,23 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: abseil: 926fb7a82dc6d2b8e1f2ed7f3a718bce691d1e46 BoringSSL-GRPC: 3175b25143e648463a56daeaaa499c6cb86dad33 - cloud_firestore: 85d66b543b25130c45258412a39e851e230186e7 + cloud_firestore: ac000d8c5a79d57dc69238ea06bb422880fb825e connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 file_picker: ce3938a0df3cc1ef404671531facef740d03f920 - Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0 - firebase_auth: 097a2440d40bed75f4dfe4cb91b4d98349509b47 - firebase_core: 4a3246a02f828a01c74a2c26427037786d90f17f - firebase_messaging: 0b4f7997f491343b90d9300af54fe55c72135833 - FirebaseAppCheckInterop: 5e12dc623d443dedffcde9c6f3ed41510125d8ef - FirebaseAuth: a66c1e14ec58f41d154a4b41ce1a23ea00ad4805 - FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed - FirebaseCoreInternal: b342e37cd4f5b4454ec34308f073420e7920858e - FirebaseFirestore: f94c9541515fa4a49af52269bbc50349009424b4 - FirebaseInstallations: b28af1b9f997f1a799efe818c94695a3728c352f - FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316 + Firebase: 66043bd4579e5b73811f96829c694c7af8d67435 + firebase_auth: ca31bca59224dc727ea0df7f066f30158a8acc3b + firebase_core: 77172d0a9d8d19d07606e24406e4c2fc14d3265b + firebase_messaging: 6aff54d420b7ce7080c26dd131b08bc632666852 + FirebaseAppCheckInterop: a8c555b1c2db1d9445e6c3a08a848167ddb7eb51 + FirebaseAuth: a55ec5f7f8a5b1c2dd750235c1bb419bfb642445 + FirebaseCore: 2cec518b43635f96afe7ac3a9c513e47558abd2e + FirebaseCoreInternal: 2f4bee5ed00301b5e56da0849268797a2dd31fb4 + FirebaseFirestore: b4c0eaaf24efda5732ec21d9e6c788d083118ca6 + FirebaseInstallations: cae95cab0f965ce05b805189de1d4c70b11c76fb + FirebaseMessaging: 0c0ae1eb722ef0c07f7801e5ded8dccd1357d6d4 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef @@ -972,7 +975,8 @@ SPEC CHECKSUMS: path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9 + RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 + SDWebImage: c0de394d7cf7f9838aed1fd6bb6037654a4572e4 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f diff --git a/lib/app/components/global-widgets/custom_snackbar.dart b/lib/app/components/global-widgets/custom_snackbar.dart index 37584f1..068c3bf 100755 --- a/lib/app/components/global-widgets/custom_snackbar.dart +++ b/lib/app/components/global-widgets/custom_snackbar.dart @@ -50,7 +50,7 @@ class CustomSnackBar { onTap: (snack) { Get.closeAllSnackbars(); }, - //overlayBlur: 0.8, + overlayBlur: 0.8, message: message, ); } @@ -68,7 +68,7 @@ class CustomSnackBar { onTap: (snack) { Get.closeAllSnackbars(); }, - // overlayBlur: 0.8, + overlayBlur: 0.8, message: message, ); } diff --git a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart index 88f6c17..57f8e2a 100755 --- a/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart +++ b/lib/app/modules/example/home-with-restAPI/controllers/home_controller.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/cupertino.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -23,17 +25,25 @@ class HomeController extends GetxController with ExceptionHandler { final recipes = RxList(); scrollPositionTracker() { + Timer? debounce; + scrollController.addListener(() { - if (scrollController.position.pixels > - scrollController.position.minScrollExtent + 5) { - bottomPadding.value = 18.sp; - // position in Top - } - if (scrollController.position.pixels >= - scrollController.position.maxScrollExtent) { - bottomPadding.value = 130.sp; - // position in Bottom + if (debounce != null && debounce!.isActive) { + debounce!.cancel(); } + + debounce = Timer(const Duration(milliseconds: 200), () { + if (scrollController.position.pixels > + scrollController.position.minScrollExtent + 5) { + bottomPadding.value = 18.sp; + // position in Top + } + if (scrollController.position.pixels >= + scrollController.position.maxScrollExtent) { + bottomPadding.value = 130.sp; + // position in Bottom + } + }); }); } @@ -80,25 +90,12 @@ class HomeController extends GetxController with ExceptionHandler { @override void onReady() async { await getRecipes(); - // scrollController.addListener(() { - // if (scrollController.position.atEdge) { - // bool isTop = scrollController.position.pixels == 0; - // if (isTop) { - // bottomPadding.value = 18.sp; - // print('At the top'); - // } else { - // bottomPadding.value = 50.sp; - // print('At the bottom'); - // } - // } - // }); super.onReady(); } @override void onInit() { super.onInit(); - scrollPositionTracker(); } diff --git a/pubspec.lock b/pubspec.lock index d32eae4..dab0f39 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" + sha256: "2d8e8e123ca3675625917f535fcc0d3a50092eef44334168f9b18adc050d4c6e" url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.6" analyzer: dependency: transitive description: @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: archive - sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e + sha256: "20071638cbe4e5964a427cfa0e86dce55d060bc7d82d56f3554095d7239a8765" url: "https://pub.dev" source: hosted - version: "3.3.9" + version: "3.4.2" args: dependency: transitive description: @@ -125,10 +125,10 @@ packages: dependency: transitive description: name: built_value - sha256: ff627b645b28fb8bdb69e645f910c2458fd6b65f6585c3a53e0626024897dedf + sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74 url: "https://pub.dev" source: hosted - version: "8.6.2" + version: "8.6.3" cached_network_image: dependency: "direct main" description: @@ -205,26 +205,26 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: "0ff0baec167e308df192398dbd81ec13c1799635885c6aa6ed9ab8b5ed61f52c" + sha256: "50e1ffa143fc5c49db1800392f8d9524fd015f9d26a9e4fc01b5ddb1e603e01b" url: "https://pub.dev" source: hosted - version: "4.9.1" + version: "4.9.2" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: "5749b81aea93afdce220e02d34369162010d210011054ac494b2c38c4e9ebeb7" + sha256: "150e603a40d52b3199e46b1e38d9f8ef8c2dee9e1fb2122d58d456c50015bf7c" url: "https://pub.dev" source: hosted - version: "5.16.0" + version: "5.16.1" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: fef99ad0599e983092adb1bb01f14a596dba601a7a8efaaffd7b2721d64e2c51 + sha256: f033aef13b13f94b0f361898df39307d8710859c8912626cfb08e439e350bd66 url: "https://pub.dev" source: hosted - version: "3.7.0" + version: "3.7.1" code_builder: dependency: transitive description: @@ -333,10 +333,10 @@ packages: dependency: "direct main" description: name: dio - sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 + sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7" url: "https://pub.dev" source: hosted - version: "5.3.2" + version: "5.3.3" expandable_text: dependency: "direct main" description: @@ -389,10 +389,10 @@ packages: dependency: transitive description: name: file_selector_macos - sha256: "182c3f8350cee659f7b115e956047ee3dc672a96665883a545e81581b9a82c72" + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 url: "https://pub.dev" source: hosted - version: "0.9.3+2" + version: "0.9.3+3" file_selector_platform_interface: dependency: transitive description: @@ -413,34 +413,34 @@ packages: dependency: "direct main" description: name: firebase_auth - sha256: "6d9be853426ab686d68076b8007ac29b2c31e7d549444a45b5c3fe1abc249fb0" + sha256: e7b7e2a08888cb8ef073a9b6d4df9039ea0ff07c920d4258fb4886c55fe2dbb6 url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.10.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "2946cfdc17f925fa9771dd0ba3ce9dd2d019100a8685d0557c161f7786ea9b14" + sha256: "4862bd649268e32ebd685a58abe1eb7ef13aef3f668ce9c56a7d283c971ec6ff" url: "https://pub.dev" source: hosted - version: "6.18.0" + version: "6.19.0" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: d8972d754702a3f4881184706b8056e2837d0dae91613a43b988c960b8e0d988 + sha256: "090d531cc0dcf1e39edc0d64cffa18ccc5745b1fd1081a13ee1bf42d861ff764" url: "https://pub.dev" source: hosted - version: "5.8.0" + version: "5.8.1" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: c78132175edda4bc532a71e01a32964e4b4fcf53de7853a422d96dac3725f389 + sha256: "675c209c94a1817649137cbd113fc4c9ae85e48d03dd578629abbec6d8a4d93d" url: "https://pub.dev" source: hosted - version: "2.15.1" + version: "2.16.0" firebase_core_platform_interface: dependency: transitive description: @@ -453,34 +453,34 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973" + sha256: e8c408923cd3a25bd342c576a114f2126769cd1a57106a4edeaa67ea4a84e962 url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.8.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: "6c1a2a047d6f165b7c5f947467ac5138731a2af82c7af1c12d691dbb834f6b73" + sha256: "4544524c22de3ffdc7e0ffaeeba212a04d09e76d0549ae6f42ce285d9d8f0513" url: "https://pub.dev" source: hosted - version: "14.6.7" + version: "14.6.8" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: bcba58d28f8cda607a323240c6d314c2c62b62ebfbb0f2d704ebefef07b52b5f + sha256: a6e1fae8242a14d5d8f5ab1cf94693511f06bab49ff1d46e3d83c0af3c4becb8 url: "https://pub.dev" source: hosted - version: "4.5.6" + version: "4.5.7" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "962d09ec9dfa486cbbc218258ad41e8ec7997a2eba46919049496e1cafd960c5" + sha256: a9fe837dc2dcdd3e32e6109a6b0ce62592d7a44cb8f69cb5b73190865c5aa28e url: "https://pub.dev" source: hosted - version: "3.5.6" + version: "3.5.7" fixnum: dependency: transitive description: @@ -780,10 +780,10 @@ packages: dependency: transitive description: name: image - sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf + sha256: "6e703d5e2f8c63fb31a77753915c1ec8baebde8088844e0d29f71b8f0b108888" url: "https://pub.dev" source: hosted - version: "4.0.17" + version: "4.1.0" image_cropper: dependency: "direct main" description: @@ -820,10 +820,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "47da2161c2e9f8f8a9cbbd89d466d174333fbdd769aeed848912e0b16d9cb369" + sha256: "0c7b83bbe2980c8a8e36e974f055e11e51675784e13a4762889feed0f3937ff2" url: "https://pub.dev" source: hosted - version: "0.8.8" + version: "0.8.8+1" image_picker_for_web: dependency: transitive description: @@ -924,10 +924,10 @@ packages: dependency: "direct main" description: name: logger - sha256: ba3bc83117b2b49bdd723c0ea7848e8285a0fbc597ba09203b20d329d020c24a + sha256: "6bbb9d6f7056729537a4309bda2e74e18e5d9f14302489cc1e93f33b3fe32cac" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.2+1" logging: dependency: transitive description: @@ -1385,18 +1385,18 @@ packages: dependency: transitive description: name: win32 - sha256: "9e82a402b7f3d518fb9c02d0e9ae45952df31b9bf34d77baf19da2de03fc2aaa" + sha256: c97defd418eef4ec88c0d1652cdce84b9f7b63dd7198e266d06ac1710d527067 url: "https://pub.dev" source: hosted - version: "5.0.7" + version: "5.0.8" win32_registry: dependency: transitive description: name: win32_registry - sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9 + sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" xdg_directories: dependency: transitive description: @@ -1422,5 +1422,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.1.2 <4.0.0" flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index 7c160d2..fb362eb 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,10 +4,10 @@ description: A GetX Architecture by Mir Moktadir. publish_to: 'none' -version: 1.4.9+34 +version: 1.5.0+35 environment: - sdk: '>=3.0.5 <4.0.0' + sdk: '>=3.1.2 <4.0.0' dependencies: @@ -18,9 +18,9 @@ dependencies: cupertino_icons: ^1.0.6 get: ^4.6.6 - logger: ^2.0.2 + logger: ^2.0.2+1 flutter_screenutil: ^5.9.0 - dio: ^5.3.2 + dio: ^5.3.3 http: ^1.1.0 shared_preferences: ^2.2.1 change_app_package_name: ^1.1.0 @@ -33,10 +33,10 @@ dependencies: flutter_otp_text_field: ^1.1.1 flutter_launcher_icons: ^0.13.1 flutter_native_splash: ^2.3.2 - firebase_core: ^2.15.1 - firebase_auth: ^4.9.0 - cloud_firestore: ^4.9.1 - firebase_messaging: ^14.6.7 + firebase_core: ^2.16.0 + firebase_auth: ^4.10.0 + cloud_firestore: ^4.9.2 + firebase_messaging: ^14.6.8 carousel_slider: ^4.2.1 cached_network_image: ^3.2.3 graphql_flutter: ^5.1.2 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8449340..9c18557 100755 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -8,6 +8,7 @@ #include #include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { @@ -15,6 +16,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); + FirebaseAuthPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index d2b3aa1..ff3081d 100755 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -5,6 +5,7 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus file_selector_windows + firebase_auth firebase_core )