Skip to content

Conversation

@Samo8
Copy link
Contributor

@Samo8 Samo8 commented Dec 19, 2025

Fixes #489

Implemented Parameters

backgroundColor - Dialog background color
titleColor - Title text color
mainTextColor - Main terms text color
acceptButtonTextColor - Accept button text color
cancelButtonTextColor - Cancel button text color

Not Implemented

Typography (Cross-platform)

More complex problem that can be handled in different PR
Title font (Android: setTitleTypeface(), iOS: titleFont)
Main text font (Android: setMainTextTypeface(), iOS: mainTextFont)
Button font (Android: setButtonsTypeface(), iOS: buttonsFont)

Text Sizes (Android only)

Android only can be handled in different PR
setTitleTextSize() - Title text size
setMainTextTextSize() - Main text size
setButtonsTextSize() - Button text size

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation
  • I added new tests to check the change I am making
  • All existing and new tests are passing.

@jokerttu jokerttu changed the title Feat/custom UI terms and conditions feat: custom UI terms and conditions Dec 22, 2025
Copy link
Contributor

@jokerttu jokerttu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Android version wasn’t building. I added a few suggestions that should resolve the Android build issues.

Native Navigation SDK for Android seems to have internal bug with uiParams as the background color always leaks outside of the panel where dropshadow should be.

There is example implementation of this feature to example pages, camera, navigation_without_map and turn_by_turn.
If possible it would be nice to have this on navigation and navigation_without_map example pages only to keep the example pages simple and as those are main navigation related example pages. What do you think?

Please add a new integration test in https://github.com/googlemaps/flutter-navigation-sdk/blob/main/example/integration_test/t02_session_test.dart
that verifies uiParams. Because the integration tests run on both platforms (Android emulator and iOS simulator), this should also help detect potential crashes in the native implementations.

iOS Test:
Image

Android Test (after suggested fixes):
Image

@Samo8 Samo8 requested a review from jokerttu January 2, 2026 08:32
@Samo8
Copy link
Contributor Author

Samo8 commented Jan 2, 2026

@jokerttu thanks for suggestions, all should be applied now

Copy link
Contributor

@jokerttu jokerttu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, once the suggested small improvement is included.

The default font sizes in TermsAndConditionsUIParams.Builder do not match those used in the standard TOS dialog. This change aligns the defaults to match the standard dialog.

it.acceptButtonTextColor?.let { color -> setAcceptButtonTextColor(color.toInt()) }
it.cancelButtonTextColor?.let { color -> setCancelButtonTextColor(color.toInt()) }
}
.build()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard code default text sizes on Android to match the default TOS dialog.

Suggested change
.build()
// TODO: Make text sizes configurable via TermsAndConditionsUIParamsDto.
// Currently hardcoded to match the Navigation SDK default values.
.setButtonsTextSize(14)
.setMainTextTextSize(14)
.setTitleTextSize(20)
.build()

Default TOS without TermsAndConditionsUIParams.
Image

With TermsAndConditionsUIParams before suggested changes:
Image

With TermsAndConditionsUIParams after suggested changes:
Image

@Samo8 Samo8 requested a review from jokerttu January 7, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request]: Add the ability to show custom UI for Google's Terms and Conditions

3 participants