basic_clocks 0.0.1 copy "basic_clocks: ^0.0.1" to clipboard
basic_clocks: ^0.0.1 copied to clipboard

Clock widgets

example/lib/main.dart

// ignore_for_file: avoid_print

import 'package:basic_clocks/clocks.dart';
import 'package:basic_clocks/data_models/clock_time.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(
    const MyApp(),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HomeView(),
    );
  }
}

class HomeView extends StatelessWidget {
  const HomeView({super.key});

  final timeOfDay = const TimeOfDay(hour: 3, minute: 20);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ClockWidget(
          size: const Size(250, 250),
          time: timeOfDay.toClockTime,
          pointyNeedle: true,
          onDrag: (updatedTime) {
            print(updatedTime.toStringTime);
          },
          showHoursLabels: true,
          clockThickness: 20,
          needleThickness: 20,
          dragSpeed: 0.3,
          color: Colors.black,
          backgroundColor: Colors.transparent,
        ),
      ),
    );
  }
}
1
likes
150
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

Clock widgets

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on basic_clocks