diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 08e67bd..ee38491 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -70,14 +70,12 @@ PODS: - "GoogleUtilities/NSData+zlib (~> 6.2)" - Protobuf (>= 3.9.2, ~> 3.9) - Flutter (1.0.0) - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) - - geolocator (5.3.0): + - geolocator (5.3.1): - Flutter - - google_api_availability (2.0.3): + - google_api_availability (2.0.4): - Flutter - google_maps_flutter (0.0.1): - Flutter @@ -130,7 +128,7 @@ PODS: - Flutter - Protobuf (3.10.0) - Reachability (3.2) - - share (0.5.2): + - share (0.0.1): - Flutter - shared_preferences (0.0.1): - Flutter @@ -156,7 +154,6 @@ DEPENDENCIES: - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`) - Flutter (from `Flutter`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - geolocator (from `.symlinks/plugins/geolocator/ios`) - google_api_availability (from `.symlinks/plugins/google_api_availability/ios`) - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) @@ -207,8 +204,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_remote_config/ios" Flutter: :path: Flutter - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" geolocator: :path: ".symlinks/plugins/geolocator/ios" google_api_availability: @@ -258,11 +253,10 @@ SPEC CHECKSUMS: FirebaseMessaging: 35edef69a6af9b34e9e44624089f054be3c09089 FirebaseRemoteConfig: 47abf7a04a9082091955ea555aa79cfdd249b19c Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_plugin_android_lifecycle: 47de533a02850f070f5696a623995e93eddcdb9b FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - geolocator: 7cdcf71180b80913b3cd84ab715d3b5365b378af - google_api_availability: 526574c9a5a0ae541e18c65f98e47afc11f53c8b - google_maps_flutter: d0dd62f5a7d39bae61057eb9f52dd778d99c7c6c + geolocator: 460cc8e850b616f8c0e90944c86517d91ccbb686 + google_api_availability: 15fa42a8cd83c0a6738507ffe6e87096f12abcb8 + google_maps_flutter: 78a52114c898b42ea647919679a4c58b70abe876 GoogleAppMeasurement: 434cc7be25e71dc04b8d0e3079125127b330e84a GoogleDataTransport: 166f9b9f82cbf60a204e8fe2daa9db3e3ec1fb15 GoogleDataTransportCCTSupport: f6ab1962e9dc05ab1fb938b795e5b310209edeec @@ -270,20 +264,20 @@ SPEC CHECKSUMS: GoogleUtilities: f895fde57977df4e0233edda0dbeac490e3703b6 location_permissions: 4a49d4e5bec5b653643e551ab77963cc99bb0e4a nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 - package_info: 48b108e75b8802c2d5e126f208ef540561c98aef - path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d + package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 Protobuf: a4dc852ad69c027ca2166ed287b856697814375b Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - share: bae0a282aab4483288913fc4dc0b935d4b491f2e - shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01 + share: 0b2c3e82132f5888bccca3351c504d0003b3b410 + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 - url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - webview_flutter: bec7599de6bfbe8008a739aa3ebd7b364ea9d0cd + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83 diff --git a/lib/page/screen/news_detail_screen.dart b/lib/page/screen/news_detail_screen.dart index aad0ca4..2104a9c 100644 --- a/lib/page/screen/news_detail_screen.dart +++ b/lib/page/screen/news_detail_screen.dart @@ -1,22 +1,13 @@ import 'dart:convert'; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html/flutter_html.dart'; -import 'package:flutter_html/rich_text_parser.dart'; +import 'package:intl/intl.dart'; import 'package:selftrackingapp/models/message_type.dart'; import 'package:selftrackingapp/models/news_article.dart'; -import 'package:selftrackingapp/networking/api_client.dart'; -import 'package:selftrackingapp/theme.dart'; -import 'package:selftrackingapp/widgets/custom_text.dart'; import 'package:share/share.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import '../../app_localizations.dart'; - -import 'package:intl/intl.dart'; - DateFormat dateFormat = DateFormat("dd-MM-yy HH:mm"); class NewsDetailScreen extends StatefulWidget { @@ -29,10 +20,24 @@ class NewsDetailScreen extends StatefulWidget { } class _NewsDetailScreenState extends State { + String _initialUrl; + @override void initState() { super.initState(); - print(widget.article.message); + + // Adding meta so that it displays the correct size in iOS + // setting sans-serif font to the content + var content = """ + + + + ${widget.article.message} + + """; + _initialUrl = Uri.dataFromString(content, + mimeType: 'text/html', encoding: Encoding.getByName('utf-8')) + .toString(); } void _shareArticle(NewsArticle article) { @@ -157,11 +162,7 @@ class _NewsDetailScreenState extends State { Divider(), Expanded( child: WebView( - initialUrl: Uri.dataFromString( - widget.article.message, - mimeType: 'text/html', - encoding: Encoding.getByName('utf-8')) - .toString(), + initialUrl: _initialUrl, navigationDelegate: (NavigationRequest request) async { if (await canLaunch(request.url)) { @@ -169,7 +170,13 @@ class _NewsDetailScreenState extends State { } else { print("Cannot launch url"); } - return NavigationDecision.prevent; + + // Workaround for content not showing in iOS + // as described here + // [https://github.com/flutter/flutter/issues/30256] + return request.url == _initialUrl + ? NavigationDecision.navigate + : NavigationDecision.prevent; }, javascriptMode: JavascriptMode.unrestricted, ), @@ -180,7 +187,7 @@ class _NewsDetailScreenState extends State { )))); } - // var testhtml = - // "
\n

What is Lorem Ipsum?

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here',

  1. one
  2. two
  3. three

\n
"; +// var testhtml = +// "
\n

What is Lorem Ipsum?

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here',

  1. one
  2. two
  3. three

\n
"; }