小编Şan*_*baş的帖子

在 Flutter 中以间隔自动获取 Api 数据

在我的颤振应用程序中,我试图显示更新数据。我成功地手动从天气 api 获取数据。但我需要每 5 秒不断地抓取数据。所以它应该自动更新。这是我在 Flutter 中的代码:

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Sakarya Hava',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Sakarya Hava'),
        ),
        body: Center(
          child: FutureBuilder<SakaryaAir>(
            future: getSakaryaAir(), //sets the getSakaryaAir method as the expected Future
            builder: (context, snapshot) {
              if (snapshot.hasData) { //checks if the response returns valid data
                return Center(
                  child: Column(
                    children: <Widget>[
                      Text("${snapshot.data.temp}"), //displays the temperature
                      SizedBox(
                        height: 10.0,
                      ),
                      Text(" - ${snapshot.data.humidity}"), …
Run Code Online (Sandbox Code Playgroud)

api time json dart flutter

10
推荐指数
2
解决办法
7120
查看次数

根据Python中的日期解析字符串

我有一个字符串:

05-01-2015 12:27 - KH - (KH)Igangværende - Opringning - 13-11 00:00 FangedeRLıpåhansmobil.Ring igen kl.15 19-11-2014 11:17 - KH - (KH)Igangværende - Opringning - 13-11 00:00Gikpåsvarerigen og lagt besked to RLI at ringe tilbage.12-11-2014 09:38 - KH - (KH)Igangværende - Opringning - 13-11 00:00 12-11-2014 09:32 - KH - (KH)Igangværende - Opringning - 15-10 00:00ForsøgtRLI igen og lagt besked om han vil ringe.14-10-2014 13:14 - KH - (KH)Igangværende - Opringning - 15-10 00:00 14-10-2014 13:10 - KH - (KH)Igangværende - …

python regex string parsing date

2
推荐指数
1
解决办法
62
查看次数

标签 统计

api ×1

dart ×1

date ×1

flutter ×1

json ×1

parsing ×1

python ×1

regex ×1

string ×1

time ×1