- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经在页面中创建了listview.builder。为此,我设计了我的卡。现在,我想通过单击 float 操作按钮中的onpressed方法在Listveiw.buider中一张一张生成卡片。我应该在压缩后的内容中写哪种方法/功能?以及如何生成卡片以及应该在itemCount和itemBuilder中进行哪些更改。我需要那个路线图。谢谢。
ListView.builder(
itemCount: 5,
itemBuilder: (context, index) {
return Dismissible(
key:Key(null),
direction: DismissDirection.startToEnd,
onDismissed: (direction) {},
confirmDismiss: (direction) {
return showDialog(
context: context, builder: (_) => DeleteCard());
},
background: Container(
color: Colors.red,
padding: EdgeInsets.only(left: 16),
child: Icon(
Icons.delete,
color: Colors.white,
),
alignment: Alignment.centerLeft,
),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0)),
color: Colors.white70,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
width: 120,
padding: EdgeInsets.all(10.0),
child: Text(
"Project ",
style: TextStyle(
fontSize: 11, fontWeight: FontWeight.bold),
),
),
Container(
padding: EdgeInsets.all(10.0),
child: ProjectName(),
),
],
),
// item add start
Container(
padding: EdgeInsets.all(10.0),
child: TextFormField(
decoration: InputDecoration(
hintText: "Item name" ,hintStyle: TextStyle(fontSize: 12),
),
),
),
Container(
padding: EdgeInsets.all(10.0),
child: TextFormField(
decoration: InputDecoration(
hintText: "Amount",hintStyle: TextStyle(fontSize: 12),
),
keyboardType: TextInputType.number,
),
),
],
),
),
);
}
),
最佳答案
我想这是您要寻找的东西。只需将ListTile
替换为您自己的Card
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomeScreen(),
);
}
}
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
var listLength = 1;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Flutter App :)"),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {
setState(() {
listLength++;
});
}),
body: Container(
child: ListView.builder(
itemCount: listLength,
itemBuilder: (context, index) {
return ListTile(
leading: Text("$index"),
title: Text("List Tile as Widget"),
);
})),
);
}
}
关于flutter - 我想在我的flutter应用程序中通过onPressed方法生成卡。谁能给我看一个路线图…?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64522707/
这里是执行 2 点(origin, current location){geoPoint, "current Location"} 到 Destination.{geoPoint1, "Desti L
有没有人找到 PHP 版本 6 的路线图? 此外,发布日期的任何非常粗略的 ETA(请不要回答“准备就绪时”,我只是想了解一下是 2010 年上半年、下半年等) 最佳答案 已经有一个可以使用的开发版本
有人能指出这个项目 ( Managed Service Engine ) 是否已被放弃吗? 我需要决定是否将其用作我的企业服务虚拟化计划的一部分。我目前看到来自 Microsoft 的许多竞争解决方案
由于某种原因,jQuery 模板插件 (jquery-tmpl) 的开发已被搁置。从阅读有关该主题的博客文章来看,它似乎将来会再次包含在内,或者被采用不同方法的内容所取代(例如 jsRender 和
With the recent announcement PHP 6 的开发已经停止,我对 PHP 5.x 和 6.x 路线图包含的内容感到困惑。 PHP 的当前版本是 5.3.2。 PHP 6.0
我一直在密切关注pivot 的r2dbc 更新,我希望使用这种方法构建我的应用程序。我尝试了一些带有 r2dbc postgres 驱动程序的小型应用程序,如下所示:
当我们在 Azure 上部署 ASP.CORE 3.0 时,出现以下错误: The current .NET SDK does not support targeting .NET Core 3.0
您是否计划增加从项目中检索(通过 API)所有任务的可能性,包括那些已归档的任务? 最佳答案 (我在 Asana 工作) 这将是一个有用的功能,我们已经在计划添加它。但是,我无法评论何时可以。 关于A
我一直在 Goog 上搜索,但由于技术发展如此之快,我的所有结果似乎都已过时(拂去灰尘)。 我正在寻找 MVC 的 Razor 路线图。我知道它进行了预览,但我想知道完整版本。我真的很想开始使用 Ra
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭10 个月前。 Improve this que
Microsoft 是否有任何计划发布具有原生 Cordova 7、Node 4.x 支持的 Taco Update 11? 自 last update 以来,Taco 是否仍然是一个活跃的项目?是两
KDE 开发者 Nate Graham 近日公布了 KDE 桌面在 2022 年的开发路线图,列出了这个由社区驱动的开源桌面环境今年的主要开发工作。与以往公布的路线图一样,这不是一份正式的承诺,这只
我是一名优秀的程序员,十分优秀!