Skip to content

Commit

Permalink
refactor: extract ArticlesService out of the caller method
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Jun 9, 2024
1 parent 17a6c07 commit 5e3537e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/alice_chopper/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MyApp extends StatefulWidget {

class _MyAppState extends State<MyApp> {
final AliceChopperAdapter _aliceChopperAdapter = AliceChopperAdapter();

late final Alice _alice = Alice(
showNotification: true,
showInspectorOnShake: true,
Expand All @@ -40,10 +41,10 @@ class _MyAppState extends State<MyApp> {
converter: converter,
);

Future<void> _runChopperHttpRequests() async {
final ArticlesService articlesService =
_chopper.getService<ArticlesService>();
late final ArticlesService articlesService =
_chopper.getService<ArticlesService>();

Future<void> _runChopperHttpRequests() async {
final Article article = Article(
title: 'foo',
body: 'bar',
Expand Down

0 comments on commit 5e3537e

Please sign in to comment.