-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some bugs and new routing methode
- Loading branch information
1 parent
eb176f2
commit 6daff89
Showing
13 changed files
with
1,052 additions
and
181 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:healthy_buddy_mobile_app/models/sport_model/sport_exercise_model.dart'; | ||
import 'package:healthy_buddy_mobile_app/models/sport_model/sport_store_model.dart'; | ||
import 'package:healthy_buddy_mobile_app/services/sport_services/sport_exercise_service.dart'; | ||
import 'package:healthy_buddy_mobile_app/services/sport_services/sport_store_service.dart'; | ||
|
||
class SportStoreGeneralClass extends ChangeNotifier { | ||
List<SportStoreModel>? sportStore; | ||
getSport({required BuildContext context, required String category}) async { | ||
sportStore = | ||
(await getSportStorebyCategory(context: context, category: 'General')); | ||
notifyListeners(); | ||
} | ||
} | ||
|
||
class SportStoreSoccerClass extends ChangeNotifier { | ||
List<SportStoreModel>? sportStore; | ||
getSport({required BuildContext context, required String category}) async { | ||
sportStore = | ||
(await getSportStorebyCategory(context: context, category: 'Soccer')); | ||
notifyListeners(); | ||
} | ||
} | ||
|
||
class SportStoreAthleticClass extends ChangeNotifier { | ||
List<SportStoreModel>? sportStore; | ||
getSport({required BuildContext context, required String category}) async { | ||
sportStore = | ||
(await getSportStorebyCategory(context: context, category: 'Athletic')); | ||
notifyListeners(); | ||
} | ||
} | ||
|
||
class SportStoreBadmintonClass extends ChangeNotifier { | ||
List<SportStoreModel>? sportStore; | ||
getSport({required BuildContext context, required String category}) async { | ||
sportStore = | ||
(await getSportStorebyCategory(context: context, category: 'Badminton')); | ||
notifyListeners(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// To parse this JSON data, do | ||
// | ||
// final sportStoreModel = sportStoreModelFromJson(jsonString); | ||
|
||
import 'dart:convert'; | ||
|
||
List<SportStoreModel> sportStoreModelFromJson(String str) => List<SportStoreModel>.from(json.decode(str).map((x) => SportStoreModel.fromJson(x))); | ||
|
||
String sportStoreModelToJson(List<SportStoreModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); | ||
|
||
class SportStoreModel { | ||
SportStoreModel({ | ||
required this.id, | ||
required this.productName, | ||
required this.description, | ||
required this.gallery, | ||
required this.price, | ||
required this.review, | ||
required this.reviewerName, | ||
required this.merk, | ||
required this.category, | ||
}); | ||
|
||
int id; | ||
String productName; | ||
String description; | ||
List<String> gallery; | ||
int price; | ||
List<String> review; | ||
List<String> reviewerName; | ||
String merk; | ||
String category; | ||
|
||
factory SportStoreModel.fromJson(Map<String, dynamic> json) => SportStoreModel( | ||
id: json["id"], | ||
productName: json["product_name"], | ||
description: json["description"], | ||
gallery: List<String>.from(json["gallery"].map((x) => x)), | ||
price: json["price"], | ||
review: List<String>.from(json["review"].map((x) => x)), | ||
reviewerName: List<String>.from(json["reviewer_name"].map((x) => x)), | ||
merk: json["merk"], | ||
category: json["category"], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
"id": id, | ||
"product_name": productName, | ||
"description": description, | ||
"gallery": List<dynamic>.from(gallery.map((x) => x)), | ||
"price": price, | ||
"review": List<dynamic>.from(review.map((x) => x)), | ||
"reviewer_name": List<dynamic>.from(reviewerName.map((x) => x)), | ||
"merk": merk, | ||
"category": category, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.