2024-10-22 13:52:57 +04:00
|
|
|
import 'package:flutter_android_app/domain/models/card.dart';
|
|
|
|
import 'package:flutter_android_app/repositories/api_interface.dart';
|
|
|
|
|
2024-12-15 23:23:00 +04:00
|
|
|
import '../components/locale/l10n/app_localizations.dart';
|
2024-12-12 00:08:22 +04:00
|
|
|
import '../components/utils/error_callback.dart';
|
|
|
|
import '../domain/models/home.dart';
|
|
|
|
|
2024-10-22 13:52:57 +04:00
|
|
|
class MockRepository extends ApiInterface {
|
|
|
|
@override
|
2024-12-15 23:23:00 +04:00
|
|
|
Future<HomeData?> loadData({
|
|
|
|
OnErrorCallback? onError,
|
|
|
|
String? search,
|
|
|
|
int page = 1,
|
|
|
|
int pageSize = 20,
|
|
|
|
AppLocale? locale,
|
|
|
|
}) async {
|
2024-12-12 00:08:22 +04:00
|
|
|
return HomeData(data: [
|
2024-10-22 13:52:57 +04:00
|
|
|
CardData(
|
2024-12-15 23:23:00 +04:00
|
|
|
id: 'bitcoin',
|
|
|
|
title: 'Bitcoin',
|
|
|
|
imageUrl: 'https://coin-images.coingecko.com/coins/images/1/large/bitcoin.png?1696501400',
|
|
|
|
currentPrice: '103233 \$',
|
|
|
|
priceChange: '+2207.71 \$ for the last 24 hours',
|
2024-10-22 13:52:57 +04:00
|
|
|
),
|
|
|
|
CardData(
|
2024-12-15 23:23:00 +04:00
|
|
|
id: 'ethereum',
|
|
|
|
title: 'Ethereum',
|
|
|
|
imageUrl: 'https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628',
|
|
|
|
currentPrice: '3900.92 \$',
|
|
|
|
priceChange: '+58.27 \$ for the last 24 hours',
|
2024-10-22 13:52:57 +04:00
|
|
|
),
|
|
|
|
CardData(
|
2024-12-15 23:23:00 +04:00
|
|
|
id: 'tether',
|
|
|
|
title: 'Tether',
|
|
|
|
imageUrl: 'https://coin-images.coingecko.com/coins/images/325/large/Tether.png?1696501661',
|
|
|
|
currentPrice: '1.001 \$',
|
|
|
|
priceChange: '+0.00059798 \$ for the last 24 hours',
|
2024-10-22 13:52:57 +04:00
|
|
|
),
|
2024-12-12 00:08:22 +04:00
|
|
|
]);
|
2024-10-22 13:52:57 +04:00
|
|
|
}
|
2024-12-17 12:10:42 +04:00
|
|
|
|
|
|
|
@override
|
|
|
|
Future<HomeData?> loadDataWithIds({
|
|
|
|
OnErrorCallback? onError,
|
|
|
|
List<String> ids = const [],
|
|
|
|
int page = 1,
|
|
|
|
int pageSize = 20,
|
|
|
|
AppLocale? locale,
|
|
|
|
}) async {
|
|
|
|
return HomeData(data: [
|
|
|
|
CardData(
|
|
|
|
id: 'bitcoin',
|
|
|
|
title: 'Bitcoin',
|
|
|
|
imageUrl: 'https://coin-images.coingecko.com/coins/images/1/large/bitcoin.png?1696501400',
|
|
|
|
currentPrice: '103233 \$',
|
|
|
|
priceChange: '+2207.71 \$ for the last 24 hours',
|
|
|
|
),
|
|
|
|
CardData(
|
|
|
|
id: 'ethereum',
|
|
|
|
title: 'Ethereum',
|
|
|
|
imageUrl: 'https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628',
|
|
|
|
currentPrice: '3900.92 \$',
|
|
|
|
priceChange: '+58.27 \$ for the last 24 hours',
|
|
|
|
),
|
|
|
|
CardData(
|
|
|
|
id: 'tether',
|
|
|
|
title: 'Tether',
|
|
|
|
imageUrl: 'https://coin-images.coingecko.com/coins/images/325/large/Tether.png?1696501661',
|
|
|
|
currentPrice: '1.001 \$',
|
|
|
|
priceChange: '+0.00059798 \$ for the last 24 hours',
|
|
|
|
),
|
|
|
|
]);
|
|
|
|
}
|
2024-10-22 13:52:57 +04:00
|
|
|
}
|