iOS风格指示器

Flutter iOS风格指示器,可以创建酷炫而简单的iOS风格浮动指示器,在切换静音/睡眠模式时可见。

顶部

1

底部

2

它也支持暗黑模式!

3

入门

依赖它。

flutter pub add iosish_indicator

或者

将以下行添加到你的个人包的pubspec.yaml

dependencies:
  iosish_indicator: ^1.0.0

然后运行flutter pub get进行安装。

导入它。

import 'package:iosish_indicator/iosish_indicator.dart';

创建指示器。

Iosish(context).createIndicator(
  // Put props here..
);

Props

Props 类型 默认值 描述
title 字符串 必需 要显示的主要指示器文本。
position 位置 位置.顶部 指示器将显示的位置值。
duration 持续时间? Duration(seconds:2) 呈现时长值。
触觉反馈 布尔值 创建指示器时提供HapticFeedback.heavyImpact()触觉反馈。
child Widget? 将子组件放在指示器的左侧。

示例

import 'package:iosish_indicator/iosish_indicator.dart';
...
Iosish(context).createIndicator(
  title: "Hello, Iosish Indicator!",
  position: Position.bottom,
  duration: const Duration(seconds: 2),
  child: const Icon(Icons.check_circle),
);

许可证

MIT License

Copyright (c) 2021 Kim Seung Hwan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

GitHub

查看 Github