flutter3具体内容单页按钮
import 'package:flutter/material.dart'; class MyButton extends StatelessWidget { const MyButton({super.key}); @override Widget build(BuildContext context) { //return const Placeholder(); //具体内容开始 return MaterialButton( textColor: Colors.white, color: Colors.green, shape: RoundedRectangleBorder( borderRadius:BorderRadius.circular(30.0) ), onPressed: () {print('按钮被点击'); }, child: const Text('位置'), );//注意最后一个是冒号 //具体内容结束 } }