Add household sharing feature
✨ 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>
This commit is contained in:
@@ -6,6 +6,7 @@ import '../models/app_settings.dart';
|
||||
import '../../notifications/services/discord_service.dart';
|
||||
import 'privacy_policy_screen.dart';
|
||||
import 'terms_of_service_screen.dart';
|
||||
import 'household_screen.dart';
|
||||
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({super.key});
|
||||
@@ -91,6 +92,29 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
|
||||
const Divider(),
|
||||
|
||||
// Sharing Section
|
||||
_buildSectionHeader('Sharing'),
|
||||
ListTile(
|
||||
title: const Text('Household Sharing'),
|
||||
subtitle: Text(_settings!.currentHouseholdId != null
|
||||
? 'Connected to household'
|
||||
: 'Share inventory with family'),
|
||||
leading: const Icon(Icons.group, color: AppColors.primary),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const HouseholdScreen(),
|
||||
),
|
||||
);
|
||||
// Reload settings after returning from household screen
|
||||
_loadSettings();
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// Display Section
|
||||
_buildSectionHeader('Display'),
|
||||
ListTile(
|
||||
|
Reference in New Issue
Block a user