flutter_novu 1.0.1
flutter_novu: ^1.0.1 copied to clipboard
Novu's Flutter SDK for building custom inbox notification experiences.
import 'package:flutter/material.dart';
import 'package:flutter_novu/flutter_novu.dart';
void main() async {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Novu Inbox Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: InboxScreen(),
);
}
}
class InboxScreen extends StatefulWidget {
const InboxScreen({super.key});
@override
_InboxScreenState createState() => _InboxScreenState();
}
class _InboxScreenState extends State<InboxScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Inbox'),
backgroundColor: Colors.blue,
leading: Column(
children: [
Inbox(applicationIdentifier: 'applicationIdentifier', subscriberId: 'subscriberId')
],
),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
children: [
Text(
'Novu Inbox Example',
style: Theme.of(context).textTheme.headlineMedium,
),
SizedBox(height: 20),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(
'Inbox widget will be displayed here',
style: TextStyle(fontSize: 16),
),
),
),
),
],
),
),
);
}
}