From c68488ad8d515ea44831eb15b9c0353630da8ffa Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Mon, 20 Feb 2023 17:29:54 +0100 Subject: [PATCH] Add policy page --- assets/files/policy_page.html | 111 ++++++++++++++++++++++++++ assets/files/policy_text.text | 98 +++++++++++++++++++++++ lib/Screens/Policy/policy_screen.dart | 83 +++++++++++++++++++ lib/Screens/Policy/web_view.dart | 67 ++++++++++++++++ lib/main.dart | 4 +- 5 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 assets/files/policy_page.html create mode 100644 assets/files/policy_text.text create mode 100644 lib/Screens/Policy/policy_screen.dart create mode 100644 lib/Screens/Policy/web_view.dart diff --git a/assets/files/policy_page.html b/assets/files/policy_page.html new file mode 100644 index 0000000..a17407b --- /dev/null +++ b/assets/files/policy_page.html @@ -0,0 +1,111 @@ +

Privacy Policy

+

Effective date: 2023-02-20

+

Updated on: 2023-02-20

+

+ This Privacy Policy explains the policies of UNOV on the collection + and use of the information we collect when you access https://fortsaintheribert.mymuseum.be/ (the “Service”). This Privacy Policy describes your + privacy rights and how you are protected under privacy laws.

+

+ By using our Service, you are consenting to the collection and use of your information in accordance + with this Privacy Policy. Please do not access or use our Service if you do not consent to the collection + and use of your information as outlined in this Privacy Policy. This Privacy Policy has been created with + the help of CookieScript Privacy Policy Generator.

+

UNOV is authorized to modify this Privacy Policy at any time. + This may occur without prior notice.

+

+ UNOV will post the revised Privacy Policy on the https://fortsaintheribert.mymuseum.be/ website

+ +

Collection and Use of Your Personal Information

+

Information We Collect

+

+ When using our Service, you will be prompted to provide us with personal information used to + contact or identify you. https://fortsaintheribert.mymuseum.be/ collects the following information:

+ + + +

Usage Data includes the following:

+ + +

How We Collect Information

+

+ https://fortsaintheribert.mymuseum.be/ collects and receives information from you in the following manner:

+ +

+ Your information will be stored for up to 1 days after it is + no longer required to provide you the services. Your information may be retained for longer periods for + reporting or record- keeping in accordance with applicable laws. Information which does not identify you + personally may be stored indefinitely.

+ +

How We Use Your Information

+

+ https://fortsaintheribert.mymuseum.be/ may use your information for the following purposes:

+ + +

How We Share Your Information

+

+ UNOV will share your information, when applicable, in the following situations:

+ + +

Third-party Sharing

+ +

Your information may be disclosed for additional reasons, including:

+ + +

Cookies

+

+ Cookies are small text files that are placed on your computer by websites that you visit. Websites use + cookies to help users navigate efficiently and perform certain functions. Cookies that are required for + the website to operate properly are allowed to be set without your permission. All other cookies need + to be approved before they can be set in the browser.

+ + + +

Security

+

+ Your information’s security is important to us. https://fortsaintheribert.mymuseum.be/ + utilizes a range of security measures to prevent the misuse, loss, or alteration of the information you have given us. + However, because we cannot guarantee the security of the information you provide us, you must access our service at your + own risk.

+

+ UNOV is not responsible for the performance of websites + operated by third parties or your interactions with them. When you leave this website, we recommend you review the + privacy practices of other websites you interact with and determine the adequacy of those practices.

+ +

Contact Us

+

For any questions, please contact us through the following methods:

+

Name: UNOV

+

Address: Rue Mazy 72

+

Email: contact@unov.be

+

Website: https://fortsaintheribert.mymuseum.be/

+ + +

+ For any queries or concerns you have related to the processing of your information, + you may contact our Privacy Officer at Fransolet Thomas, contact@unov.be.

+ diff --git a/assets/files/policy_text.text b/assets/files/policy_text.text new file mode 100644 index 0000000..d3b3be5 --- /dev/null +++ b/assets/files/policy_text.text @@ -0,0 +1,98 @@ +PRIVACY POLICY + +Effective date: 2023-02-20 + +Updated on: 2023-02-20 + +This Privacy Policy explains the policies of UNOV on the collection and use of the information we collect when you access https://fortsaintheribert.mymuseum.be/ +(the “Service”). This Privacy Policy describes your privacy rights and how you are protected under privacy laws. + +By using our Service, you are consenting to the collection and use of your information in accordance with this Privacy Policy. Please do not access or use our +Service if you do not consent to the collection and use of your information as outlined in this Privacy Policy. This Privacy Policy has been created with the +help of CookieScript Privacy Policy Generator. + +UNOV is authorized to modify this Privacy Policy at any time. This may occur without prior notice. + +UNOV will post the revised Privacy Policy on the https://fortsaintheribert.mymuseum.be/ website + + +COLLECTION AND USE OF YOUR PERSONAL INFORMATION + +INFORMATION WE COLLECT + +When using our Service, you will be prompted to provide us with personal information used to contact or identify you. https://fortsaintheribert.mymuseum.be/ +collects the following information: + + * Usage Data + +Usage Data includes the following: + + * Internet Protocol (IP) address of computers accessing the site + * Web page requests + * Referring web pages + * Browser used to access site + * Time and date of access + +HOW WE COLLECT INFORMATION + +https://fortsaintheribert.mymuseum.be/ collects and receives information from you in the following manner: + + * When you fill a registration form or otherwise submit your personal information. + +Your information will be stored for up to 1 days after it is no longer required to provide you the services. Your information may be retained for longer periods +for reporting or record- keeping in accordance with applicable laws. Information which does not identify you personally may be stored indefinitely. + +HOW WE USE YOUR INFORMATION + +https://fortsaintheribert.mymuseum.be/ may use your information for the following purposes: + + * Providing and maintaining our Service, as well as monitoring the usage of our Service. + * For other purposes. UNOV will use your information for data analysis to identify usage trends or determine the effective of our marketing campaigns when + reasonable. We will use your information to evaluate and improve our Service, products, services, and marketing efforts. + * Show content based on location + +HOW WE SHARE YOUR INFORMATION + +UNOV will share your information, when applicable, in the following situations: + + * With your consent. UNOV will share your information for any purpose with your explicit consent. + +THIRD-PARTY SHARING + +Your information may be disclosed for additional reasons, including: + + * Complying with applicable laws, regulations, or court orders. + * Responding to claims that your use of our Service violates third-party rights. + * Enforcing agreements you make with us, including this Privacy Policy. + +COOKIES + +Cookies are small text files that are placed on your computer by websites that you visit. Websites use cookies to help users navigate efficiently and perform +certain functions. Cookies that are required for the website to operate properly are allowed to be set without your permission. All other cookies need to be +approved before they can be set in the browser. + + * Strictly necessary cookies. Strictly necessary cookies allow core website functionality such as user login and account management. The website cannot be used + properly without strictly necessary cookies. + +SECURITY + +Your information’s security is important to us. https://fortsaintheribert.mymuseum.be/ utilizes a range of security measures to prevent the misuse, loss, or +alteration of the information you have given us. However, because we cannot guarantee the security of the information you provide us, you must access our +service at your own risk. + +UNOV is not responsible for the performance of websites operated by third parties or your interactions with them. When you leave this website, we recommend you +review the privacy practices of other websites you interact with and determine the adequacy of those practices. + +CONTACT US + +For any questions, please contact us through the following methods: + +Name: UNOV + +Address: Rue Mazy 72 + +Email: contact@unov.be + +Website: https://fortsaintheribert.mymuseum.be/ + +For any queries or concerns you have related to the processing of your information, you may contact our Privacy Officer at Fransolet Thomas, contact@unov.be. \ No newline at end of file diff --git a/lib/Screens/Policy/policy_screen.dart b/lib/Screens/Policy/policy_screen.dart new file mode 100644 index 0000000..7b59851 --- /dev/null +++ b/lib/Screens/Policy/policy_screen.dart @@ -0,0 +1,83 @@ +import 'dart:ui' as ui; +import 'dart:html'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:manager_app/Components/loading.dart'; +import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Screens/Policy/web_view.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:provider/provider.dart'; + +class PolicyScreen extends StatefulWidget { + PolicyScreen({Key key}) : super(key: key); + + @override + _PolicyScreenState createState() => _PolicyScreenState(); +} + +class _PolicyScreenState extends State { + final IFrameElement _iframeElement = IFrameElement(); + String filePath2 = 'files/policy_page.html'; + String filePath = 'files/policy_text.text'; + + @override + Widget build(BuildContext context) { + final appContext = Provider.of(context); + Size size = MediaQuery.of(context).size; + + return Scaffold( + body: FutureBuilder( + future: getHTML(), + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + return Container( + width: size.width * 0.9, + height: size.height, + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Center(child: Text(snapshot.data)), + ], + ), + ), + ) + /*child: WebView(htmlText: snapshot.data))*/ + ); + } else if (snapshot.connectionState == ConnectionState.none) { + return Text("No data"); + } else { + return Center( + child: Container( + height: size.height * 0.2, + child: LoadingCommon() + ) + ); + } + } + )); + } + + _loadHtmlFromAssets() async { + String fileHtmlContents = await rootBundle.loadString(filePath); + + /*if(kIsWeb) { + _iframeElement.src = fileHtmlContents; + _iframeElement.style.border = 'none'; + + //ignore: undefined_prefixed_name + ui.platformViewRegistry.registerViewFactory( + _loadHtmlFromAssets(), //use source as registered key to ensure uniqueness + (int viewId) => _iframeElement, + ); + }*/ + return fileHtmlContents; + } + + Future getHTML() async { + return await rootBundle.loadString(filePath); + } +} \ No newline at end of file diff --git a/lib/Screens/Policy/web_view.dart b/lib/Screens/Policy/web_view.dart new file mode 100644 index 0000000..5ef08c7 --- /dev/null +++ b/lib/Screens/Policy/web_view.dart @@ -0,0 +1,67 @@ +import 'dart:html'; +import 'dart:ui' as ui; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +class WebView extends StatefulWidget { + WebView({this.htmlText}); + + final String htmlText; + + @override + _WebViewWidget createState() => _WebViewWidget(); +} + +class _WebViewWidget extends State { + final IFrameElement _iframeElement = IFrameElement(); + + @override + void initState() { + + if(kIsWeb) { + _iframeElement.src = "https://mymuseum.be"; + _iframeElement.style.border = 'none'; + _iframeElement.style.width = '100%'; + _iframeElement.style.height = '100%'; + + _iframeElement.innerHtml = widget.htmlText; + + document.body.innerHtml = widget.htmlText; + //document.title = "Privacy Policy"; + //document.body. = widget.htmlText; + + + _iframeElement.onLoad.listen((event) { + // Send message to iframe when loaded + _iframeElement.innerHtml = widget.htmlText; + }); + + //ignore: undefined_prefixed_name + ui.platformViewRegistry.registerViewFactory( + widget.htmlText, //use source as registered key to ensure uniqueness + (int viewId) => _iframeElement, + ); + } + + super.initState(); + } + + @override + void dispose() { + //_webView = null; + super.dispose(); + } + + + @override + Widget build(BuildContext context) => widget.htmlText != null && widget.htmlText.length > 0 ? + kIsWeb ? + HtmlElementView( + key: UniqueKey(), + viewType: widget.htmlText, + ) : + //WebViewWidget(controller: controller!) + Text("Texte"): + Center(child: Text("La page internet ne peut pas être affichée, l'url est incorrecte ou vide")); +} //_webView \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index a7408f9..40106cf 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,7 @@ import 'package:provider/provider.dart'; import 'Helpers/FileHelper.dart'; import 'Models/session.dart'; import 'Screens/login_screen.dart'; +import 'Screens/Policy/policy_screen.dart'; import 'app_context.dart'; import 'constants.dart'; //import 'package:window_size/window_size.dart'; @@ -63,7 +64,8 @@ class _MyAppState extends State { ), routes: { '/welcome': (context) => LoginScreen(session: widget.session), - '/main': (context) => MainScreen() + '/main': (context) => MainScreen(), + '/policy': (context) => PolicyScreen(), } ), );