Files
cherrypick/examples/client_app/lib/my_home_page.dart

24 lines
630 B
Dart
Raw Normal View History

2025-05-14 13:41:31 +03:00
import 'package:flutter/material.dart';
import 'package:cherrypick_flutter/cherrypick_flutter.dart';
import 'use_case.dart';
class MyHomePage extends StatelessWidget {
2025-05-16 17:57:40 +03:00
const MyHomePage({super.key});
2025-05-14 13:41:31 +03:00
@override
Widget build(BuildContext context) {
// Разрешение зависимости UseCase из рутового скоупа
final UseCase useCase =
CherryPickProvider.of(context).openRootScope().resolve<UseCase>();
return Scaffold(
appBar: AppBar(
2025-05-16 17:57:40 +03:00
title: const Text('Example App'),
2025-05-14 13:41:31 +03:00
),
body: Center(
child: Text(useCase.fetchData()),
),
);
}
}