第一个Flutter页面里的main函数

笔者左右无法肉眼识别哪些是系统生成的,哪些是需要开发者手写的,只有在最初的阶段通过加强多写页面来形成肌肉记忆了。下述是main函数的

import 'package:exercise_home_page/app_center.dart';

import 'package:flutter/material.dart';

import 'home_page.dart';

import 'message_center.dart';

void main() {

runApp(const MyApp());

}

class MyApp extends StatelessWidget {

const MyApp({super.key});

// This widget is the root of your application.

@override

Widget build(BuildContext context) {

return MaterialApp(

title: 'Flutter Demo',

theme: ThemeData(

colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),

useMaterial3: true,

),

home: MessageCenter(),

);

}

}

import 'package:flutter/material.dart';

class MessageCenter extends StatefulWidget

{

const MessageCenter({super.key});

@override

State<StatefulWidget> createState() {

return _State();

}

}

class _State extends State<MessageCenter>

{

@override

Widget build(BuildContext context) {

return Container(

color: Colors.orange,

);

}

}

相关推荐
haaaaaaarry25 分钟前
Element Plus常见基础组件(二)
开发语言·前端·javascript
xyphf_和派孔明1 小时前
关于echarts的性能优化考虑
前端·性能优化·echarts
PyHaVolask1 小时前
HTML 表单进阶:用户体验优化与实战应用
前端·javascript·html·用户体验
A了LONE1 小时前
cv弹窗,退款确认弹窗
java·服务器·前端
AntBlack2 小时前
闲谈 :AI 生成视频哪家强 ,掘友们有没有推荐的工具?
前端·后端·aigc
花菜会噎住2 小时前
Vue3核心语法进阶(computed与监听)
前端·javascript·vue.js
花菜会噎住3 小时前
Vue3核心语法基础
前端·javascript·vue.js·前端框架
全宝3 小时前
echarts5实现地图过渡动画
前端·javascript·echarts
vjmap3 小时前
MCP协议:CAD地图应用的AI智能化解决方案(唯杰地图MCP)
前端·人工智能·gis
simple_lau3 小时前
鸿蒙设备如何与低功耗蓝牙设备通讯
前端