小编Nbn*_*Nbn的帖子

断言失败:第 549 行 pos 12:'child.hasSize':不是 true

我是颤振新手。我正在使用底部导航视图。在Dashboard类中,有底部导航。底部导航的第一个是具有选项卡视图的Home类。tabview 的第一页是NewRequest类。当应用程序首次运行时,选项卡视图的第一页不会加载,但是当进入其他类并返回 Home 时会加载新请求。应用程序首次运行时如何加载tabview首页?我已实施如下:

class Dashboard extends StatefulWidget{

@override
 State<StatefulWidget> createState() {
   return _DashboardState();
 }

}
 class _DashboardState extends State<Dashboard>{

int _currentIndex=0;
bool home=true;
final tabs=[
 Home(),
 Center(child: Text('History')),
 Center(child: Text('Wallet')),
   Center(child: Text('More')),
  ];

 final _title=[
  Center(child: Text("Dashboard"),),
  Center(child:Text("History"),),
  Center(child:Text("Wallet"),),
  Center(child:Text("More"),),];


  @override
   Widget build(BuildContext context) {
    return Scaffold(
        appBar: home ? null :AppBar(
         title: _title[_currentIndex],
         automaticallyImplyLeading: false,
    ),
    body: Container(
    child: tabs[_currentIndex],
  ),
  bottomNavigationBar: _bottomNavigationBar(),
);
}

Widget _bottomNavigationBar(){
 return …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-listview

8
推荐指数
1
解决办法
3万
查看次数

小米手机默认开启特殊权限

我需要在收到推送通知时打开应用程序。除 MI 设备外,它在所有设备中都能正常工作。我提出了启用小米手机特定权限的解决方案。当手动启用它们时它可以工作,但如何以编程方式启用下图所示的所有三个权限。 在此输入图像描述

android

5
推荐指数
1
解决办法
1691
查看次数

RangeError(索引):无效值:唯一有效值为0:1

我是颤振的新手。我正在尝试将数据列表添加到视图中。数据列表具有不同长度的不同订单项集合。我正在从 API 获取数据,但由于订单数据的长度不同,我收到如下图所示的错误。我的 json api 如下:

在此输入图像描述

{ 
 "status":"success",
 "message":"Data Fetched",
 "data":{ 
  "list":[ 
     { 
        "id":27,
        "order_code":"7wfelnkhuodlbvdseley1",
        "chef_id":1,
        "user_id":1,
        "order_status":1,
        "status":1,
        "order_datetime":"2020-01-21 18:05:00",
        "user_location_id":1,
        "price":1600,
        "coupon_id":null,
        "use_coupon":0,
        "discount":0,
        "final_price":1600,
        "vat_amt":208,
        "delivery_charge_amt":0,
        "payment_id":1,
        "delivery_time":null,
        "delivery_user_id":null,
        "payment_status":0,
        "payment_price":null,
        "payment_time":null,
        "reject_message":null,
        "created_at":"2020-01-21 18:05:00",
        "updated_at":"2020-01-21 18:07:46",
        "orderdata":[ 
           { 
              "id":30,
              "order_code_id":27,
              "chef_id":1,
              "food_id":17,
              "user_id":1,
              "additional_info":null,
              "food_qty":4,
              "instruction":null,
              "price":400,
              "food":{ 
                 "id":17,
                 "name":"Prawns Chilli",
                 "description":"<p>Seared&nbsp;prawns&nbsp;smothered in a spicy, sticky Asian sauce, 
                  these Asian&nbsp;Chilli&nbsp;Garlic&nbsp;Prawns&nbsp;will have you smacking your 
                  lips in utter satisfaction, feeling like you&rsquo;ve just dined at a fancy …
Run Code Online (Sandbox Code Playgroud)

flutter

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

实现facebook像素抖动

我正在尝试将 Facebook 像素集成到我的电子商务 flutter 应用程序中,以根据客户的搜索行为显示广告,但无法获得任何有关 flutter 的文档或库。如何在 Flutter 应用程序中集成 facbook pixel?

dart flutter facebook-pixel

3
推荐指数
1
解决办法
1068
查看次数

Flutter TableRow 中的手柄点击

我需要使 TableRow 可点击并导航到其他屏幕,但我无法使用 GestureDetector 或 Inkwell 包装 TableRow。如何使 TableRow 可点击。我已实施如下:

for (int i = 0; i < menuList.length; i++)
              TableRow(children: [
                SizedBox(
                  width: 5,
                ),
                Text((i + 1).toString()),
                Text(menuList[i].name),
                Text(menuList[i].price.toString()),
                Text(menuList[i].maxQty.toString()),
                menuList[i].status == 0
                    ? Text(
                        menuList[i].foodStatus,
                        style: TextStyle(color: Colors.red),
                      )
                    : YourListViewItem(
                        id: menuList[i].id,
                        index: menuList[i].status,
                      ),
              ]),
Run Code Online (Sandbox Code Playgroud)

flutter flutter-table

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