Skip to content

Commit

Permalink
feat: Added the logic to display the user drawn clipart to the badge. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhalakupadhyay committed Sep 7, 2024
1 parent 2b799cc commit 2d35016
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Binary file added assets/icons/postman collections.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/bademagic_module/utils/converters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class Converters {
var key = controllerData.imageCache.keys.toList()[index];
if (key is List) {
String filename = key[0];
logger.d("Filename: $filename");
List<List<int>>? image = await fileHelper.readFromFile(filename);
hexStrings += convertBitmapToLEDHex(image!, true);
logger.d("Image: $image");
hexStrings = convertBitmapToLEDHex(image!, true);
x += 5;
} else {
List<String> hs =
Expand Down Expand Up @@ -159,6 +161,7 @@ class Converters {

allHexs.add(lineHex.toString()); // Store completed hexadecimal line
}
logger.d("All hexs: $allHexs");
return allHexs; // Return list of hexadecimal strings
}
}
2 changes: 2 additions & 0 deletions lib/bademagic_module/utils/image_utils.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:ui' as ui;
import 'dart:ui';
import 'package:badgemagic/bademagic_module/utils/byte_array_utils.dart';
import 'package:badgemagic/bademagic_module/utils/converters.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -221,6 +222,7 @@ class ImageUtils {
}
}
}
logger.d("Pixel Array generated = $pixelArray");
return Converters.convertBitmapToLEDHex(pixelArray, false);
}
}

0 comments on commit 2d35016

Please sign in to comment.