flutter - 如何在flutter_platform_widgets中使用抽屉:^0.72.0
问题描述
我正在尝试将抽屉与 PlatformScaffold 一起使用,但 MaterialAppBarData 似乎没有抽屉的命名参数。为较新版本使用颤振平台小部件添加抽屉的工作流程是什么。例如在 ^0.72.0 中。我似乎在文档或论坛中找不到任何关于此的信息。
解决方案
找到一个使用 PlatformAppBar 的教程,发现我应该使用脚手架中的材料参数,而不是 PlatformAppBar 中的参数。关闭这个。下面是工作流程。
PlatformApp(
home: PlatformScaffold(
appBar: PlatformAppBar(
title: Text("Title"),
),
body: AppContent(),
material: (context, platform) => MaterialScaffoldData(drawer: Drawer()),
),
);
推荐阅读
- macos - Mac:执行 Vagrant 使用的 CLI `VBoxManage` 时出错
- ms-access - Access 应用程序在常规 Access 2016 中完美运行,但在运行时 Access 中出现错误
- c# - 将带有 linq 的表加入到类中的对象列表中
- ssl - 我在 Google Cloud 托管上的 SSL 证书在哪里?
- ruby-on-rails - Rails has_one:检查是否有新关联
- cocoa - NSCalendarUnitEra 一般情况下我应该关心吗?
- php - 如何在 PHP/Laravel 中删除多个值为 0 的数组
- mongodb - 无法从 Ubuntu 安装/删除任何东西
- android - 如何通过 URL 将图像下载到内部存储器?
- sql - 从 dt=2018-12-01T18:23:59.000Z 到 dt 的 Hive 日期转换 - 5 小时,格式为 12/1/2018 13:23(即 'MM/dd/yyyy hh:mm' )