banner Codacy BadgeLicense

带有圆形背景的图标组件。

安装

  1. 将依赖项添加到pubspec.yaml

    dependencies:
        round_icon:
            git:
                url: https://github.com/teixeirazeus/round_icon
  2. 运行pub get。

    flutter pub get
  3. 导入包。

    import 'package:round_icon/round_icon.dart';

使用方法

设置图标、颜色和背景颜色。

import 'package:flutter/material.dart';
import 'package:round_icon/round_icon.dart';

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: RoundIcon(
              icon: Icons.person,
              backgroundColor: Colors.grey,
              iconColor: Colors.black),
        ),
      ),
    );
  }
}

贡献

欢迎 Pull requests。对于重大更改,请先打开一个 issue 来讨论您想进行的更改。

GitHub

查看 Github