未定义命名参数 'icon'。尝试使用名称 'icon' 定义命名参数
The named parameter 'icon' isn't defined. Try defining a named parameter with the name 'icon'
Grid view with flutter icons with 2 columns and Each Images Text under the image aligned bottom center with 300 by 300 pixel dimensions or icon size 98 or 85我的代码如下`import
appBar: AppBar(title: Text("Digital Directory"),),
body: Center(
child: GridView.count(
primary: false,
padding: const EdgeInsets.all(20),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 2,
children: <Widget>[
Container(
color: Colors.cyan[100],
child: GestureDetector
(
onTap:(){
Navigator.of(context).push(MaterialPageRoute(builder:(context)=>MobileAccessoriesPage(),
),
);
},
child: Center (child:Text ('Mobiles'),icon:Icons.mobile_screen_share),
),
),
我正在构建带有 flutter 平面图标的网格视图应用程序,我想在单击平面图标时导航到另一个屏幕(即 .dart page/screen)`
使用以下代码更改中心的Child:
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Mobiles',
),
Icon(Icons.mobile_screen_share),
],
),
)
这将使文本 'mobiles' 和图标并排显示。如果您对对齐方式不满意,请更改 mainAxisAlignment
和 crossAxisAlignment
Grid view with flutter icons with 2 columns and Each Images Text under the image aligned bottom center with 300 by 300 pixel dimensions or icon size 98 or 85我的代码如下`import
appBar: AppBar(title: Text("Digital Directory"),),
body: Center(
child: GridView.count(
primary: false,
padding: const EdgeInsets.all(20),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 2,
children: <Widget>[
Container(
color: Colors.cyan[100],
child: GestureDetector
(
onTap:(){
Navigator.of(context).push(MaterialPageRoute(builder:(context)=>MobileAccessoriesPage(),
),
);
},
child: Center (child:Text ('Mobiles'),icon:Icons.mobile_screen_share),
),
),
我正在构建带有 flutter 平面图标的网格视图应用程序,我想在单击平面图标时导航到另一个屏幕(即 .dart page/screen)`
使用以下代码更改中心的Child:
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Mobiles',
),
Icon(Icons.mobile_screen_share),
],
),
)
这将使文本 'mobiles' 和图标并排显示。如果您对对齐方式不满意,请更改 mainAxisAlignment
和 crossAxisAlignment