Flutter:缩放布局组件FittedBox
简介缩放布局组件FittedBox主要有两个功能:缩放和位置调整。FittedBox会根据自己的尺寸来调整child的尺寸。
缩放布局组件FittedBox主要有两个功能:缩放和位置调整。FittedBox会根据自己的尺寸来调整child的尺寸。
使用FittedBox需要用到两个常用的属性,fit缩放方式,跟前面学到的Image组件的填充方式一致,其次就是alignment对齐方式。
import 'package:flutter/material.dart';
class DemoFittedBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: 50.0,
height: 50.0,
color: Colors.blue,
child: FittedBox(
child: Text('缩放组件'),
),
),
Divider(),
Container(
width: 100.0,
height: 100.0,
color: Colors.blue,
child: FittedBox(
child: Text('缩放组件'),
),
),
Divider(),
Container(
width: 50.0,
height: 50.0,
color: Colors.blue,
child: FittedBox(
fit: BoxFit.cover,
child: Text('缩放组件'),
),
),
Divider(),
Container(
width: 50.0,
height: 50.0,
color: Colors.blue,
child: FittedBox(
fit: BoxFit.fitWidth,
child: Text('缩放组件'),
),
),
Divider(),
Container(
width: 50.0,
height: 50.0,
color: Colors.blue,
child: FittedBox(
fit: BoxFit.contain,
child: Text('缩放组件'),
),
),
Divider(),
Container(
width: 50.0,
height: 50.0,
color: Colors.blue,
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.bottomCenter,
child: Text('缩放组件'),
),
),
],
);
}
}

无向图(Undirected Graph)
ifup命令用于激活指定网络接口。ifup命令其实就是一个shell脚本。ifup命令可读配置文件/etc/sysconfig/network和/etc/sysconfig/network-scripts/ifcfg-对网络接口进行相应操作
默认情况下 pip 使用的是国外的镜像,在下载的时候速度非常慢,本文我们介绍使用国内源对pip进行加速。
阿里云负载均衡是中小型公司使用较多的产品,但是有时候需要设置多个域名并设置https证书就比较麻烦,本文主要记录阿里云负载均衡配置多个域名指向并设置HTTPS证书。
快速生成表格
Electron页面跳转、浏览器打开链接和打开新窗口
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题