精美容器

Fancy container 包允许您为您的 Flutter 应用添加漂亮的渐变容器。

安装

  1. 将最新版本的包添加到您的 pubspec.yaml (并运行 dart pub get)
dependencies:
  fancy_containers: ^0.0.1
  1. 导入包并在您的 Flutter 应用中使用它。
import 'package:fancy_containers/fancy_containers.dart';

示例

有许多属性可以修改

  • 高度
  • width
  • title
  • 副标题
  • 渐变 (颜色1 和 颜色2)

class FancyScreen extends StatelessWidget {  
  const FancyScreen({Key? key}) : super(key: key);  
  
  @override  
  Widget build(BuildContext context) {  
    return Scaffold(  
      body: Center(  
        child: const FancyContainer(  
          title: 'Hello World',  
          color1: Colors.lightGreenAccent,  
          color2: Colors.lightBlue,  
          subtitle: 'This is a new package',  
        ),  
      ),  
    );  
  }  
}

下一步目标

  • [x] 为函数添加 onTap。
    现在,您可以指定 onTap 并指定一个函数。

  • [x] 更改文本的字体和颜色样式。
    通过指定 textcolorsubtitlecolor 属性来更改颜色。

  • [ ] 向包中添加更多容器。

GitHub

https://github.com/adityathakurxd/fancy_containers