creta_device_watch 1.0.0+1
creta_device_watch: ^1.0.0+1 copied to clipboard
Watch for Creta devices
Creta Device Watch Widget #
A Flutter widget to display a digital clock. This package is designed to be used as a part of the Creta ecosystem.
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
creta_device_watch:
git:
url: https://github.com/your-repo/watch.git # Replace with your actual git repository
ref: main
Usage #
Here is a basic example of how to use CretaDeviceWatchWidget.
You need to initialize the library before running your app. This is typically done in your main.dart file.
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:creta_device_watch/creta_device_watch.dart';
void main() async {
// Ensure that Flutter bindings are initialized.
WidgetsFlutterBinding.ensureInitialized();
// Initialize the CretaDeviceWatch library.
await initializeCretaDeviceWatch();
runApp(
// The widget needs to be wrapped in a ProviderScope for state management.
const ProviderScope(
child: MyApp(),
),
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: CretaDeviceWatchWidget(
// You can customize the widget with these properties
width: 800,
height: 200,
showBorder: true,
alarmTimes: [
'2025/06/10 18:01',
'2025/06/10 18:02',
],
),
),
),
);
}
}