Skip to content

Commit

Permalink
Formatted code for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
kekko7072 committed Mar 1, 2023
1 parent 6864d72 commit 7d7896d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/interfaces/add_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class _AddWidgetState extends State<AddWidget> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: const Text('Insert content'),
title: Text('Insert ${linkType == LinkType.code ? "code" : "link"}'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Expand Down
9 changes: 2 additions & 7 deletions lib/services/database_local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ class DatabaseLocal {

Future<Map<String, dynamic>> addLink(LMSContent lmsContent) async {
try {
await db?.insert(kDBTable, <String, Object?>{
'title': lmsContent.title,
'description': lmsContent.description,
'content': lmsContent.content,
'type': '${lmsContent.linkType}'
});
await db?.insert(kDBTable, LMSContent.toJson(lmsContent));
} catch (e) {
debugPrint("ERROR CREATING: $e");
return {"success": false, "message": "$e"};
Expand All @@ -87,7 +82,7 @@ class DatabaseLocal {
}

Future<List<LMSContent>> readDB() async {
debugPrint('Read table $kDBTable');
debugPrint('Reading table $kDBTable');
var body = await db?.query(kDBTable);
debugPrint("BODY: $body");
return LMSContent.listFromJson(body: body);
Expand Down

0 comments on commit 7d7896d

Please sign in to comment.