mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-08-06 17:33:43 +08:00
release apk
This commit is contained in:
@ -20,8 +20,8 @@ class _FlexibleSpaceBarFullDefault extends State {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FlexibleSpaceBar(
|
||||
// ... // 如果没有,就是不需要有状态的 StatefulWidget
|
||||
);
|
||||
// ... // 如果没有,就是不需要有状态的 StatefulWidget
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,8 +30,7 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
|
||||
final widget;
|
||||
final parent;
|
||||
|
||||
const FlexibleSpaceBarLessDefault([this.widget, this.parent])
|
||||
: super();
|
||||
const FlexibleSpaceBarLessDefault([this.widget, this.parent]) : super();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -39,7 +38,8 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
|
||||
height: 300.0,
|
||||
child: Scaffold(
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
||||
headerSliverBuilder:
|
||||
(BuildContext context, bool innerBoxIsScrolled) {
|
||||
return <Widget>[
|
||||
SliverAppBar(
|
||||
expandedHeight: 150.0,
|
||||
@ -55,6 +55,13 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
|
||||
background: Image.network(
|
||||
"https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350",
|
||||
fit: BoxFit.cover,
|
||||
|
||||
/// 色彩叠加 UI可以理解为两个色彩涂层,在图片混合一个色层
|
||||
// color: Colors.redAccent, //混合的颜色
|
||||
// colorBlendMode: BlendMode.darken, //混合方式
|
||||
|
||||
///图片重复填充容器
|
||||
// repeat: ImageRepeat.repeat,
|
||||
)),
|
||||
),
|
||||
];
|
||||
@ -63,6 +70,6 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
|
||||
child: Text("向上提拉 ⬆ 查看效果..."),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}}
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
/// Author: xiaojia.dxj
|
||||
/// Date: 2018/11/22
|
||||
/// Email: xiaojia.dxj@alibaba-inc.com
|
||||
/// LastUpdateTime: 2018/11/22
|
||||
/// LastUpdateBy: xj.deng
|
||||
/// Author: xiaojia.dxj
|
||||
/// Date: 2018/11/22
|
||||
/// Email: xiaojia.dxj@alibaba-inc.com
|
||||
/// LastUpdateTime: 2018/11/22
|
||||
/// LastUpdateBy: xj.deng
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@ -19,8 +19,11 @@ class DecoratedBoxCreate extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xff7c94b6),
|
||||
//设置图片内容
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: DecorationImage(
|
||||
|
||||
///fix:BoxFit.contain: 保持图片的比例,最大程度填充容器 BoxFit.fill:容器被图片完全填充,不在意图片比例,只填充整个容器
|
||||
///fix:BoxFit.fitWidth:图片以宽被完全填充 BoxFit.fix:fixHigth:图片以高度完全填充
|
||||
fit: BoxFit.cover, //图片填充整个容器,按比例放大,多余部分被裁切
|
||||
image: ExactAssetImage('assets/images/food01.jpeg')),
|
||||
//外宽边框,可以不设置
|
||||
border: Border.all(
|
||||
@ -44,7 +47,7 @@ class DecoratedBoxCreateTwo extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xff7c94b6),
|
||||
//设置图片内容
|
||||
image: DecorationImage(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: ExactAssetImage('assets/images/food01.jpeg')),
|
||||
//根据传入的不同大小,呈现图片效弧度不同,
|
||||
@ -65,7 +68,7 @@ class DecoratedBoxCreateShape extends StatelessWidget {
|
||||
position: DecorationPosition.background,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xff7c94b6),
|
||||
image: DecorationImage(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: ExactAssetImage('assets/images/food01.jpeg')),
|
||||
border: Border.all(
|
||||
@ -77,3 +80,27 @@ class DecoratedBoxCreateShape extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DecoratedBoxCreateShapes extends StatelessWidget {
|
||||
DecoratedBoxCreateShapes({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DecoratedBox(
|
||||
position: DecorationPosition.background,
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
//渐变效果 线性渐变
|
||||
colors: [Colors.red, Colors.yellowAccent, Colors.lightGreenAccent]),
|
||||
// color: const Color(0xff7c94b6),
|
||||
border: Border.all(
|
||||
color: Colors.blue.shade50,
|
||||
width: 5.0,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
///Author: xiaojia.dxj
|
||||
///Date: 2019-01-08 15:56:49
|
||||
///Date: 2019-01-08 15:56:49
|
||||
///Last Modified by: xiaojia.dxj
|
||||
///Last Modified time: 2019-01-08 15:56:49
|
||||
///Last Modified time: 2019-01-08 15:56:49
|
||||
///email: xiaojia.dxj@alibaba-inc.com
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@ -46,7 +46,7 @@ class _DemoState extends State<Demo> {
|
||||
}
|
||||
|
||||
Column _decoratedBoxCreate() {
|
||||
return Column(
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 100.0,
|
||||
@ -68,6 +68,14 @@ class _DemoState extends State<Demo> {
|
||||
height: 100.0,
|
||||
width: 100.0,
|
||||
child: DecoratedBoxCreateShape(),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Container(
|
||||
height: 100.0,
|
||||
width: 100.0,
|
||||
child: DecoratedBoxCreateShapes(),
|
||||
)
|
||||
],
|
||||
);
|
||||
|
Reference in New Issue
Block a user