diff --git a/fastlane/report.xml b/fastlane/report.xml index e41e8d3..63fa409 100644 --- a/fastlane/report.xml +++ b/fastlane/report.xml @@ -5,12 +5,12 @@ - + - + diff --git a/lib/dashboard/filemanager/file_manager.dart b/lib/dashboard/filemanager/file_manager.dart index 2247bfa..93b0ff8 100644 --- a/lib/dashboard/filemanager/file_manager.dart +++ b/lib/dashboard/filemanager/file_manager.dart @@ -173,7 +173,7 @@ class _FileManagerState extends State { }); }); if (widget.online) - WebDavManager.startAutomatedUpload(offlineWhiteboards); + WebDavManager.startAutomatedUpload(await WhiteboardDataManager.getAllOfflineWhiteboards(this.offlineWhiteboardIds)); }, child: GridView.extent( maxCrossAxisExtent: 200, diff --git a/lib/dashboard/filemanager/whiteboard_data_manager.dart b/lib/dashboard/filemanager/whiteboard_data_manager.dart index d6ea9a8..2151e09 100644 --- a/lib/dashboard/filemanager/whiteboard_data_manager.dart +++ b/lib/dashboard/filemanager/whiteboard_data_manager.dart @@ -41,8 +41,8 @@ class WhiteboardDataManager { OfflineWhiteboards offlineWhiteboards, OnGotDirectoriesAndWhiteboards onGotDirectoriesAndWhiteboards) async { Set _offlineWhiteboardIds = await getOfflineWhiteboardIds(); - OfflineWhiteboards _offlineWhiteboards = await getOfflineWhiteboards( - _offlineWhiteboardIds, currentDirectory); + OfflineWhiteboards _offlineWhiteboards = + await getOfflineWhiteboards(_offlineWhiteboardIds, currentDirectory); Directories offlineDirectories = getOfflineDirectories(currentDirectory); if (!online) { directories = offlineDirectories; @@ -129,7 +129,8 @@ class WhiteboardDataManager { Whiteboards.fromJson(jsonDecode(utf8.decode((wbResponse.bodyBytes)))); ExtWhiteboards _extWhiteboards = ExtWhiteboards.fromJson( jsonDecode(utf8.decode((wbExtResponse.bodyBytes)))); - await fileManagerStorage.setItem("_directories", _directories.toJSONEncodable()); + await fileManagerStorage.setItem( + "_directories", _directories.toJSONEncodable()); directories = _directories; whiteboards = _whiteboards; @@ -159,8 +160,7 @@ class WhiteboardDataManager { } static Future getOfflineWhiteboards( - Set offlineWhiteboardIds, - String currentDirectory) async { + Set offlineWhiteboardIds, String currentDirectory) async { await fileManagerStorage.ready; List _offlineWhiteboards = List.empty(growable: true); for (String id in offlineWhiteboardIds) { @@ -188,6 +188,32 @@ class WhiteboardDataManager { return (new OfflineWhiteboards(_offlineWhiteboards)); } + static Future getAllOfflineWhiteboards( + Set offlineWhiteboardIds) async { + await fileManagerStorage.ready; + List _offlineWhiteboards = List.empty(growable: true); + for (String id in offlineWhiteboardIds) { + Map? json = + fileManagerStorage.getItem("offline_whiteboard-" + id) ?? []; + if (json != null) { + OfflineWhiteboard offlineWhiteboard = + await OfflineWhiteboard.fromJson(json); + for (Scribble scribble in offlineWhiteboard.scribbles.list) { + ScreenUtils.calculateScribbleBounds(scribble); + ScreenUtils.bakeScribble(scribble, 1); + } + for (Upload upload in offlineWhiteboard.uploads.list) { + final ui.Codec codec = await PaintingBinding.instance! + .instantiateImageCodec(upload.uint8List); + final ui.FrameInfo frameInfo = await codec.getNextFrame(); + upload.image = frameInfo.image; + } + _offlineWhiteboards.add(offlineWhiteboard); + } + } + return (new OfflineWhiteboards(_offlineWhiteboards)); + } + static Directories getOfflineDirectories(String currentDirectory) { Directories directories = new Directories([]); try { @@ -314,8 +340,7 @@ class WhiteboardDataManager { decodeGetTextItem.maxHeight, HexColor.fromHex(decodeGetTextItem.color), decodeGetTextItem.contentText, - new Offset( - decodeGetTextItem.offsetDx, decodeGetTextItem.offsetDy), + new Offset(decodeGetTextItem.offsetDx, decodeGetTextItem.offsetDy), decodeGetTextItem.rotation)); } } @@ -343,8 +368,7 @@ class WhiteboardDataManager { bookmarks.add(new Bookmark( decodeGetBookmark.uuid, decodeGetBookmark.name, - new Offset( - decodeGetBookmark.offsetDx, decodeGetBookmark.offsetDy), + new Offset(decodeGetBookmark.offsetDx, decodeGetBookmark.offsetDy), decodeGetBookmark.scale)); } } diff --git a/lib/documentation/about.dart b/lib/documentation/about.dart index 3aa2555..664e46c 100644 --- a/lib/documentation/about.dart +++ b/lib/documentation/about.dart @@ -91,13 +91,11 @@ class _AboutState extends State { Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.all(16.0), - child: Flexible( - child: Text( - "FluffyBoard", - style: GoogleFonts.fredokaOne(fontSize: 150 * sizeFactor), - ), + child: Text( + "FluffyBoard", + style: GoogleFonts.fredokaOne(fontSize: 150 * sizeFactor), ), - ) + ), ]), Row( mainAxisSize: MainAxisSize.min, @@ -138,61 +136,60 @@ class _AboutState extends State { ), Padding( padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Flexible( - child: Text( - "Perfect for Students, Schools and Teams", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 75 * sizeFactor), - ), - ) - ], + child: Center( + child: Text( + "Perfect for Students, Schools and Teams", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 75 * sizeFactor), + ), ), ), Padding( padding: const EdgeInsets.fromLTRB(16.0, 50, 16.0, 16), - child: - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - ElevatedButton( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Row(children: [ - Text("Get started", style: TextStyle(fontSize: 50)), - Icon(Icons.arrow_right) - ]), - ), - onPressed: () { - Navigator.of(context).pushReplacementNamed("/dashboard"); - }, - ), - ]), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + ElevatedButton( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Row(children: [ + Text("Get started", style: TextStyle(fontSize: 150 * sizeFactor)), + Icon(Icons.arrow_right, size: 150 * sizeFactor) + ]), + ), + onPressed: () { + Navigator.of(context) + .pushReplacementNamed("/dashboard"); + }, + ), + ]), ), Padding( padding: const EdgeInsets.fromLTRB(16.0, 40.0, 16.0, 16.0), child: Column(children: [ for (int i = 0; i < cardHeadings.length; i++) - Padding( - padding: const EdgeInsets.fromLTRB(8.0, 25.0, 8.0, 8.0), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Text(cardHeadings[i], - style: cardHeadingTextStyle), - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Flexible( - child: Text(cardDescriptions[i], - style: cardTextStyle, textAlign: TextAlign.center,), - ), - ), - ], + Padding( + padding: const EdgeInsets.fromLTRB(8.0, 25.0, 8.0, 8.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text(cardHeadings[i], + style: cardHeadingTextStyle), ), - ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + cardDescriptions[i], + style: cardTextStyle, + textAlign: TextAlign.center, + ), + ), + ], + ), + ), ]), ) ]), diff --git a/pubspec.yaml b/pubspec.yaml index 6026268..09511ca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.0.7+29752114 +version: 0.0.8+29757773 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/version.yml b/version.yml index 7443ece..fe2df49 100644 --- a/version.yml +++ b/version.yml @@ -1,4 +1,4 @@ --- major: 0 minor: 0 -patch: 7 \ No newline at end of file +patch: 8 \ No newline at end of file