2 Star 25 Fork 11

早起的年轻人/flutter-ho

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo_RotatedBox.dart 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
import 'dart:math';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// 创建人: Created by zhaolong
/// 创建时间:Created by on 3/26/21.
///
/// 可关注公众号:我的大前端生涯 获取最新技术分享
/// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
/// 可关注博客:https://blog.csdn.net/zl18603543572
///
main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: DemoRotatedBoxPage(),
));
}
///代码清单
class DemoRotatedBoxPage extends StatefulWidget {
@override
_DemoRotatedBoxPageState createState() => _DemoRotatedBoxPageState();
}
class _DemoRotatedBoxPageState extends State<DemoRotatedBoxPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("RotatedBox 旋转"),
),
backgroundColor: Colors.white,
///填充布局
body: Container(
padding: EdgeInsets.only(top: 100, left: 100, right: 100),
child: Row(
children: [buildTransform()],
),
),
);
}
buildTransform() {
return Transform.rotate(
//旋转的弧度
angle: pi/2,
//旋转的子Widget
child: Container(
child: Text(
'Hello World!',
style: TextStyle(
color: Colors.white,
),
),
color: Colors.blueGrey,
),
);
}
buildRotate() {
return RotatedBox(
//旋转的倍数
quarterTurns: 1,
//旋转的子Widget
child: Container(
child: Text(
'Hello World!',
style: TextStyle(
color: Colors.white,
),
),
color: Colors.blueGrey,
),
);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/android.long/flutter-ho.git
git@gitee.com:android.long/flutter-ho.git
android.long
flutter-ho
flutter-ho
main

搜索帮助