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

27 lines
655 B
Dart
Raw Normal View History

2025-05-16 09:30:30 +03:00
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
2025-05-14 13:41:31 +03:00
import 'package:flutter/material.dart';
import 'use_case.dart';
2025-05-16 09:30:30 +03:00
part 'my_home_page.cherrypick_injectable.g.dart';
@Injectable()
2025-05-14 13:41:31 +03:00
class MyHomePage extends StatelessWidget {
2025-05-16 09:30:30 +03:00
late final UseCase useCase;
// ignore: prefer_const_constructors_in_immutables
MyHomePage({super.key});
2025-05-16 17:57:40 +03:00
2025-05-14 13:41:31 +03:00
@override
Widget build(BuildContext context) {
2025-05-16 09:30:30 +03:00
//_inject(context); // Make sure this function is called in context
2025-05-14 13:41:31 +03:00
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()),
),
);
}
}