diff --git a/lib/constants.dart b/lib/constants.dart index ce90fc1..4e27a4a 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -1,3 +1,3 @@ -final bool debugRelease = false; -//final String testingServer = "https://api.covid-19.health.gov.lk/test"; +final bool debugRelease = true; +//final String testingServer = "https://test.covid-19.health.gov.lk/api"; final String testingServer = "https://test.covid-19.health.gov.lk/api"; diff --git a/lib/page/screen/dashboard_screen.dart b/lib/page/screen/dashboard_screen.dart index 9c144f0..41f9f06 100644 --- a/lib/page/screen/dashboard_screen.dart +++ b/lib/page/screen/dashboard_screen.dart @@ -4,6 +4,7 @@ import 'package:firebase_remote_config/firebase_remote_config.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:provider/provider.dart'; import 'package:selftrackingapp/app_localizations.dart'; import 'package:selftrackingapp/models/message_type.dart'; @@ -106,11 +107,10 @@ class _DashboardScreenState extends State } void _shareArticle(NewsArticle article) { - Share.share("${article.title}\n\n" - "${article.subtitle}\n\n" + Share.share("${article.title}\n" + "${article.subtitle}\n" "by ${article.originator}\n" - "${dateFormat.format(article.created)}\n\n" - "${article.message}"); + "${dateFormat.format(article.created)}\n"); } @override @@ -268,15 +268,11 @@ class _DashboardScreenState extends State ), ], ), - SizedBox( - height: 5.0, - ), Divider( color: Colors.grey[400].withOpacity(0.1), ), - Text( - article.message, - style: TextStyle(color: Colors.black, fontSize: 16.0), + Html( + data: article.message, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -432,10 +428,7 @@ class _DashboardScreenState extends State ) ], ), - content: Text( - article.message, - style: TextStyle(color: Colors.black), - ), + content: Html(data: article.message), actions: [ IconButton( onPressed: () { diff --git a/pubspec.lock b/pubspec.lock index 346bb57..1a924da 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -92,6 +92,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.3" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" cupertino_icons: dependency: "direct main" description: @@ -153,6 +160,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.3" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.1" flutter_localizations: dependency: "direct main" description: flutter @@ -210,6 +224,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.5.25" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+3" http: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index f5cf831..a6d407b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,6 +43,7 @@ dependencies: recursive_regex: ^0.1.3+2 webview_flutter: ^0:3:19+9 auto_size_text: ^2.1.0 + flutter_html: ^0.11.1 flutter_localizations: