ex:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Text示例'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Icon(Icons.person),
              SizedBox(
                height: 10.0,
              ),
              IconButton(icon: Icon(Icons.error), onPressed: () {}),
              Container(
                height: 20.0,
                color: Colors.blue,
              ),
              RaisedButton(
                onPressed: () {},
                child: Text('RaisedButton'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

结果:

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐