50e4f43738
Implement company AI onboarding/recommendation models, services, repository, and tender UI integration with supporting tests. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
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 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 MultiProvider(
|
|
providers: [
|
|
ChangeNotifierProvider(
|
|
create:
|
|
(context) => TendersViewModel(
|
|
tendersRepository: context.read<TendersRepository>(),
|
|
),
|
|
),
|
|
ChangeNotifierProvider(
|
|
create:
|
|
(context) => AiRecommendationsViewModel(
|
|
companyAiRepository: context.read<CompanyAiRepository>(),
|
|
homeRepository: context.read<HomeRepository>(),
|
|
),
|
|
),
|
|
],
|
|
child: child,
|
|
);
|
|
}
|