Skip to content

Commit b5df063

Browse files
committed
feat: adding T&C customization to examples
1 parent 3346f82 commit b5df063

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

example/lib/pages/camera.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ class _CameraPageState extends ExamplePageState<CameraPage> {
6060
await GoogleMapsNavigator.showTermsAndConditionsDialog(
6161
'test_title',
6262
'test_company_name',
63+
uiParams: const TermsAndConditionsUIParams(
64+
backgroundColor: Color(0xFFF5F5F5),
65+
titleColor: Color(0xFF1976D2),
66+
mainTextColor: Color(0xFF212121),
67+
acceptButtonTextColor: Color(0xFF4CAF50),
68+
cancelButtonTextColor: Color(0xFFF44336),
69+
),
6370
);
6471
}
6572
await GoogleMapsNavigator.initializeNavigationSession();

example/lib/pages/navigation_without_map.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ class _NavigationWithoutMapPageState
8080
companyName,
8181
shouldOnlyShowDriverAwarenessDisclaimer:
8282
shouldOnlyShowDriverAwarenessDisclaimer,
83+
uiParams: const TermsAndConditionsUIParams(
84+
backgroundColor: Color(0xFFECEFF1),
85+
titleColor: Color(0xFF01579B),
86+
mainTextColor: Color(0xFF263238),
87+
acceptButtonTextColor: Color(0xFF00695C),
88+
cancelButtonTextColor: Color(0xFFD32F2F),
89+
),
8390
);
8491
showMessage(accepted ? 'Terms accepted' : 'Terms not accepted');
8592
setState(() {

example/lib/pages/turn_by_turn.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ class _TurnByTurnPageState extends ExamplePageState<TurnByTurnPage> {
4747
await GoogleMapsNavigator.showTermsAndConditionsDialog(
4848
'test_title',
4949
'test_company_name',
50+
uiParams: const TermsAndConditionsUIParams(
51+
backgroundColor: Color(0xFFFAFAFA),
52+
titleColor: Color(0xFF0D47A1),
53+
mainTextColor: Color(0xFF212121),
54+
acceptButtonTextColor: Color(0xFF1B5E20),
55+
cancelButtonTextColor: Color(0xFFB71C1C),
56+
),
5057
);
5158
}
5259

example/lib/utils/terms_of_service.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,20 @@
1414

1515
// ignore_for_file: public_member_api_docs
1616

17+
import 'package:flutter/material.dart';
1718
import 'package:google_navigation_flutter/google_navigation_flutter.dart';
1819

1920
Future<bool> requestTermsAndConditionsAcceptance() async {
2021
return (await GoogleMapsNavigator.areTermsAccepted()) ||
2122
(await GoogleMapsNavigator.showTermsAndConditionsDialog(
2223
'Example title',
2324
'Example company',
25+
uiParams: const TermsAndConditionsUIParams(
26+
backgroundColor: Color(0xFFFFFFFF),
27+
titleColor: Color(0xFF1565C0),
28+
mainTextColor: Color(0xFF424242),
29+
acceptButtonTextColor: Color(0xFF2E7D32),
30+
cancelButtonTextColor: Color(0xFFC62828),
31+
),
2432
));
2533
}

0 commit comments

Comments
 (0)