add presence to example app

This commit is contained in:
Salvatore Giordano
2020-07-08 14:53:02 +02:00
parent 1f226f33c8
commit 86ea7b7e28
+5 -1
View File
@@ -67,7 +67,7 @@ void _initNotifications(Client client) {
void main() async { void main() async {
final client = Client( final client = Client(
's2dxdhpxd94g', 's2dxdhpxd94g',
logLevel: Level.INFO, logLevel: Level.FINEST,
showLocalNotification: Platform.isAndroid ? showLocalNotification : null, showLocalNotification: Platform.isAndroid ? showLocalNotification : null,
persistenceEnabled: true, persistenceEnabled: true,
); );
@@ -91,6 +91,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
// debugShowMaterialGrid: true, // debugShowMaterialGrid: true,
// debugShowCheckedModeBanner: false,
theme: ThemeData.light(), theme: ThemeData.light(),
darkTheme: ThemeData.dark(), darkTheme: ThemeData.dark(),
themeMode: ThemeMode.system, themeMode: ThemeMode.system,
@@ -116,6 +117,9 @@ class ChannelListPage extends StatelessWidget {
'\$in': [StreamChat.of(context).user.id], '\$in': [StreamChat.of(context).user.id],
} }
}, },
options: {
'presence': true,
},
sort: [SortOption('last_message_at')], sort: [SortOption('last_message_at')],
pagination: PaginationParams( pagination: PaginationParams(
limit: 20, limit: 20,