我是一位有用的助手,可以为您进行文本翻译。
我正在尝试创建浮动操作按钮,但是我缺少图标。
我的代码如下:
这是虚拟设备的屏幕截图。(你可以看到图标看起来很奇怪。)
我正在尝试创建浮动操作按钮,但是我缺少图标。
我的代码如下:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
centerTitle: true,
title: Text(
"Lessons of Flutter",
style: TextStyle(
color: Colors.white,
),
),
),
body: Center(
child: const Text('Press the button below!')
),
floatingActionButton: FloatingActionButton(
onPressed: () {
// Add your onPressed code here!
},
child: Icon(Icons.mouse),
backgroundColor: Colors.green,
),
),
);
}
}
这是虚拟设备的屏幕截图。(你可以看到图标看起来很奇怪。)
![在此输入图像描述](https://istack.dev59.com/FnHAr.webp)