chore: render activity instruction markdown (#4056)
This commit is contained in:
parent
2cf46d09b3
commit
29ec50493d
4 changed files with 29 additions and 13 deletions
|
|
@ -114,15 +114,6 @@ class ActivityPlanModel {
|
|||
};
|
||||
}
|
||||
|
||||
/// activity content displayed nicely in markdown
|
||||
/// use target emoji for learning objective
|
||||
/// use step emoji for instructions
|
||||
String get markdown {
|
||||
final String markdown =
|
||||
'''🎯 $learningObjective \n🪜 $instructions \n\n📖 $vocabString''';
|
||||
return markdown;
|
||||
}
|
||||
|
||||
String get vocabString {
|
||||
final List<String> vocabList = [];
|
||||
String vocabString = "";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ import 'dart:math';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:matrix/src/utils/markdown.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
|
|
@ -156,9 +158,15 @@ class ActivitySummary extends StatelessWidget {
|
|||
ActivitySessionDetailsRow(
|
||||
icon: Symbols.steps,
|
||||
iconSize: 16.0,
|
||||
child: Text(
|
||||
activity.instructions,
|
||||
style: const TextStyle(fontSize: 12.0),
|
||||
child: Html(
|
||||
data: markdown(activity.instructions),
|
||||
style: {
|
||||
"body": Style(
|
||||
margin: Margins.all(0),
|
||||
padding: HtmlPaddings.all(0),
|
||||
fontSize: FontSize(12.0),
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
ActivitySessionDetailsRow(
|
||||
|
|
|
|||
18
pubspec.lock
18
pubspec.lock
|
|
@ -543,7 +543,7 @@ packages:
|
|||
source: hosted
|
||||
version: "1.3.3"
|
||||
fcm_shared_isolate:
|
||||
dependency: "direct main"
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
path: "pangea_packages/fcm_shared_isolate"
|
||||
relative: true
|
||||
|
|
@ -759,6 +759,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.1"
|
||||
flutter_html:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_html
|
||||
sha256: "38a2fd702ffdf3243fb7441ab58aa1bc7e6922d95a50db76534de8260638558d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
flutter_keyboard_visibility:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1475,6 +1483,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
list_counter:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: list_counter
|
||||
sha256: c447ae3dfcd1c55f0152867090e67e219d42fe6d4f2807db4bbe8b8d69912237
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
lists:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ dependencies:
|
|||
firebase_core: ^3.1.0
|
||||
firebase_messaging: ^15.1.5
|
||||
flutter_dotenv: ^5.1.0
|
||||
flutter_html: ^3.0.0
|
||||
flutter_svg: ^2.0.10+1
|
||||
get_storage: ^2.1.1
|
||||
in_app_purchase: ^3.2.1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue