diff --git a/Frontend/lib/mih_packages/calculator/package_tools/currency_exchange_rate.dart b/Frontend/lib/mih_packages/calculator/package_tools/currency_exchange_rate.dart index 762dbc5f..7982cc89 100644 --- a/Frontend/lib/mih_packages/calculator/package_tools/currency_exchange_rate.dart +++ b/Frontend/lib/mih_packages/calculator/package_tools/currency_exchange_rate.dart @@ -1,3 +1,4 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; @@ -157,6 +158,97 @@ class _CurrencyExchangeRateState extends State { ); } + void displayDisclaimer() { + final String companyName = 'Mzansi Innovation Hub'; + + showDialog( + context: context, + builder: (context) => MihPackageWindow( + fullscreen: false, + windowTitle: "Disclaimer Notice", + onWindowTapClose: () { + Navigator.pop(context); + }, + windowBody: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Main Title + + Text( + 'Disclaimer of Warranty and Limitation of Liability for Forex Calculator', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 25, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontWeight: FontWeight.bold, + ), + ), + + const SizedBox(height: 24.0), + + // First Paragraph - using RichText to bold "the Tool" + _buildRichText( + 'The Forex Calculator feature ("', + 'the Tool', + '") is provided on an "as is" and "as available" basis. It is an experimental feature and is intended solely for informational and illustrative purposes.', + ), + const SizedBox(height: 16.0), + + // Second Paragraph + Text( + '$companyName makes no representations or warranties of any kind, express or implied, as to the accuracy, completeness, reliability, or suitability of the information and calculations generated by the Tool. All exchange rates and results are estimates and are subject to change without notice.', + style: TextStyle( + fontSize: 15, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontWeight: FontWeight.normal, + ), + ), + const SizedBox(height: 16.0), + + // Third Paragraph + Text( + 'The information provided by the Tool should not be construed as financial, investment, trading, or any other form of advice. You should not make any financial decisions based solely on the output of this Tool. We expressly recommend that you seek independent professional advice and verify all data with a qualified financial advisor and/or through alternative, reliable market data sources before executing any foreign exchange transactions.', + style: TextStyle( + fontSize: 15, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontWeight: FontWeight.normal, + ), + ), + const SizedBox(height: 16.0), + + // Fourth Paragraph + Text( + 'By using the Tool, you agree that $companyName, its affiliates, directors, and employees shall not be held liable for any direct, indirect, incidental, special, consequential, or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data, or other intangible losses, resulting from: (i) the use or the inability to use the Tool; (ii) any inaccuracies, errors, or omissions in the Tool\'s calculations or data; or (iii) any reliance placed by you on the information provided by the Tool.', + style: TextStyle( + fontSize: 15, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontWeight: FontWeight.normal, + ), + ), + ], + ), + ), + ); + } + + Widget _buildRichText(String start, String bold, String end) { + return RichText( + text: TextSpan( + style: TextStyle( + fontSize: 15, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontWeight: FontWeight.normal, + ), + children: [ + TextSpan(text: start), + TextSpan( + text: bold, style: const TextStyle(fontWeight: FontWeight.bold)), + TextSpan(text: end), + ], + ), + ); + } + @override void dispose() { super.dispose(); @@ -240,6 +332,38 @@ class _CurrencyExchangeRateState extends State { }, requiredText: true, ), + const SizedBox(height: 15), + RichText( + textAlign: TextAlign.left, + text: TextSpan( + style: TextStyle( + fontSize: 15, + color: MzanziInnovationHub.of(context)! + .theme + .errorColor(), + ), + children: [ + const TextSpan( + text: + "* Experimental Feature: Please review "), + TextSpan( + text: "Diclaimer", + style: TextStyle( + decoration: TextDecoration.underline, + color: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + fontWeight: FontWeight.bold, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + displayDisclaimer(); + }, + ), + const TextSpan(text: " before use."), + ], + ), + ), const SizedBox(height: 25), Center( child: Wrap(