パッケージ、リポジトリ、アプリカテゴリを検索

flutter_alarm_clock のカバー
パッケージ詳細v0.1.2

flutter_alarm_clock

Android クロックアプリのインテントを接続する軽量なFlutterパッケージ。

Android
30日間ダウンロード
171
いいね数
79
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_alarm_clock

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Androidシステムの時計アプリとの統合をインテントを通じて可能にする軽量なFlutterパッケージです。FlutterアプリがAndroidデバイスのネイティブなアラーム機能をトリガーまたは操作できるようにし、アプリ内でのスムーズなアラーム管理を実現します。Android専用に設計されており、複雑なネイティブコードを必要とせずにプラットフォーム固有の機能を利用しています。生産性、ウェルネス、リマインダー系アプリにおいて、デバイスのアラームシステムへの直接アクセスが必要な場合に最適です。

用途

  • ネイティブなアラームによるリマインダーのスケジュール設定
  • ウェルネスアプリにアラーム機能を統合する
  • Flutter アプリ内からアラームをトリガーする
  • アラーム対応のタスクまたは習慣トラッキングアプリの構築
  • 時刻ベースの通知を有効にする

主な機能

  • シンプルな意図ベースの統合
  • 軽量で最小限の依存関係
  • Android専用のプラットフォームサポート
  • システムアラーム機能への直接アクセス
  • バックグラウンドサービスの必要なし

適している対象

  • Android向けリマインダー・アプリを開発している開発者
  • ネイティブなアラーム操作を必要とするアプリ
  • システム機能との軽量統合
  • Android デバイス専用の Flutter プロジェクト
  • アラームトリガーの最小構成を希望するユーザー

注意事項

  • Android プラットフォームに限定
  • Android システム権限が必要です
  • デバイス固有の時計アプリの利用可能性に依存します
  • すべての Android バージョンで一貫して動作しない可能性があります
  • iOS 対応なし

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。