当前位置:网站首页>Flutter Getting Started and Advanced Tour (2) Hello Flutter

Flutter Getting Started and Advanced Tour (2) Hello Flutter

2022-08-09 13:15:00 Xie Dong_

Open question

It seems that almost any programming language we learn or master starts with Hello word. This blog post is the first sharing of the advanced level of Flutter entry. We also start with the simplest Hello world. As for the Flutter development environmentThe configuration of , and the introduction to the Dart language are not the content of this column, so I will not introduce it in detail. Readers can find out about it on their own google or Baidu.

Preparation

Before I start, I would like to introduce to you two commonly used components in Flutter, MaterialApp and Scaffold. Readers do not need to fully grasp them here.There are special topics to explain the two. Here, let’s first briefly understand that MaterialApp is an entry Widget that is commonly used in our app development and conforms to the Material Design design concept.From the literal meaning, you can see that Scaffold is also a scaffolding and a skeleton, that is, it serves as the skeleton of our app, and quickly helps us create a template that can be customized for secondary construction. We can do a lot of personalized UI on it.custom made.For this chapter of Hello Flutter, we can simply understand so much first. Readers don’t have to rush to grasp all the contents of Flutter immediately. Today, I will simply say hello to Flutter. It is enough to have a simple understanding. We will learn together slowly in the future.Various Widgets in Flutter.

Code:

import 'package:flutter/material.dart';void main() {runApp(new MaterialApp(home: new HelloFlutter()));}class HelloFlutter extends StatelessWidget {@overrideWidget build(BuildContext context) {return new Scaffold(appBar: new AppBar(title: new Text("Hello Flutter"),),body: new Center(child: new Text("Hello Flutter")),);}}

Next: Flutter Getting Started and Advanced Tour (3) Text Widgets

原网站

版权声明
本文为[Xie Dong_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208091203557282.html