wear_ongoing_activity 0.1.3+1 copy "wear_ongoing_activity: ^0.1.3+1" to clipboard
wear_ongoing_activity: ^0.1.3+1 copied to clipboard

Create and maintain ongoing activity notifications on Wear OS

example/lib/main.dart

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

import 'package:wear_ongoing_activity/wear_ongoing_activity.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Permission.notification.request();

  await WearOngoingActivity.start(
    channelId: 'ongoing_activity',
    channelName: 'Ongoing Activity',
    notificationId: 12345,
    category: NotificationCategory.workout,
    smallIcon: 'ic_launcher',
    staticIcon: 'ic_launcher',
    status: OngoingActivityStatus(
      templates: [
        '#type#: #time#',
      ],
      parts: [
        TextPart(name: 'type', text: 'stuff'),
        StopwatchPart(name: 'time', timeZero: DateTime.now()),
      ],
    ),
  );

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: const Center(
          child: Text('Hello World'),
        ),
      ),
    );
  }
}
6
likes
0
pub points
59%
popularity

Publisher

verified publisherrexios.dev

Create and maintain ongoing activity notifications on Wear OS

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, json_annotation

More

Packages that depend on wear_ongoing_activity