Chat
CleverPush Chat View
- Import the Chat View:
import 'package:cleverpush_flutter/cleverpush_chat_view.dart';
- Add the Chat View:
return new Scaffold(
appBar: AppBar(
title: const Text('Chat View'),
),
body: new Container(
child: CleverPushChatView(
),
),
);
Handle opened URLs in the chat:
CleverPush.shared.setChatUrlOpenedHandler((url) {
Widget continueButton = TextButton(
child: Text("Ok"),
onPressed: () => Navigator.pop(context, 'Ok'),
);
showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Chat URL opened'),
content: Text(url),
actions: <Widget>[
continueButton,
],
),
);
});
Change the primary branding color:
CleverPush.shared.setBrandingColor("#ff0000")