PostHog / PostHog/posthog-flutter
feat(surveys): Support custom fontFamily in survey appearance
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 97
- Forks
- 85
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 31
Description
Summary
The Flutter SDK has built-in survey UI but doesn't apply the fontFamily from survey appearance settings.
Current State
PostHogDisplaySurveyAppearanceincludesfontFamilyfield- Built-in survey widgets use hardcoded
TextStylewithoutfontFamily - The data is parsed but not used
Expected Behavior
When a survey is configured with a custom fontFamily, the built-in survey UI should apply that font (if available/bundled in the app), falling back to system default if not found.
Reference Implementation
See posthog-ios SurveySheet.swift:
static func customFont(family: String) -> Font? {
if let uiFont = UIFont(name: family, size: UIFont.systemFontSize) {
return Font(uiFont)
}
return nil // Falls back to system default
}
Implementation Notes
- Pass
fontFamilytoTextStylein survey widgets (e.g.,question_header.dart,survey_button.dart, etc.) - Font must be declared in
pubspec.yamland bundled with the app - Fall back to system default if font not found
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the survey widgets named in the issue, including question_header.dart and survey_button.dart, and trace how PostHogDisplaySurveyAppearance.fontFamily reaches them. Apply the configured family through each relevant TextStyle, preserving the system default when the font is unavailable. Confirm the behavior with a bundled font and with an unavailable font.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100