AdiPoli 容器
AdiPoli container 包可让您为您的 Flutter 产品添加漂亮的渐变容器。
安装
- 将最新版本的包添加到您的 pubspec.yaml 文件中(然后运行 ‘dart pub get’);
dependencies: adipoli_container : ^0.0.1
- 导入 ‘import ‘package:adipoli_container/adipoli_container.dart’;
示例
您可以修改许多属性
- 高度,
- 内边距,
- 副标题,
- 起始颜色,
- 标题,
- 结束颜色,
- 宽度,
- radius
class SampleScreen extends StatelessWidget {
const SampleScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: AdiPoliContainer(
height: 100,
width: 400,
radius: 20,
title: Text('Hello World',
style: TextStyle(
color: Colors.blue,
fontSize: 20,
fontWeight: FontWeight.w800
),
),
subtitle: Text('This is a new package',
style: TextStyle(
color: Colors.blue,
fontSize: 20,
fontWeight: FontWeight.w800
),
),
colorStart: Colors.white,
colorEnd: Colors.black,
padding: EdgeInsets.symmetric(horizontal: 20,vertical: 20)
),
),
);
}
}
|
|
下一步目标
-[x] 添加 onTap 以用于函数。现在,您可以指定 onTap 并指定一个函数。
-[x] 更改文本的字体和颜色样式。通过指定“textcolor”和“subtitlecolor”属性来更改颜色。
-[] 向包中添加更多容器。
GitHub
查看 Github