這只是其中幾種簡單的方法,后續(xù)會(huì)補(bǔ)充,請(qǐng)持續(xù)關(guān)注
這是完整dome代碼,直接復(fù)制放入main.dart就可以了
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.red,
),
home: Scaffold(
appBar: AppBar(
title: Text("text實(shí)例dome"),
),
body: Center(
child: Column(
//垂直居中
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.person),
SizedBox(
height: 10,
),
//可以互交的icon
IconButton(icon: Icon(Icons.error), onPressed: () {}),
SizedBox(
height: 10,
),
RaisedButton(
onPressed: () {},
child: Text("RaisedButton"),
)
],
),
),
));
}
}