搜尋分類、套件與程式碼儲存庫

animated_analog_clock 封面
套件詳情v0.2.2

animated_analog_clock

一個可自定義且帶動畫效果的類比時鐘小部件,適用於 Flutter 應用程式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
266
喜歡數
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 項

原始碼儲存庫

使用此套件的專案