feat: add AI recommendations flow for tenders
Implement company AI onboarding/recommendation models, services, repository, and tender UI integration with supporting tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../data/repositories/auth_repository.dart';
|
||||
import '../../data/repositories/company_ai_repository.dart';
|
||||
import '../../data/repositories/profile_repository.dart';
|
||||
import '../../view_models/profile_view_model.dart';
|
||||
|
||||
@@ -13,6 +14,7 @@ Widget profileProvider({required Widget child}) {
|
||||
(context) => ProfileViewModel(
|
||||
profileRepository: context.read<ProfileRepository>(),
|
||||
authRepository: context.read<AuthRepository>(),
|
||||
companyAiRepository: context.read<CompanyAiRepository>(),
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../data/repositories/company_ai_repository.dart';
|
||||
import '../../data/repositories/home_repository.dart';
|
||||
import '../../data/repositories/tenders_repository.dart';
|
||||
import '../../view_models/ai_recommendations_view_model.dart';
|
||||
import '../../view_models/tenders_view_model.dart';
|
||||
|
||||
/// Lazy TendersViewModel provider
|
||||
/// Wraps screens that need TendersViewModel
|
||||
/// Lazy providers for the tenders section.
|
||||
///
|
||||
/// Provides [TendersViewModel] (the "All" tab) and [AiRecommendationsViewModel]
|
||||
/// (the "Recommended" AI tab) to screens that need them.
|
||||
Widget tendersProvider({required Widget child}) {
|
||||
return ChangeNotifierProvider(
|
||||
create:
|
||||
(context) => TendersViewModel(
|
||||
tendersRepository: context.read<TendersRepository>(),
|
||||
),
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create:
|
||||
(context) => TendersViewModel(
|
||||
tendersRepository: context.read<TendersRepository>(),
|
||||
),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create:
|
||||
(context) => AiRecommendationsViewModel(
|
||||
companyAiRepository: context.read<CompanyAiRepository>(),
|
||||
homeRepository: context.read<HomeRepository>(),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user