mirror of
https://github.com/foss42/apidash.git
synced 2025-12-08 05:59:15 +08:00
refactor collection provider
This commit is contained in:
@@ -97,9 +97,7 @@ class URLTextField extends ConsumerWidget {
|
||||
.update(selectedId, url: value);
|
||||
},
|
||||
onFieldSubmitted: (value) {
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.sendRequest(selectedId);
|
||||
ref.read(collectionStateNotifierProvider.notifier).sendRequest();
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -114,7 +112,7 @@ class SendRequestButton extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final selectedId = ref.watch(selectedIdStateProvider);
|
||||
ref.watch(selectedIdStateProvider);
|
||||
final isWorking = ref.watch(
|
||||
selectedRequestModelProvider.select((value) => value?.isWorking));
|
||||
|
||||
@@ -122,14 +120,10 @@ class SendRequestButton extends ConsumerWidget {
|
||||
isWorking: isWorking ?? false,
|
||||
onTap: () {
|
||||
onTap?.call();
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.sendRequest(selectedId!);
|
||||
ref.read(collectionStateNotifierProvider.notifier).sendRequest();
|
||||
},
|
||||
onCancel: () {
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.cancelRequest(selectedId!);
|
||||
ref.read(collectionStateNotifierProvider.notifier).cancelRequest();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user