如何在使用 Flutter 构建的世界时间应用程序上显示位置和时间

问题描述

import pandas as pd

df = pd.read_html('https://www.pivotTrading.co.in/beta/tools/open-high-low-scanner.PHP?broker=zerodha')[0]
df.drop(columns={'Sr.No.'},inplace=True)
df.iloc[-1,0:4] = ''
df.fillna(0,inplace=True)
df

这是我在 Flutter 上构建世界时间应用程序的代码

输出上没有看到错误消息,但选择新城市或位置时,它仅在设备上显示设备上的时间,而不显示屏幕上显示的当前时间的相应城市。请问我怎样才能在不炸毁我的代码的情况下解决这个问题。谢谢

解决方法

在您按下的平面按钮上,您已将位置键设置为“结果”,将其更改为“位置”。

FlatButton.icon(
              onPressed: () async {
                dynamic result =
                    await Navigator.pushNamed(context,'/location');
                setState(() {
                  data = {
                    'time': result['time'],// Change This
                  >>>  'result': result['location'],<<<
                      // To This
                  >>>  'location': result['location'],<<<
                    'isDaytime': result['isDaytime'],'flag': result['flag'],};
                });
              },