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('位置'),
    );//注意最后一个是冒号
  //具体内容结束
  }
}

  

posted @ 2024-06-27 13:11  飞雪飘鸿  阅读(7)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL