✨ Features: - Create household with 6-character shareable code - Join existing household with code - View household members and owner - Leave household functionality - Automatic inventory filtering by household - Persistent household settings across app updates 🔧 Technical changes: - Added Household model with Hive adapter (typeId: 4) - Updated AppSettings with userName and currentHouseholdId fields - Modified InventoryRepository to filter items by household - Updated Add Item screen to set householdId on new items - Added HouseholdScreen with full CRUD operations - Integrated household sharing into Settings navigation 🎯 Behavior: - Users not in a household see only their personal items - Users in a household see shared household items - New items automatically tagged with current household 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
805 B
Dart
38 lines
805 B
Dart
import 'package:hive/hive.dart';
|
|
|
|
part 'app_settings.g.dart';
|
|
|
|
@HiveType(typeId: 3)
|
|
class AppSettings extends HiveObject {
|
|
@HiveField(0)
|
|
String? discordWebhookUrl;
|
|
|
|
@HiveField(1)
|
|
bool expirationAlertsEnabled;
|
|
|
|
@HiveField(2)
|
|
bool discordNotificationsEnabled;
|
|
|
|
@HiveField(3)
|
|
String defaultView; // 'grid' or 'list'
|
|
|
|
@HiveField(4)
|
|
String sortBy; // 'expiration', 'name', 'location'
|
|
|
|
@HiveField(5)
|
|
String? userName; // User's name for household sharing
|
|
|
|
@HiveField(6)
|
|
String? currentHouseholdId; // ID of the household they're in
|
|
|
|
AppSettings({
|
|
this.discordWebhookUrl,
|
|
this.expirationAlertsEnabled = true,
|
|
this.discordNotificationsEnabled = false,
|
|
this.defaultView = 'grid',
|
|
this.sortBy = 'expiration',
|
|
this.userName,
|
|
this.currentHouseholdId,
|
|
});
|
|
}
|