Skip to content

Commit

Permalink
Add html content view
Browse files Browse the repository at this point in the history
  • Loading branch information
dewmal committed Apr 1, 2020
1 parent 6498200 commit 346f7c2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/constants.dart
Original file line number Diff line number Diff line change
@@ -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";
21 changes: 7 additions & 14 deletions lib/page/screen/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -106,11 +107,10 @@ class _DashboardScreenState extends State<DashboardScreen>
}

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
Expand Down Expand Up @@ -268,15 +268,11 @@ class _DashboardScreenState extends State<DashboardScreen>
),
],
),
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,
Expand Down Expand Up @@ -432,10 +428,7 @@ class _DashboardScreenState extends State<DashboardScreen>
)
],
),
content: Text(
article.message,
style: TextStyle(color: Colors.black),
),
content: Html(data: article.message),
actions: <Widget>[
IconButton(
onPressed: () {
Expand Down
21 changes: 21 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 346f7c2

Please sign in to comment.