39 lines
807 B
Dart
39 lines
807 B
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
class MemoryItemModel {
|
||
|
|
final String id;
|
||
|
|
final IconData icon;
|
||
|
|
final String title;
|
||
|
|
final String subtitle;
|
||
|
|
|
||
|
|
MemoryItemModel({
|
||
|
|
required this.id,
|
||
|
|
required this.icon,
|
||
|
|
required this.title,
|
||
|
|
required this.subtitle,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
class MockMemoryService {
|
||
|
|
static final MockMemoryService _instance = MockMemoryService._internal();
|
||
|
|
factory MockMemoryService() => _instance;
|
||
|
|
|
||
|
|
final List<MemoryItemModel> _items = [];
|
||
|
|
|
||
|
|
MockMemoryService._internal();
|
||
|
|
|
||
|
|
List<MemoryItemModel> get items => List.unmodifiable(_items);
|
||
|
|
|
||
|
|
List<MemoryItemModel> fetchMemoryItems() {
|
||
|
|
return items;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
class MemoryService {
|
||
|
|
final MockMemoryService _mock = MockMemoryService();
|
||
|
|
|
||
|
|
List<MemoryItemModel> getMemoryItems() {
|
||
|
|
return _mock.fetchMemoryItems();
|
||
|
|
}
|
||
|
|
}
|