File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed
features/counter/presentation/edit/view Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,12 @@ class App extends StatefulWidget {
1919 }
2020 }
2121
22- CounterRepository counterRepository =
23- CounterRepository (counterApi: CounterFakeApi ());
22+ CounterRepository counterRepository = CounterRepository (counterApi: CounterFakeApi ());
2423
2524 @override
2625 State <App > createState () => AppState ();
2726
28- static AppState of (BuildContext context) =>
29- context.findAncestorStateOfType <AppState >()! ;
27+ static AppState of (BuildContext context) => context.findAncestorStateOfType <AppState >()! ;
3028}
3129
3230class AppState extends State <App > {
Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ class CounterView extends StatelessWidget {
4949 appBar: AppBar (
5050 title: BlocBuilder <EditCounterBloc , EditCounterState >(
5151 builder: (context, state) {
52- return state is EditCounterData
53- ? Text (state.counterModel.name)
54- : const Text ('' );
52+ return state is EditCounterData ? Text (state.counterModel.name) : const Text ('' );
5553 },
5654 ),
5755 ),
@@ -105,15 +103,13 @@ class CounterView extends StatelessWidget {
105103 CustomCircularButton (
106104 icon: Icons .remove,
107105 onPressed: state is EditCounterData
108- ? () => editCounterBloc
109- .add (CounterDecrementPressed (state.counterModel))
106+ ? () => editCounterBloc.add (CounterDecrementPressed (state.counterModel))
110107 : null ,
111108 ),
112109 CustomCircularButton (
113110 icon: Icons .add,
114111 onPressed: state is EditCounterData
115- ? () => editCounterBloc
116- .add (CounterIncrementPressed (state.counterModel))
112+ ? () => editCounterBloc.add (CounterIncrementPressed (state.counterModel))
117113 : null ,
118114 ),
119115 ],
Original file line number Diff line number Diff line change @@ -2,14 +2,16 @@ import 'package:convenient_test/convenient_test.dart';
22import 'package:flutter/material.dart' ;
33
44class CounterText extends StatelessWidget {
5- const CounterText (
6- {super .key, required this .counterValue, required this .counterName});
5+ const CounterText ({
6+ super .key,
7+ required this .counterValue,
8+ required this .counterName,
9+ });
710 final int counterValue;
811 final String counterName;
912
1013 @override
1114 Widget build (BuildContext context) {
12- print ('counter_text_$counterName ' );
1315 final theme = Theme .of (context);
1416 return Mark (
1517 name: 'counter_text_$counterName ' ,
You can’t perform that action at this time.
0 commit comments