Initial commit for complete UI
This commit is contained in:
53
lib/models/shop_model.dart
Normal file
53
lib/models/shop_model.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
import 'package:hive/hive.dart';
|
||||
|
||||
part 'shop_model.g.dart';
|
||||
|
||||
@HiveType(typeId: 1)
|
||||
class ShopModel {
|
||||
@HiveField(0)
|
||||
final String id;
|
||||
|
||||
@HiveField(1)
|
||||
final String image;
|
||||
|
||||
@HiveField(2)
|
||||
final String mobile;
|
||||
|
||||
@HiveField(3)
|
||||
final String email;
|
||||
|
||||
@HiveField(4)
|
||||
final String shopName;
|
||||
|
||||
@HiveField(5)
|
||||
final String address; // ✅ NEW
|
||||
|
||||
ShopModel({
|
||||
required this.id,
|
||||
required this.image,
|
||||
required this.mobile,
|
||||
required this.email,
|
||||
required this.shopName,
|
||||
required this.address,
|
||||
});
|
||||
|
||||
factory ShopModel.fromJson(Map<String, dynamic> json) {
|
||||
return ShopModel(
|
||||
id: json['id'] ?? '',
|
||||
image: json['image'] ?? '',
|
||||
mobile: json['mobile'] ?? '',
|
||||
email: json['email'] ?? '',
|
||||
shopName: json['shopName'] ?? '',
|
||||
address: json['address'] ?? '', // ✅ NEW
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'image': image,
|
||||
'mobile': mobile,
|
||||
'email': email,
|
||||
'shopName': shopName,
|
||||
'address': address, // ✅ NEW
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user