first
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
/// In-memory sample catalog used when the app is offline or in mock mode.
|
||||
library;
|
||||
|
||||
import '../models/item.dart';
|
||||
|
||||
/// Static starter data so the UI is useful without a network.
|
||||
abstract final class FakeItemData {
|
||||
static final List<Item> items = [
|
||||
Item(
|
||||
id: 'local-1',
|
||||
title: 'Material 3 surfaces',
|
||||
subtitle: 'Use tonal layers instead of heavy drop shadows.',
|
||||
description:
|
||||
'Material 3 prefers surface tints and short, soft shadows. Keep cards '
|
||||
'on surfaceContainerLow, bump the hero to surfaceContainerHighest, and '
|
||||
'reserve elevation for sheets and dialogs.',
|
||||
category: ItemCategory.design,
|
||||
createdAt: DateTime(2026, 4, 12),
|
||||
),
|
||||
Item(
|
||||
id: 'local-2',
|
||||
title: 'Provider at the root',
|
||||
subtitle: 'Lift shared state above the widget that consumes it.',
|
||||
description:
|
||||
'Wrap MaterialApp with MultiProvider so ThemeController and '
|
||||
'ItemController survive route changes. Keep UI widgets dumb: they '
|
||||
'read context.watch and call controller methods.',
|
||||
category: ItemCategory.development,
|
||||
createdAt: DateTime(2026, 5, 3),
|
||||
),
|
||||
Item(
|
||||
id: 'local-3',
|
||||
title: 'Focus on one task',
|
||||
subtitle: 'A short list beats an overflowing dashboard.',
|
||||
description:
|
||||
'The home screen shows a greeting, a compact stat strip, and a '
|
||||
'ListView.builder of items. Extra tools live one tap away on Search, '
|
||||
'Profile, and Settings.',
|
||||
category: ItemCategory.productivity,
|
||||
createdAt: DateTime(2026, 6, 18),
|
||||
),
|
||||
Item(
|
||||
id: 'local-4',
|
||||
title: 'Breathable spacing',
|
||||
subtitle: '16–24px padding and 12px gaps keep cards from crowding.',
|
||||
description:
|
||||
'On compact phones use 16px page padding. From 600px up, step to 24px '
|
||||
'and cap the content width so lines stay readable on tablets.',
|
||||
category: ItemCategory.lifestyle,
|
||||
createdAt: DateTime(2026, 7, 1),
|
||||
),
|
||||
Item(
|
||||
id: 'local-5',
|
||||
title: 'Hero transitions',
|
||||
subtitle: 'Match a tag on the list tile and the detail header.',
|
||||
description:
|
||||
'Wrap the leading glyph in a Hero with a stable tag derived from the '
|
||||
'item id. The detail screen reuses the same widget so Flutter can '
|
||||
'animate size and position.',
|
||||
category: ItemCategory.design,
|
||||
createdAt: DateTime(2026, 7, 22),
|
||||
),
|
||||
Item(
|
||||
id: 'local-6',
|
||||
title: 'Mock first, HTTP later',
|
||||
subtitle: 'A repository hides whether data is fake or remote.',
|
||||
description:
|
||||
'ItemRepository serves FakeItemData by default and can switch to '
|
||||
'ItemApi (http + JSONPlaceholder) from Settings. Failures fall back '
|
||||
'to the mock list so the UI never goes empty on a demo device.',
|
||||
category: ItemCategory.development,
|
||||
createdAt: DateTime(2026, 8, 4),
|
||||
),
|
||||
Item(
|
||||
id: 'local-7',
|
||||
title: 'Capture ideas quickly',
|
||||
subtitle: 'The add-item form validates before it writes.',
|
||||
description:
|
||||
'Title, summary, and description each have a length rule. Category is '
|
||||
'a required dropdown. On success the new item is inserted at the top '
|
||||
'of ItemController so Home and Search update immediately.',
|
||||
category: ItemCategory.productivity,
|
||||
createdAt: DateTime(2026, 8, 15),
|
||||
),
|
||||
Item(
|
||||
id: 'local-8',
|
||||
title: 'Light and dark equally',
|
||||
subtitle: 'Seeded ColorSchemes keep contrast in both modes.',
|
||||
description:
|
||||
'ThemeController persists ThemeMode in shared_preferences. The '
|
||||
'settings screen offers System, Light, and Dark. Both schemes come '
|
||||
'from the same teal seed color.',
|
||||
category: ItemCategory.lifestyle,
|
||||
createdAt: DateTime(2026, 8, 20),
|
||||
),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user