Skip to content

Commit

Permalink
Merge pull request #16 from Y0ngg4n/design
Browse files Browse the repository at this point in the history
Design
  • Loading branch information
Y0ngg4n authored Aug 8, 2021
2 parents b851950 + ae74af2 commit 2bbc86f
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 65 deletions.
4 changes: 2 additions & 2 deletions fastlane/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@



<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000444334">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000310514">

</testcase>


<testcase classname="fastlane.lanes" name="1: flutter_version_manager" time="0.022650665">
<testcase classname="fastlane.lanes" name="1: flutter_version_manager" time="0.021726517">

</testcase>

Expand Down
2 changes: 1 addition & 1 deletion lib/dashboard/filemanager/file_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class _FileManagerState extends State<FileManager> {
});
});
if (widget.online)
WebDavManager.startAutomatedUpload(offlineWhiteboards);
WebDavManager.startAutomatedUpload(await WhiteboardDataManager.getAllOfflineWhiteboards(this.offlineWhiteboardIds));
},
child: GridView.extent(
maxCrossAxisExtent: 200,
Expand Down
42 changes: 33 additions & 9 deletions lib/dashboard/filemanager/whiteboard_data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class WhiteboardDataManager {
OfflineWhiteboards offlineWhiteboards,
OnGotDirectoriesAndWhiteboards onGotDirectoriesAndWhiteboards) async {
Set<String> _offlineWhiteboardIds = await getOfflineWhiteboardIds();
OfflineWhiteboards _offlineWhiteboards = await getOfflineWhiteboards(
_offlineWhiteboardIds, currentDirectory);
OfflineWhiteboards _offlineWhiteboards =
await getOfflineWhiteboards(_offlineWhiteboardIds, currentDirectory);
Directories offlineDirectories = getOfflineDirectories(currentDirectory);
if (!online) {
directories = offlineDirectories;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -159,8 +160,7 @@ class WhiteboardDataManager {
}

static Future<OfflineWhiteboards> getOfflineWhiteboards(
Set<String> offlineWhiteboardIds,
String currentDirectory) async {
Set<String> offlineWhiteboardIds, String currentDirectory) async {
await fileManagerStorage.ready;
List<OfflineWhiteboard> _offlineWhiteboards = List.empty(growable: true);
for (String id in offlineWhiteboardIds) {
Expand Down Expand Up @@ -188,6 +188,32 @@ class WhiteboardDataManager {
return (new OfflineWhiteboards(_offlineWhiteboards));
}

static Future<OfflineWhiteboards> getAllOfflineWhiteboards(
Set<String> offlineWhiteboardIds) async {
await fileManagerStorage.ready;
List<OfflineWhiteboard> _offlineWhiteboards = List.empty(growable: true);
for (String id in offlineWhiteboardIds) {
Map<String, dynamic>? 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 {
Expand Down Expand Up @@ -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));
}
}
Expand Down Expand Up @@ -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));
}
}
Expand Down
99 changes: 48 additions & 51 deletions lib/documentation/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ class _AboutState extends State<About> {
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,
Expand Down Expand Up @@ -138,61 +136,60 @@ class _AboutState extends State<About> {
),
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,
),
),
],
),
),
]),
)
]),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
major: 0
minor: 0
patch: 7
patch: 8

0 comments on commit 2bbc86f

Please sign in to comment.