start implement generator code

This commit is contained in:
Sergey Penkovsky
2025-05-16 09:30:30 +03:00
parent 9b0741199c
commit b906e927c3
29 changed files with 535 additions and 102 deletions

View File

@@ -1,16 +1,19 @@
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
import 'package:flutter/material.dart';
import 'package:cherrypick_flutter/cherrypick_flutter.dart';
import 'use_case.dart';
part 'my_home_page.cherrypick_injectable.g.dart';
@Injectable()
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
late final UseCase useCase;
// ignore: prefer_const_constructors_in_immutables
MyHomePage({super.key});
@override
Widget build(BuildContext context) {
// Разрешение зависимости UseCase из рутового скоупа
final UseCase useCase =
CherryPickProvider.of(context).openRootScope().resolve<UseCase>();
//_inject(context); // Make sure this function is called in context
return Scaffold(
appBar: AppBar(
title: const Text('Example App'),