mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
Now the code generator supports specifying a custom output directory and extension/name template for generated DI files via build.yaml ( and ). This allows placing all generated code in custom folders and using flexible naming schemes. docs: update all user docs and tutorials to explain new output_dir/build_extensions config - Added detailed usage and YAML examples to cherrypick_generator/README.md - Synced full_tutorial_en.md and full_tutorial_ru.md (advanced codegen section) with explanation of new configuration and impact on imports - Updated quick_start_en.md and quick_start_ru.md to mention advanced customization and point to tutorials - Added troubleshooting and tips for custom output/imports in docs
36 lines
915 B
Dart
36 lines
915 B
Dart
import 'package:cherrypick/cherrypick.dart';
|
|
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import 'domain/repository/post_repository.dart';
|
|
import 'presentation/bloc/post_bloc.dart';
|
|
import 'router/app_router.dart';
|
|
|
|
part 'generated/app.inject.cherrypick.g.dart';
|
|
|
|
@injectable()
|
|
class MyApp extends StatelessWidget with _$MyApp {
|
|
final _appRouter = AppRouter();
|
|
|
|
@named('repo')
|
|
@inject()
|
|
late final PostRepository repository;
|
|
|
|
MyApp({super.key}) {
|
|
_inject(this);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocProvider(
|
|
create: (_) => PostBloc(repository),
|
|
child: MaterialApp.router(
|
|
routeInformationParser: _appRouter.defaultRouteParser(),
|
|
routerDelegate: _appRouter.delegate(),
|
|
theme: ThemeData.light(),
|
|
),
|
|
);
|
|
}
|
|
}
|