fix activeId provider

- read -> watch
- added length back
This commit is contained in:
DenserMeerkat
2023-10-20 18:49:52 +05:30
parent 1deafdc41a
commit 3edac6988b
2 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,9 @@ class EditRequestHeadersState extends ConsumerState<EditRequestHeaders> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final activeId = ref.read(activeIdStateProvider); final activeId = ref.watch(activeIdStateProvider);
final length = ref.watch(activeRequestModelProvider
.select((value) => value?.requestHeaders?.length));
var rH = ref.read(activeRequestModelProvider)?.requestHeaders; var rH = ref.read(activeRequestModelProvider)?.requestHeaders;
rows = (rH == null || rH.isEmpty) rows = (rH == null || rH.isEmpty)
? [ ? [

View File

@ -55,9 +55,7 @@ class _HeaderFieldState extends State<HeaderField> {
suggestionsCallback: headerSuggestionCallback, suggestionsCallback: headerSuggestionCallback,
suggestionsBoxDecoration: suggestionBoxDecorations(context), suggestionsBoxDecoration: suggestionBoxDecorations(context),
textFieldConfiguration: TextFieldConfiguration( textFieldConfiguration: TextFieldConfiguration(
onChanged: (s) { onChanged: widget.onChanged,
widget.onChanged?.call(s);
},
controller: controller, controller: controller,
style: kCodeStyle.copyWith( style: kCodeStyle.copyWith(
color: colorScheme.onSurface, color: colorScheme.onSurface,