File tree Expand file tree Collapse file tree 3 files changed +27
-18
lines changed
screens/home_page/editor_pane Expand file tree Collapse file tree 3 files changed +27
-18
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ class ResponsePane extends ConsumerWidget {
9
9
10
10
@override
11
11
Widget build (BuildContext context, WidgetRef ref) {
12
+ final isWorking = ref.watch (
13
+ selectedRequestModelProvider.select ((value) => value? .isWorking)) ??
14
+ false ;
12
15
final responseStatus = ref.watch (
13
16
selectedRequestModelProvider.select ((value) => value? .responseStatus));
14
- final isWorking = ref.watch (selectedRequestModelProvider)? .isWorking;
15
17
final message = ref
16
18
.watch (selectedRequestModelProvider.select ((value) => value? .message));
17
- if (isWorking == true ) {
19
+ if (isWorking) {
18
20
return const SendingWidget ();
19
21
}
20
22
if (responseStatus == null ) {
Original file line number Diff line number Diff line change @@ -93,10 +93,11 @@ class SendButton extends ConsumerWidget {
93
93
@override
94
94
Widget build (BuildContext context, WidgetRef ref) {
95
95
final selectedId = ref.watch (selectedIdStateProvider);
96
- final isWorking = ref.watch (selectedRequestModelProvider)? .isWorking;
96
+ final isWorking = ref.watch (
97
+ selectedRequestModelProvider.select ((value) => value? .isWorking));
97
98
98
99
return SendRequestButton (
99
- isWorking: isWorking,
100
+ isWorking: isWorking ?? false ,
100
101
onTap: () {
101
102
ref
102
103
.read (collectionStateNotifierProvider.notifier)
Original file line number Diff line number Diff line change @@ -51,27 +51,33 @@ class SendRequestButton extends StatelessWidget {
51
51
required this .onTap,
52
52
});
53
53
54
- final bool ? isWorking;
54
+ final bool isWorking;
55
55
final void Function () onTap;
56
56
57
57
@override
58
58
Widget build (BuildContext context) {
59
59
return FilledButton (
60
- onPressed: isWorking == true ? null : onTap,
60
+ onPressed: isWorking ? null : onTap,
61
61
child: Row (
62
62
mainAxisSize: MainAxisSize .min,
63
- children: [
64
- Text (
65
- isWorking == true ? kLabelSending : kLabelSend,
66
- style: kTextStyleButton,
67
- ),
68
- if (isWorking == false ) kHSpacer10,
69
- if (isWorking == false )
70
- const Icon (
71
- size: 16 ,
72
- Icons .send,
73
- ),
74
- ],
63
+ children: isWorking
64
+ ? const [
65
+ Text (
66
+ kLabelSending,
67
+ style: kTextStyleButton,
68
+ ),
69
+ ]
70
+ : const [
71
+ Text (
72
+ kLabelSend,
73
+ style: kTextStyleButton,
74
+ ),
75
+ kHSpacer10,
76
+ Icon (
77
+ size: 16 ,
78
+ Icons .send,
79
+ ),
80
+ ],
75
81
),
76
82
);
77
83
}
You can’t perform that action at this time.
0 commit comments