custom_analog_time_picker 1.0.1 copy "custom_analog_time_picker: ^1.0.1" to clipboard
custom_analog_time_picker: ^1.0.1 copied to clipboard

A 24-hour analog time picker dialog for Flutter with operational hours filtering, custom styling, and overnight shift support.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:custom_analog_time_picker/custom_analog_time_picker.dart';

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

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

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

class ExampleHomeScreen extends StatefulWidget {
  const ExampleHomeScreen({super.key});

  @override
  State<ExampleHomeScreen> createState() => _ExampleHomeScreenState();
}

class _ExampleHomeScreenState extends State<ExampleHomeScreen> {
  TimeOfDay? _selectedTime;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Custom Time Picker Example')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              _selectedTime != null
                  ? 'Selected: ${_selectedTime!.format(context)}'
                  : 'No time selected',
              style: const TextStyle(fontSize: 18),
            ),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () async {
                final result = await showCustomTimePicker(
                  context: context,
                  initialTime: TimeOfDay.now(),
                  startActiveHour: 8,
                  startActiveMinute: 30,
                  endActiveHour: 17,
                  endActiveMinute: 45,
                );
                if (result != null) {
                  setState(() {
                    _selectedTime = result;
                  });
                }
              },
              child: const Text('Open Time Picker'),
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
160
points
102
downloads

Documentation

API reference

Publisher

verified publisherdev.seka.my.id

Weekly Downloads

A 24-hour analog time picker dialog for Flutter with operational hours filtering, custom styling, and overnight shift support.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on custom_analog_time_picker