pmu_flutter/lec5/lib/data/repository/mock_repository.dart

33 lines
1.1 KiB
Dart
Raw Normal View History

2024-10-11 19:12:12 +04:00
import 'package:flutter/material.dart';
import 'package:test_app/data/repository/api_interface.dart';
import 'package:test_app/domain/card.dart';
import 'package:test_app/domain/home.dart';
class MockRepository extends ApiInterface {
@override
Future<HomeData?> loadData() async {
return HomeData(data: [
CardData(
'Hello',
descriptionText: 'Hello text',
imageUrl:
'https://unsplash.com/photos/6GMq7AGxNbE/download?ixid=M3wxMjA3fDB8MXxzZWFyY2h8Mnx8cmFjY29vbnxlbnwwfHx8fDE3Mjc5MTExNTl8MA&force=true&w=640',
),
CardData(
'Hello 2',
descriptionText: 'Hello 2 text',
icon: Icons.add,
imageUrl:
'https://unsplash.com/photos/UopR2NUBYek/download?ixid=M3wxMjA3fDB8MXxzZWFyY2h8MTF8fHJhY2Nvb258ZW58MHx8fHwxNzI3OTExMTU5fDA&force=true&w=640',
),
CardData(
'Hello 3',
descriptionText: 'Hello 3 text',
icon: Icons.add,
imageUrl:
'https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Raccoon_on_Log.jpg/640px-Raccoon_on_Log.jpg',
),
]);
}
}