小编kir*_*oud的帖子

在Flutter中使DataTable双向滚动

如何使DataTable双向滚动。我使数据表水平滚动,但是列表很大,无法向下滚动。

@override 
Widget build(BuildContext context) { 
    return Scaffold(
      appBar: AppBar(title: Text("Bills Receivable"),),
      body:SingleChildScrollView( 
        scrollDirection: Axis.horizontal, 
        child:
           DataTable(
          columns: <DataColumn>[
            DataColumn(label:Text("BNm",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BDt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BPrty",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BdueDt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("Dys",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BAmt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BPAmt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BBAmt",style: TextStyle(fontWeight: FontWeight.bold),))
          ], rows:  widget.rdata.bRecDtl.map((e)=>
            DataRow(
              cells:<DataCell>[
                DataCell(Text(e.bNm.toString())),
                DataCell(Text(e.bDt.toString())),
                DataCell(Text(e.bPrty.toString())),
                DataCell(Text(e.bdueDt.toString())),
                DataCell(Text(e.dys.toString())), 
                DataCell(Text(e.bAmt.toString())),
                DataCell(Text(e.bPAmt.toString())),
                DataCell(Text(e.bBAmt.toString())),
          ])).toList()
        ),
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

5
推荐指数
3
解决办法
1405
查看次数

指定的时区无效:美国/阿拉斯加、美国/亚利桑那、美国/山区、美国/中部等 Chrome 中的错误但在 Mozilla 中工作

我试图将时间戳转换为不同时区的本地时间,发现某些 TimeZone 在 Chrome (v76.0.38) 中不支持,但在 Mozilla (v68.0.2) 中工作正常。

  let d = new Date(1567083463);
  let n = d.toLocaleString('en-GB', { timeZone: "US/Arizona" });
  
Run Code Online (Sandbox Code Playgroud)

未捕获的 RangeError:指定的时区无效:美国/亚利桑那州

在 Date.toLocaleString()

其他几个时区也抛出同样的错误

US/Alaska US/Mountain US/Central US/East-Indiana

这些时区得到官方支持,如其网站 Chrome Supported Time Zone Values 中所述

javascript timezone google-chrome ecmascript-intl

4
推荐指数
1
解决办法
5889
查看次数