proxibuy/lib/data/models/datasources/offer_data_source.dart

363 lines
14 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// import 'package:proxibuy/data/models/comment_model.dart';
// import 'package:proxibuy/data/models/discount_info_model.dart';
// import 'package:proxibuy/data/models/offer_model.dart';
// import 'package:proxibuy/data/models/working_hours.dart';
// abstract class OfferDataSource {
// Future<List<OfferModel>> getNearbyOffers();
// Future<OfferModel?> getOfferById(String id);
// }
// class MockOfferDataSource implements OfferDataSource {
// final List<OfferModel> _mockOffers = [
// OfferModel(
// id: '1',
// storeName: 'روچیک (Ruchik)',
// title: 'چیزبرگر',
// discount: '۲۰٪',
// imageUrls: [
// 'https://picsum.photos/seed/food/400/200',
// 'https://picsum.photos/seed/burger1/400/400',
// 'https://picsum.photos/seed/burger2/400/400',
// ],
// category: 'فست‌فود',
// distanceInMeters: 130,
// expiryTime: DateTime.now().add(const Duration(hours: 2, minutes: 30, seconds: 10)),
// rating: 4.8,
// workingHours: [
// WorkingHours(
// day: 'شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'یکشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'دوشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'سه‌شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'چهارشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'پنج‌شنبه',
// shifts: [
// Shift(openAt: '۱۰ صبح', closeAt: '۱ ظهر'),
// Shift(openAt: '۵ عصر', closeAt: '۱۱ شب'),
// ],
// ),
// WorkingHours(day: 'جمعه', shifts: []),
// ],
// discountType: 'رفیق‌بازی',
// isOpen: false,
// address: 'چهارباغ پایین ',
// ratingCount: 340,
// latitude: 32.660,
// longitude: 51.670,
// originalPrice: 150000,
// finalPrice: 120000,
// features: [
// "تهیه شده از بهترین و تازه‌ترین مواد اولیه",
// "محیطی دنج و مناسب برای قرارهای دوستانه",
// "دارای منوی متنوع برای تمام سلیقه‌ها",
// ],
// discountInfo: const DiscountInfoModel(
// name: "رفیق‌بازی",
// description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیق‌تو بیار و تخفیف‌تو ببر. دوستای بیشتر، تخفیف بیشتر.",
// ),
// comments: [
// CommentModel(
// id: 'c1',
// userName: 'سارا رضایی',
// rating: 4.5,
// comment: 'کیفیت برگر عالی بود و محیط خیلی خوبی داشت. حتما دوباره سر می‌زنم!',
// publishedAt: DateTime.now().subtract(const Duration(days: 2)),
// uploadedImageUrls: [
// 'https://picsum.photos/seed/user_img1/200/200',
// 'https://picsum.photos/seed/user_img2/200/200',
// ]
// ),
// CommentModel(
// id: 'c2',
// userName: 'pbuser_157',
// rating: 4,
// comment: 'جای خوب و دنجی بود، فقط یکم شلوغ بود که طبیعیه. در کل راضی بودم.',
// publishedAt: DateTime.now().subtract(const Duration(days: 5)),
// ),
// ],
// qrCodeData: 'PROXIBUY-OFFER-ID-1',
// ),
// OfferModel(
// id: '2',
// storeName: 'کاخ سرهنگ',
// title: 'عصرانه',
// discount: '۲۰% ',
// imageUrls: [
// 'https://picsum.photos/seed/food/400/200',
// 'https://picsum.photos/seed/burger1/400/400',
// 'https://picsum.photos/seed/burger2/400/400',
// ],
// category: 'رستوران',
// distanceInMeters: 130,
// expiryTime: DateTime.now().add(const Duration(hours: 5)),
// rating: 4.8,
// workingHours: [
// WorkingHours(
// day: 'شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'یکشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'دوشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'سه‌شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'چهارشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'پنج‌شنبه',
// shifts: [
// Shift(openAt: '۱۰ صبح', closeAt: '۱ ظهر'),
// Shift(openAt: '۵ عصر', closeAt: '۱۱ شب'),
// ],
// ),
// WorkingHours(day: 'جمعه', shifts: []),
// ],
// discountType: 'رفیق‌بازی',
// isOpen: true,
// address: 'چهارباغ پایین ',
// ratingCount: 340,
// latitude: 32.660,
// longitude: 51.670,
// originalPrice: 150000,
// finalPrice: 120000,
// features: [
// "تهیه شده از بهترین و تازه‌ترین مواد اولیه",
// "محیطی دنج و مناسب برای قرارهای دوستانه",
// "دارای منوی متنوع برای تمام سلیقه‌ها",
// ],
// discountInfo: const DiscountInfoModel(
// name: "رفیق‌بازی",
// description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیق‌تو بیار و تخفیف‌تو ببر. دوستای بیشتر، تخفیف بیشتر.",
// ),
// comments: [
// CommentModel(
// id: 'c1',
// userName: 'سارا رضایی',
// rating: 4.5,
// comment: 'کیفیت برگر عالی بود و محیط خیلی خوبی داشت. حتما دوباره سر می‌زنم!',
// publishedAt: DateTime.now().subtract(const Duration(days: 2)),
// uploadedImageUrls: [
// 'https://picsum.photos/seed/user_img1/200/200',
// 'https://picsum.photos/seed/user_img2/200/200',
// ]
// ),
// CommentModel(
// id: 'c2',
// userName: 'علی اکبری',
// rating: 4,
// comment: 'جای خوب و دنجی بود، فقط یکم شلوغ بود که طبیعیه. در کل راضی بودم.',
// publishedAt: DateTime.now().subtract(const Duration(days: 5)),
// ),
// ],
// qrCodeData: 'PROXIBUY-OFFER-ID-1',
// ),
// OfferModel(
// id: '3',
// storeName: 'روچیک (Ruchik)',
// title: 'چیزبرگر',
// discount: '۲۰٪',
// imageUrls: [
// 'https://picsum.photos/seed/food/ 400/200',
// 'https://picsum.photos/seed/burger1/400/400',
// 'https://picsum.photos/seed/burger2/400/400',
// ],
// category: 'فست‌فود',
// distanceInMeters: 130,
// expiryTime: DateTime.now().add(const Duration(hours: 5)),
// rating: 4.8,
// workingHours: [
// WorkingHours(
// day: 'شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'یکشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'دوشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'سه‌شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'چهارشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'پنج‌شنبه',
// shifts: [
// Shift(openAt: '۱۰ صبح', closeAt: '۱ ظهر'),
// Shift(openAt: '۵ عصر', closeAt: '۱۱ شب'),
// ],
// ),
// WorkingHours(day: 'جمعه', shifts: []),
// ],
// discountType: 'رفیق‌بازی',
// isOpen: true,
// address: 'چهارباغ پایین ',
// ratingCount: 340,
// latitude: 32.660,
// longitude: 51.670,
// originalPrice: 150000,
// finalPrice: 120000,
// features: [
// "تهیه شده از بهترین و تازه‌ترین مواد اولیه",
// "محیطی دنج و مناسب برای قرارهای دوستانه",
// "دارای منوی متنوع برای تمام سلیقه‌ها",
// ],
// discountInfo: const DiscountInfoModel(
// name: "رفیق‌بازی",
// description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیق‌تو بیار و تخفیف‌تو ببر. دوستای بیشتر، تخفیف بیشتر.",
// ),
// comments: [
// CommentModel(
// id: 'c1',
// userName: 'سارا رضایی',
// rating: 4.5,
// comment: 'کیفیت برگر عالی بود و محیط خیلی خوبی داشت. حتما دوباره سر می‌زنم!',
// publishedAt: DateTime.now().subtract(const Duration(days: 2)),
// uploadedImageUrls: [
// 'https://picsum.photos/seed/user_img1/200/200',
// 'https://picsum.photos/seed/user_img2/200/200',
// ]
// ),
// CommentModel(
// id: 'c2',
// userName: 'علی اکبری',
// rating: 4,
// comment: 'جای خوب و دنجی بود، فقط یکم شلوغ بود که طبیعیه. در کل راضی بودم.',
// publishedAt: DateTime.now().subtract(const Duration(days: 5)),
// ),
// ],
// qrCodeData: 'PROXIBUY-OFFER-ID-1',
// ),
// OfferModel(
// id: '4',
// storeName: 'روچیک (Ruchik)',
// title: 'چیزبرگر',
// discount: '۲۰٪',
// imageUrls: [
// 'https://picsum.photos/seed/food/400/200',
// 'https://picsum.photos/seed/burger1/400/400',
// 'https://picsum.photos/seed/burger2/400/400',
// ],
// category: 'فست‌فود',
// distanceInMeters: 130,
// expiryTime: DateTime.now().add(const Duration(hours: 5)),
// rating: 4.8,
// workingHours: [
// WorkingHours(
// day: 'شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'یکشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'دوشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'سه‌شنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'چهارشنبه',
// shifts: [Shift(openAt: '۱۰ صبح', closeAt: '۱۰ شب')],
// ),
// WorkingHours(
// day: 'پنج‌شنبه',
// shifts: [
// Shift(openAt: '۱۰ صبح', closeAt: '۱ ظهر'),
// Shift(openAt: '۵ عصر', closeAt: '۱۱ شب'),
// ],
// ),
// WorkingHours(day: 'جمعه', shifts: []),
// ],
// discountType: 'رفیق‌بازی',
// isOpen: false,
// address: 'چهارباغ پایین ',
// ratingCount: 340,
// latitude: 32.660,
// longitude: 51.670,
// originalPrice: 150000,
// finalPrice: 120000,
// features: [
// "تهیه شده از بهترین و تازه‌ترین مواد اولیه",
// "محیطی دنج و مناسب برای قرارهای دوستانه",
// "دارای منوی متنوع برای تمام سلیقه‌ها",
// ],
// discountInfo: const DiscountInfoModel(
// name: "رفیق‌بازی",
// description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیق‌تو بیار و تخفیف‌تو ببر. دوستای بیشتر، تخفیف بیشتر.",
// ),
// comments: [
// CommentModel(
// id: 'c1',
// userName: 'سارا رضایی',
// rating: 4.5,
// comment: 'کیفیت برگر عالی بود و محیط خیلی خوبی داشت. حتما دوباره سر می‌زنم!',
// publishedAt: DateTime.now().subtract(const Duration(days: 2)),
// uploadedImageUrls: [
// 'https://picsum.photos/seed/user_img1/200/200',
// 'https://picsum.photos/seed/user_img2/200/200',
// ]
// ),
// CommentModel(
// id: 'c2',
// userName: 'علی اکبری',
// rating: 4,
// comment: 'جای خوب و دنجی بود، فقط یکم شلوغ بود که طبیعیه. در کل راضی بودم.',
// publishedAt: DateTime.now().subtract(const Duration(days: 5)),
// ),
// ],
// qrCodeData: 'PROXIBUY-OFFER-ID-1',
// ),
// ];
// @override
// Future<List<OfferModel>> getNearbyOffers() async {
// await Future.delayed(const Duration(seconds: 1));
// return _mockOffers;
// }
// @override
// Future<OfferModel?> getOfferById(String id) async {
// await Future.delayed(const Duration(milliseconds: 300));
// try {
// return _mockOffers.firstWhere((offer) => offer.id == id);
// } catch (e) {
// return null;
// }
// }
// }