Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created January 15, 2020 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanlid/b615309c5739479ca53a4b48531ea622 to your computer and use it in GitHub Desktop.
Save ryanlid/b615309c5739479ca53a4b48531ea622 to your computer and use it in GitHub Desktop.
设置主页
import 'package:flutter/material.dart';
void main() => runApp(new MaterialApp(
home: MyApp(),
));
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: MyHomePage(),
),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("MaterialApp示例"),
),
body: Center(
child: Text(
"主页",
style: TextStyle(fontSize: 28.0),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment