Skip to content

Commit 6972ca8

Browse files
committed
fixes
1 parent 3331d2a commit 6972ca8

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

lib/screens/home_page/editor_pane/details_card/response_pane.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ class ResponsePane extends ConsumerWidget {
99

1010
@override
1111
Widget build(BuildContext context, WidgetRef ref) {
12+
final isWorking = ref.watch(
13+
selectedRequestModelProvider.select((value) => value?.isWorking)) ??
14+
false;
1215
final responseStatus = ref.watch(
1316
selectedRequestModelProvider.select((value) => value?.responseStatus));
14-
final isWorking = ref.watch(selectedRequestModelProvider)?.isWorking;
1517
final message = ref
1618
.watch(selectedRequestModelProvider.select((value) => value?.message));
17-
if (isWorking == true) {
19+
if (isWorking) {
1820
return const SendingWidget();
1921
}
2022
if (responseStatus == null) {

lib/screens/home_page/editor_pane/url_card.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ class SendButton extends ConsumerWidget {
9393
@override
9494
Widget build(BuildContext context, WidgetRef ref) {
9595
final selectedId = ref.watch(selectedIdStateProvider);
96-
final isWorking = ref.watch(selectedRequestModelProvider)?.isWorking;
96+
final isWorking = ref.watch(
97+
selectedRequestModelProvider.select((value) => value?.isWorking));
9798

9899
return SendRequestButton(
99-
isWorking: isWorking,
100+
isWorking: isWorking ?? false,
100101
onTap: () {
101102
ref
102103
.read(collectionStateNotifierProvider.notifier)

lib/widgets/buttons.dart

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,33 @@ class SendRequestButton extends StatelessWidget {
5151
required this.onTap,
5252
});
5353

54-
final bool? isWorking;
54+
final bool isWorking;
5555
final void Function() onTap;
5656

5757
@override
5858
Widget build(BuildContext context) {
5959
return FilledButton(
60-
onPressed: isWorking == true ? null : onTap,
60+
onPressed: isWorking ? null : onTap,
6161
child: Row(
6262
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+
],
7581
),
7682
);
7783
}

0 commit comments

Comments
 (0)