颤振中的双图标按钮 - 前缀和后缀图标
Dual Icon Button in flutter - Prefix and Suffix Icon
我正在尝试练习 flutter 中的图标和按钮,我发现这张照片带有前缀和后缀图标。我在 TextFormField 中完成了此操作,但我不知道如何为按钮实现此操作。请帮忙。
此小部件称为 ListTile,示例:
ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
leading: Container(
child: Icon(Icons.autorenew, color: Colors.white),
),
title: Text(
"Introduction to Driving",
),
subtitle: Row(
children: <Widget>[
Icon(Icons.linear_scale, color: Colors.yellowAccent),
Text(" Intermediate", style: TextStyle(color: Colors.white))
],
),
trailing:
Icon(Icons.keyboard_arrow_right, color: Colors.white, size: 30.0)
);
按照 Abdallah Abdel Aziz 的回答。
这是最终使用的代码
GestureDetector(
onTap: (){
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const SignUpScreen()));
},
child: ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
leading: Container(
child: Icon(Icons.account_circle, color: Colors.black),
),
title: Text(
"Introduction to Driving",
),
/*subtitle: Row(
children: <Widget>[
// Icon(Icons.arrow_forward_ios, color: Colors.black),
*//*Text(" Intermediate", style: TextStyle(color: Colors.black))*//*
],
),*/
trailing:Icon(Icons.keyboard_arrow_right, color: Colors.black, size: 30.0)
))
我正在尝试练习 flutter 中的图标和按钮,我发现这张照片带有前缀和后缀图标。我在 TextFormField 中完成了此操作,但我不知道如何为按钮实现此操作。请帮忙。
此小部件称为 ListTile,示例:
ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
leading: Container(
child: Icon(Icons.autorenew, color: Colors.white),
),
title: Text(
"Introduction to Driving",
),
subtitle: Row(
children: <Widget>[
Icon(Icons.linear_scale, color: Colors.yellowAccent),
Text(" Intermediate", style: TextStyle(color: Colors.white))
],
),
trailing:
Icon(Icons.keyboard_arrow_right, color: Colors.white, size: 30.0)
);
按照 Abdallah Abdel Aziz 的回答。
这是最终使用的代码
GestureDetector(
onTap: (){
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const SignUpScreen()));
},
child: ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
leading: Container(
child: Icon(Icons.account_circle, color: Colors.black),
),
title: Text(
"Introduction to Driving",
),
/*subtitle: Row(
children: <Widget>[
// Icon(Icons.arrow_forward_ios, color: Colors.black),
*//*Text(" Intermediate", style: TextStyle(color: Colors.black))*//*
],
),*/
trailing:Icon(Icons.keyboard_arrow_right, color: Colors.black, size: 30.0)
))