mirror of
https://github.com/Dvorinka/1356.git
synced 2026-06-04 12:02:56 +00:00
37ffb93923
Version: 1.1.0 Major changes: - Implemented complete Flutter app structure with all core features - Added comprehensive UI screens for auth, countdown, goals, profile, settings, and social features - Integrated Supabase backend with authentication and data repositories - Added offline support with Hive caching and local storage - Implemented comprehensive routing with go_router - Added location services with Google Maps integration - Implemented notifications and home widget support - Added voice recording capabilities and AI chat features - Created comprehensive test suite and documentation - Added Android and iOS platform configurations - Implemented achievements system and social features - Added calendar integration and bucket list functionality This represents a complete Phase 1 milestone with 3,775 additions across 31 files.
139 lines
3.5 KiB
Dart
139 lines
3.5 KiB
Dart
import 'package:lifetimer/data/models/user_model.dart';
|
|
import 'package:lifetimer/data/models/goal_model.dart';
|
|
import 'package:lifetimer/data/models/goal_step_model.dart';
|
|
import 'package:lifetimer/data/models/activity_model.dart';
|
|
|
|
/// Helper class to create test data
|
|
class TestData {
|
|
/// Create a test user
|
|
static User createTestUser({
|
|
String id = 'test-user-id',
|
|
String username = 'testuser',
|
|
String email = 'test@example.com',
|
|
String? avatarUrl,
|
|
String? bio,
|
|
bool isPublicProfile = false,
|
|
DateTime? countdownStartDate,
|
|
DateTime? countdownEndDate,
|
|
}) {
|
|
return User(
|
|
id: id,
|
|
username: username,
|
|
email: email,
|
|
avatarUrl: avatarUrl,
|
|
bio: bio,
|
|
isPublicProfile: isPublicProfile,
|
|
countdownStartDate: countdownStartDate,
|
|
countdownEndDate: countdownEndDate,
|
|
createdAt: DateTime.now().subtract(const Duration(days: 30)),
|
|
updatedAt: DateTime.now(),
|
|
);
|
|
}
|
|
|
|
/// Create a test goal
|
|
static Goal createTestGoal({
|
|
String id = 'test-goal-id',
|
|
String ownerId = 'test-user-id',
|
|
String title = 'Test Goal',
|
|
String? description,
|
|
int progress = 0,
|
|
double? locationLat,
|
|
double? locationLng,
|
|
String? locationName,
|
|
String? imageUrl,
|
|
bool completed = false,
|
|
}) {
|
|
return Goal(
|
|
id: id,
|
|
ownerId: ownerId,
|
|
title: title,
|
|
description: description,
|
|
progress: progress,
|
|
locationLat: locationLat,
|
|
locationLng: locationLng,
|
|
locationName: locationName,
|
|
imageUrl: imageUrl,
|
|
completed: completed,
|
|
createdAt: DateTime.now().subtract(const Duration(days: 10)),
|
|
updatedAt: DateTime.now(),
|
|
);
|
|
}
|
|
|
|
/// Create a test goal step
|
|
static GoalStep createTestGoalStep({
|
|
String id = 'test-step-id',
|
|
String goalId = 'test-goal-id',
|
|
String title = 'Test Step',
|
|
bool isDone = false,
|
|
int orderIndex = 0,
|
|
}) {
|
|
return GoalStep(
|
|
id: id,
|
|
goalId: goalId,
|
|
title: title,
|
|
isDone: isDone,
|
|
orderIndex: orderIndex,
|
|
createdAt: DateTime.now(),
|
|
);
|
|
}
|
|
|
|
/// Create a test activity
|
|
static Activity createTestActivity({
|
|
String id = 'test-activity-id',
|
|
String userId = 'test-user-id',
|
|
String type = 'goal_created',
|
|
Map<String, dynamic>? payload,
|
|
}) {
|
|
return Activity(
|
|
id: id,
|
|
userId: userId,
|
|
type: type,
|
|
payload: payload,
|
|
createdAt: DateTime.now(),
|
|
);
|
|
}
|
|
|
|
/// Create a list of test goals
|
|
static List<Goal> createTestGoalsList({int count = 5}) {
|
|
return List.generate(
|
|
count,
|
|
(index) => createTestGoal(
|
|
id: 'goal-$index',
|
|
title: 'Test Goal $index',
|
|
progress: index * 20,
|
|
completed: index == count - 1,
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Create a list of test goal steps
|
|
static List<GoalStep> createTestStepsList({
|
|
required String goalId,
|
|
int count = 3,
|
|
}) {
|
|
return List.generate(
|
|
count,
|
|
(index) => createTestGoalStep(
|
|
id: 'step-$index',
|
|
goalId: goalId,
|
|
title: 'Step $index',
|
|
isDone: index < count ~/ 2,
|
|
orderIndex: index,
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Create a list of test activities
|
|
static List<Activity> createTestActivitiesList({int count = 5}) {
|
|
final types = ['goal_created', 'goal_completed', 'countdown_started'];
|
|
return List.generate(
|
|
count,
|
|
(index) => createTestActivity(
|
|
id: 'activity-$index',
|
|
type: types[index % types.length],
|
|
payload: {'goal_id': 'goal-$index'},
|
|
),
|
|
);
|
|
}
|
|
}
|