mirror of
https://github.com/Iconica-Development/flutter_notification_center.git
synced 2025-05-19 00:53:44 +02:00
46 lines
1.3 KiB
Dart
46 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_notification_center/flutter_notification_center.dart';
|
|
|
|
void main() {
|
|
runApp(
|
|
const MaterialApp(
|
|
home: NotificationCenterDemo(),
|
|
),
|
|
);
|
|
}
|
|
|
|
class NotificationCenterDemo extends StatelessWidget {
|
|
const NotificationCenterDemo({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Notification Center'),
|
|
centerTitle: true,
|
|
),
|
|
body: NotificationCenter(
|
|
key: key,
|
|
notificationCenterService:
|
|
LocalNotificationService(listOfActiveNotifications: [
|
|
NotificationModel(
|
|
id: 1,
|
|
title: 'Notification title 1',
|
|
body: 'Notification body 1',
|
|
dateTimePushed: DateTime.now(),
|
|
),
|
|
NotificationModel(
|
|
id: 2,
|
|
title: 'Notification title 2',
|
|
body: 'Notification body 2',
|
|
dateTimePushed: DateTime.now(),
|
|
),
|
|
]),
|
|
notificationTheme: const NotificationStyle(
|
|
titleTextStyle: TextStyle(color: Colors.red, fontSize: 20),
|
|
subtitleTextStyle: TextStyle(color: Colors.blue, fontSize: 16),
|
|
subtitleTextAlign: TextAlign.end),
|
|
));
|
|
}
|
|
}
|