在protein=open(r"string.txt","r+")
def main():
rewrite()
def rewrite():
s = ""
nl = False
for line in protein.readlines():
if "<" in line:
if nl:
s += '\n'
nl = False
s += line
else:
s += line.replace('\n', '')
nl = True
print(s)
protein.close()
main()
中,我需要使用元素创建const A = [];
const B = [];
const C = A.map((item, index) => ({
ID: item.ID,
balance: item.balance - B[index].total,
total: item.total - B[index].total
}))
}
,但我不知道该怎么做。
MouseMotionListener listener = new MouseMotionAdapter() {
@Override
public void mouseMoved(MouseEvent me) {
me = SwingUtilities.convertMouseEvent(
me.getComponent(), me, frame);
System.out.println("Mouse Move");
xyMouseLabel.x = me.getX();
xyMouseLabel.y = me.getY();
xyMouseLabel.repaint();
}
};
menu.addMouseMotionListener(listener);
for (Component child : menu.getComponents()) {
child.addMouseMotionListener(listener);
}
我需要用FutureBuilder
之类的东西来代替Wrap
。
答案 0 :(得分:2)
使用
Wrap(
children: snapshot.data.map((item) => Text(item.category)).toList().cast<Widget>(),
)