Flutter入门

MaterialApp风格App

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'my app',
      home: Scaffold(
        appBar: AppBar(
          title: Text('首页'),
        ),
        body: Container(
          color: Colors.yellow,
          child: Text('文本')
        ),
      ),
    );
  }
}
image.png

你可能感兴趣的:(Flutter入门)