搜索插件、代码仓与 APP 分类

animated_analog_clock 封面
插件详情v0.2.2

animated_analog_clock

一个可自定义且带动画效果的模拟时钟小部件,适用于 Flutter 应用程序。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
293
喜欢数
16
Pub 分数
150

安装插件

flutter pub add animated_analog_clock

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个可定制且带有动画效果的 Flutter 模拟时钟小部件,专为在多个平台上以流畅的实时动画显示时间而设计。它支持对时钟表面、指针和标记的各种样式选项,使开发者能够根据应用主题调整其外观。该小部件动态更新,确保准确计时且性能影响极小。非常适合需要视觉上吸引人的时间显示的应用程序,例如仪表板、生产力工具或极简界面。

适合场景

  • 仪表板小部件
  • 生产力应用
  • 极简用户界面
  • 时间跟踪工具
  • 数字健康应用

主要特点

  • 流畅的实时动画
  • 可自定义的时钟表盘和指针
  • 跨平台兼容性
  • 可配置的手部样式和颜色
  • 自动时间更新
  • 轻量级性能

适合对象

  • 开发时间相关应用的开发者
  • 寻求优雅时钟UI的设计人员
  • 需要实时时间显示的应用
  • 面向多个平台的项目
  • 想要一个简单而美观的时钟的用户

使用建议

  • 可能需要额外的样式以支持深色模式
  • 性能取决于动画帧率
  • 仅限模拟风格的时间显示
  • 不适合仅需数字时间的需求
  • 自定义可能需要反复试验才能达到最佳外观

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter Animated Analog Clock

pub package

A customizable and animated analog clock widget. This package provides a fully customizable analog clock widget that supports animation for smooth transitions of clock hands. Users can customize various aspects of the clock including size, colors, background, and more.

Flutter Analog Clock Screenshot  

New in Version 0.2.2

Image Dial (New Feature)

You can now use an Image Dial as the clock's face, allowing you to set a background image. This can be a network image or an asset image, making your analog clock even more visually appealing and customizable.

Example:
AnimatedAnalogClock(
  backgroundImage: NetworkImage(
    'https://cdn.pixabay.com/photo/2023/12/01/22/27/spiderman-8424632_1280.jpg',
  ),
);

Or with an asset image:

AnimatedAnalogClock(
  backgroundImage: AssetImage(
    'path/to/your/image.png',
  ),
);

Dial Options

Image (New in Version 0.2.2)
Image Dial
Numbers
Numbers Dial
Numbers and Dashes
Numbers and Dashes Dial
Roman Numerals
Roman Numerals Dial
Dashes
Dashes Dial
No Dial
Dashes Dial

Installation

In your pubspec.yaml file of your Flutter Project, add the following dependency:

dependencies:
  animated_analog_clock: ^0.2.2

Import

import 'package:animated_analog_clock/animated_analog_clock.dart';

Features

  • Customizable Design: Users can customize various aspects of the analog clock, including size, colors, background, and more, to match their app's design aesthetics.

  • Smooth Animations: The analog clock widget supports smooth animations for clock hands, providing a visually pleasing experience for users.

  • Timezone Support: The clock widget supports displaying time in different timezones, allowing users to customize the clock based on their location or preferences.

  • Timezone Support with Location Specification: Users can specify a location name, and the clock will display the time according to the timezone associated with that location. To find valid location names for timezones, check out the this documentation.

  • Lightweight and Efficient: The package is designed to be lightweight and efficient, ensuring smooth performance even on devices with limited resources.

  • DialType Enum: Introduced the DialType enum to support different dial options: dashes, numbers, numberAndDashes, and none.

Usage

Basic Usage
const AnimatedAnalogClock()
Customization Options
AnimatedAnalogClock(
          location: 'Australia/Darwin',
          // Gradient Background if you want
          // backgroundGradient: RadialGradient(colors: []),
          // Set a network image as the background
          // backgroundImage: NetworkImage(
          // 'url',
          // ),
          // Alternatively, set an asset image as the background
          // backgroundImage: AssetImage(
          //   'path/to/your/asset/image.png',
          // ),
          clock: () => DateTime.now(),
          backgroundColor: Color(0xff1E1E26),
          hourHandColor: Colors.lightBlueAccent,
          minuteHandColor: Colors.lightBlueAccent,
          secondHandColor: Colors.amber,
          centerDotColor: Colors.amber,
          hourDashColor: Colors.lightBlue,
          minuteDashColor: Colors.blueAccent,
        ),
API Documentation

For detailed information about the classes and methods available in this package, refer to the API documentation.

Example

More examples can be found in the example/ folder.

License

This package is distributed under the MIT License. See the LICENSE file for details.

Contact

For questions, feedback, or suggestions regarding this package, please feel free to contact the author at [devhasanzaman@gmail.com](mailto:devhasanzaman@gmail.com).

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目