observer fix

This commit is contained in:
fosse 2023-09-07 12:10:17 -04:00
parent bda4684f50
commit 278ea2fc77
2 changed files with 4 additions and 8 deletions

View file

@ -34,17 +34,15 @@ class ManageNodesPage extends BasePage {
SizedBox(height: 20),
Observer(
builder: (BuildContext context) {
int nodesLength = nodeListViewModel.nodes.length;
return Flexible(
child: SectionStandardList(
sectionCount: 1,
dividerPadding: EdgeInsets.symmetric(horizontal: 24),
itemCounter: (int sectionIndex) {
return nodeListViewModel.nodes.length;
return nodesLength;
},
itemBuilder: (_, index) {
if (index > nodeListViewModel.nodes.length - 1) {
return SizedBox();
}
return Observer(
builder: (context) {
final node = nodeListViewModel.nodes[index];

View file

@ -34,19 +34,17 @@ class ManagePowNodesPage extends BasePage {
SizedBox(height: 20),
Observer(
builder: (BuildContext context) {
int nodesLength = nodeListViewModel.nodes.length;
return Flexible(
child: SectionStandardList(
sectionCount: 1,
dividerPadding: EdgeInsets.symmetric(horizontal: 24),
itemCounter: (int sectionIndex) {
return nodeListViewModel.nodes.length;
return nodesLength;
},
itemBuilder: (_, index) {
return Observer(
builder: (context) {
if (index > nodeListViewModel.nodes.length - 1) {
return SizedBox();
}
final node = nodeListViewModel.nodes[index];
final isSelected = node.keyIndex == nodeListViewModel.currentNode.keyIndex;
final nodeListRow = PowNodeListRow(