FLUTTER ECOSYSTEM

Mardaneus86/touch_indicator

Flutter 插件,可在屏幕录制或视频录制时在 iOS 和 Android 上显示一致的触摸指示器

touch_indicator 项目封面
Stars
13
Forks
6
最近推送(UTC)
2024年7月26日
项目状态
未归档
Tim Klingeleers GitHub avatar
GITHUB User

Tim Klingeleers ↗

语言Dart

技术话题

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • pedantic开发依赖^1.4.0

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

touch_indicator

When you are recording a screencast of your app, you often want to give visual indication of where your fingers are touching the screen. Showing that on Android is easy. On iOS it's less intuitive. touch_indicator makes it easier and consistent on both platforms.

You add this widget as the main widget where you want to display user touches. Usually this will be the direct child of your MaterialApp. It will show an indicator on every touching finger and is completely customizable.

https://raw.githubusercontent.com/mardaneus86/touch_indicator/master/screenshots/touch_indicator_example.gif

Installation

Add the plugin to your pubspec.yaml:

dependencies:
  touch_indicator: ^2.0.0

Usage

Import the package in your Dart code:

import 'package:touch_indicator/touch_indicator.dart';

Wrap all routes in your app in the TouchIndicator widget:

class MyApp extends StatelessWidget {
  MaterialApp(
    title: 'Touch indicator example',
    builder: (context, child) => TouchIndicator(child: child!),
    home: MyHomePage(title: 'Flutter Demo Home Page'),
  );
}

Customization options

indicatorColor

Changes the color of the backdrop and icon. Default is Colors.blueGrey.

indicatorSize

Changes the size of the indicator. Default is 40.0.

indicator

By adding a Widget here, you can change the complete look of the touch indicators. Make sure to supply a proper indicatorSize in order for the indicators to be positioned at the center of your touchpoints.

forceInReleaseMode

When you want to show indicators when the app is running in release mode, make sure to enable this option. Default is false.

enabled

You can enable or disable display of the indicators on the fly with this option. Default is true.