Allow users to update which types of notifications they would like to receive.
| Requirement | Reason |
|---|---|
Authentication
|
Needed to view preferences that belong to a user. |
The default CourierPreferences styles.
import 'package:courier_flutter/ui/preferences/courier_preferences.dart';
...
@override
Widget build(BuildContext context) {
return CourierPreferences(
mode: TopicMode(),
);
}
The styles you can use to quickly customize the CourierPreferences.
import 'package:courier_flutter/courier_preference_channel.dart';
import 'package:courier_flutter/ui/inbox/courier_inbox_theme.dart';
import 'package:courier_flutter/ui/preferences/courier_preferences_theme.dart';
import 'package:courier_flutter/ui/preferences/courier_preferences.dart';
...
final customTheme = CourierPreferencesTheme(
brandId: "YOUR_BRAND_ID",
topicSeparator: null,
sectionTitleStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Color(0xFF9747FF),
),
topicTitleStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.normal,
fontSize: 18,
),
topicSubtitleStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.normal,
fontSize: 16,
),
topicTrailing: const Icon(
Icons.edit_outlined,
color: Colors.black45,
),
sheetSeparator: null,
sheetTitleStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Color(0xFF9747FF),
),
sheetSettingStyles: SheetSettingStyles(
textStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.normal,
fontSize: 18,
),
activeTrackColor: Color(0xFF9747FF),
activeThumbColor: Colors.white,
inactiveTrackColor: Colors.black45,
inactiveThumbColor: Colors.white,
),
sheetShape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16.0),
),
),
infoViewStyle: CourierInfoViewStyle(
textStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.bold,
fontSize: 16,
),
buttonStyle: FilledButton.styleFrom(
backgroundColor: Colors.grey,
foregroundColor: Colors.white,
textStyle: GoogleFonts.sen().copyWith(
fontWeight: FontWeight.normal,
fontSize: 16,
),
),
),
);
...
@override
Widget build(BuildContext context) {
return CourierPreferences(
// keepAlive: true, // Useful if you are adding this widget to a TabBarView
lightTheme: customTheme,
darkTheme: customTheme,
mode: ChannelsMode(channels: [CourierUserPreferencesChannel.push, CourierUserPreferencesChannel.sms, CourierUserPreferencesChannel.email]),
onError: (error) => print(error),
);
}
You can control your branding from the Courier Studio.
| Supported Brand Styles | Support |
|---|---|
Primary Color |
✅ |
Show/Hide Courier Footer |
✅ |
👋 Branding APIs can be found here
👋 Preference APIs can be found here
