AnalogClock

A Flutter package for creating a customizable analog clock widget. Perfect for adding a classic timepiece look to your Flutter applications.

Features

Customizable clock face including circle width, height, and color. Adjustable hour, minute, and second hands with customizable colors. Support for setting the clock's background color, border width, and more. Easy integration and use in any Flutter app.

Installation

Add analog_clock to your pubspec.yaml file:

dependencies:

flutter:

sdk: flutter

analog_clock: ^1.0.0 # Replace with the latest version

Then run:

flutter pub get

Example

Here’s a simple example of how to use the AnalogClock widget:

https://gist.github.com/mari431/cb7aaace21292f8bc8af105922b87fc3

Customization

The AnalogClock widget allows various customizations:

  • circleWidth: Width of the clock face.
  • circleHeight: Height of the clock face.
  • oneToTwelveNumberColor: Color of the numbers on the clock face.
  • hourHandColor: Color of the hour hand.
  • minuteHandColor: Color of the minute hand.
  • secondHandColor: Color of the second hand.
  • backgroundColor: Background color of the clock.
  • circleBorderWidth: Border width of the clock face.
  • secondsDotsColor: Color of the second dots.
  • centerCircleWidth: Width of the center circle.
  • centerCircleHeight: Height of the center circle.
  • centerCircleColor: Color of the center circle.
  • clockNameFontSize: Font size of the clock name.
  • clockNameColor: Color of the clock name.
  • clockName: Text to display as the clock's name.
  • clockNamePositionTop: Vertical position of the clock name.
  • widthofhourHand1: Width of the hour hand1.
  • heightofhourHand1: Height of the hour hand1.
  • widthofhourHand2: Width of the hour hand2.
  • heightofhourHand2: Height of the hour hand2.
  • widthofMinutesHand1: Width of the minute hand1.
  • heightofMinutesHand1: Height of the minute hand1.
  • widthofMinutesHand2: Width of the minute hand2.
  • heightofMinutesHand2: Height of the minute hand2.
  • widthofSecondHand1: Width of the second hand1.
  • heightofSecondHand1: Height of the second hand1.
  • widthofSecondHand2: Width of the second hand2.
  • heightofSecondHand2: Height of the second hand2.

Contributing

Contributions are welcome! Please fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.

License

This package is licensed under the BSD 3-Clause License (https://pub.dev/packages/analog_mclock/license). See the LICENSE file for details.

Contact

For questions or support, please reach out to frontenddeveloper.marikkm@gmail.com.

Libraries

analog_mclock