flutter---启动项目,准备起飞
努力生活,终有一天自己的本事会配得上自己的情怀,然后从容不破地去与岁月相遇。flutter—启动项目,准备起飞1、打开android studio,建立虚拟机2、运行虚拟机。需要的空间比较大,删了好多东西3、网页启动成功了4、使用vs code编辑代码,比较轻量,占用内存空间小,需要下载flutter5、编写脚本文件6、ctrl+~ 启动命令行、flutter run启动项目真费劲啊启动这么一个破
·
努力生活,终有一天自己的本事会配得上自己的情怀,然后从容不迫地去与岁月相遇。
flutter—启动项目,准备起飞
1、打开android studio,建立虚拟机
2、运行虚拟机。需要的空间比较大,删了好多东西
3、网页启动成功了
4、使用vs code编辑代码,比较轻量,占用内存空间小,需要下载flutter
5、编写脚本文件
6、ctrl+~ 启动命令行、flutter run启动项目
真费劲啊启动这么一个破玩意要这么久
天呐,终于成功了,想哭。。。。。。
7、牛刀小试
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.red,
),
// home: const MyHomePage(title: 'wangzilaoshihao'),
home: Scaffold(
appBar: new AppBar(title: new Text('王子老师最帅'),),
body: Center(
child: Container(
child: new Image.network(
"https://img-blog.csdnimg.cn/5e8f6b90b81f45b8a56dc731b70cf1ea.gif",
// fit: BoxFit.scaleDown,
// color: Colors.greenAccent,
// colorBlendMode: BlendMode.lighten,
repeat: ImageRepeat.repeatY
),
width:500.0,
height: 300.0,
color: Colors.lightBlue,
),
// child: Container(
// child: new Text(
// '我是王子老师', style: TextStyle(fontSize: 30.0)),
// alignment: Alignment.topLeft,
// height: 500.0,
// width: 600.0,
// //color: Colors.lightBlue,
// padding: const EdgeInsets.fromLTRB(10.0,20,1,1),
// margin: const EdgeInsets.all(10.0),
// decoration: new BoxDecoration(
// gradient:const LinearGradient(
// colors: [Colors.lightBlue,
// Colors.greenAccent, Colors.purple]),
// border: Border.all(width: 2.0,color: Colors.red)
// ),
// )
// child: Text(
// 'Hello wangzi 老师,马上走上人生巅峰,要不要跟随王子老师一起呢?woyaowoyao',
// textAlign: TextAlign.center,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontSize: 25.0,
// color:Color.fromARGB(255, 255, 125, 125),
// decoration: TextDecoration.underline,
// decorationStyle: TextDecorationStyle.solid
// ),
// ),
),
),
);
}
}
更多推荐
已为社区贡献3条内容
所有评论(0)