Search packages, repositories and app categories

flutter_alarm_clock cover
Package detailsv0.1.2

flutter_alarm_clock

A lightweight flutter package connecting android clock app intents.

Android
30-day downloads
171
Likes
79
Pub points
160

Install package

flutter pub add flutter_alarm_clock

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A lightweight Flutter package that enables integration with the Android system's clock app through intents. It allows Flutter applications to trigger or interact with native alarm functionalities on Android devices, facilitating seamless alarm management within apps. Designed specifically for Android, it leverages platform-specific features without requiring complex native code. The package is ideal for productivity, wellness, or reminder-based applications needing direct access to the device's alarm system.

Use cases

  • Scheduling reminders via native alarms
  • Integrating alarm functionality in wellness apps
  • Triggering alarms from within a Flutter app
  • Building task or habit tracking apps with alarm support
  • Enabling time-based notifications

Key features

  • Simple intent-based integration
  • Lightweight and minimal dependencies
  • Android-only platform support
  • Direct access to system alarm features
  • No need for background services

Suitable for

  • Developers building Android-focused reminder apps
  • Apps requiring native alarm interaction
  • Lightweight integrations with system features
  • Flutter projects targeting Android devices only
  • Users seeking minimal setup for alarm triggers

Considerations

  • Limited to Android platforms
  • Requires Android system permissions
  • Depends on device-specific clock app availability
  • May not work consistently across all Android versions
  • No iOS support

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Android Alarm Clock Plugin for Flutter

pub package

This plugin allows Flutter apps to operate with the default clock application when the platform is Android. Provides a lightweight wrapper around clock app intents. It uses Android intents to communicate with the default clock app.

Currently supported features

  • Create new Alarms
  • Create new Timers
  • Open default Clock app showing Alarms
  • Open default Clock app showing Timers

Usage

Create an Alarm

Create a new alarm. Function arguments:
'hour' specifies alarm hour
'minutes' specifies alarm minutes
'title' specifies alarm title - optional
'skipUi' specifies whether clock app should open or not - optional

// Creates an alarm at 23:59
FlutterAlarmClock.createAlarm(hour: 23, minutes: 59);
Create a Timer

Create a new timer. Function arguments:
'length' specifies timer length in seconds
'title' specifies timer title - optional
'skipUi' specifies whether clock app should open or not - optional

// Creates a timer for 42 seconds
FlutterAlarmClock.createTimer(length: 42);
Show Alarms

Opens default clock app showing alarms.

FlutterAlarmClock.showAlarms();
Show Timers

Opens default clock app showing timers.

FlutterAlarmClock.showTimers();

Feel free to add support for additional functionality.

Note that a similar method does not currently exist for iOS.

Platform Support

Android
✔️

Example App

Screenshot
screenshot
Code
import 'package:flutter/material.dart';
import 'package:flutter_alarm_clock/flutter_alarm_clock.dart';

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

/// {@template myApp}
/// A main class for the Flutter alarm clock example application.
/// {@endtemplate}
class MyApp extends StatefulWidget {
  /// @{@macro myApp}
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter alarm clock example'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              Container(
                margin: const EdgeInsets.all(25),
                child: TextButton(
                  child: const Text(
                    'Create alarm at 23:59',
                    style: TextStyle(fontSize: 20),
                  ),
                  onPressed: () {
                    FlutterAlarmClock.createAlarm(hour: 23, minutes: 59);
                  },
                ),
              ),
              Container(
                margin: const EdgeInsets.all(25),
                child: const TextButton(
                  onPressed: FlutterAlarmClock.showAlarms,
                  child: Text(
                    'Show alarms',
                    style: TextStyle(fontSize: 20),
                  ),
                ),
              ),
              Container(
                margin: const EdgeInsets.all(25),
                child: TextButton(
                  child: const Text(
                    'Create timer for 42 seconds',
                    style: TextStyle(fontSize: 20),
                  ),
                  onPressed: () {
                    FlutterAlarmClock.createTimer(length: 42);
                  },
                ),
              ),
              Container(
                margin: const EdgeInsets.all(25),
                child: const TextButton(
                  onPressed: FlutterAlarmClock.showTimers,
                  child: Text(
                    'Show Timers',
                    style: TextStyle(fontSize: 20),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Categories

Source repository

Projects using this package

No data available yet.