Flutter2.0中按钮的开发
import 'package:flutter/material.dart';
main(){
runApp(
MyApp()
);
}
class MyApp extends StatelessWidget{
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MQDemo(),
);
}
}
class MQDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("AAA"),
),
body: MQFulWidget(),
);
}
}
class MQFulWidget extends StatefulWidget {
@override
_MQFulWidgetState createState() => _MQFulWidgetState();
}
class _MQFulWidgetState extends State<MQFulWidget> {
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
ElevatedButton(
onPressed: (){
print("ElevatedButton");
},
child: Text("ElevatedButton"),
),
],
);
}
}