v0.1.2flutter_alarm_clock
Android 시계 앱 인텐트를 연결하는 가벼운 플러터 패키지입니다.
Flutter용 Android 알람 시계 플러그인.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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.
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 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);
Opens default clock app showing alarms.
FlutterAlarmClock.showAlarms();
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.
| Android |
|---|
| ✔️ |
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),
),
),
),
],
),
),
),
);
}
}
의존성 목록 3 개
{"sdk":"flutter"}{"sdk":"flutter"}^5.0.0+1사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗