Skip to content

Commit

Permalink
latest from macbook
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbytes committed Mar 14, 2024
1 parent a3f7037 commit e1884d4
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 349 deletions.
39 changes: 23 additions & 16 deletions lib/core/form_fields/richtext.field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,32 @@ class RichTextFormField extends StatelessWidget with ConsoleMixin {
}
}

return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (!readOnly) ...[
QuillToolbar.basic(
controller: _fieldController!,
multiRowsDisplay: false,
return QuillProvider(
configurations: QuillConfigurations(controller: _fieldController!),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (!readOnly) ...[
// QuillToolbar.basic(
// controller: _fieldController!,
// multiRowsDisplay: false,
// ),
const QuillToolbar(
configurations: QuillToolbarConfigurations(
multiRowsDisplay: false,
),
),
const Divider(),
],
SizedBox(
height: 300,
child: QuillEditor.basic(
configurations: QuillEditorConfigurations(readOnly: readOnly),
),
),
const Divider(),
],
SizedBox(
height: 300,
child: QuillEditor.basic(
controller: _fieldController!,
readOnly: readOnly, // true for view only mode
),
),
const Divider(),
],
),
);
}
}
1 change: 1 addition & 0 deletions lib/core/liso/liso.manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class LisoManager {
Uint8List bytes, {
Uint8List? cipherKey,
}) async {
console.wtf('decrypt parseVaultBytes()');
final decryptedBytes = CipherService.to.decrypt(
bytes,
cipherKey: cipherKey,
Expand Down
14 changes: 6 additions & 8 deletions lib/core/services/cipher.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ class CipherService extends GetxService with ConsoleMixin {

// FUNCTIONS
Uint8List encrypt(List<int> bytes, {Uint8List? cipherKey}) {
final encrypter = Encrypter(
AES(Key(cipherKey ?? SecretPersistence.to.cipherKey)),
);

final key = Key(cipherKey ?? SecretPersistence.to.cipherKey);
console.wtf('encrypt key: ${key.length}');
final encrypter = Encrypter(AES(key));
return encrypter.encryptBytes(bytes, iv: iv).bytes;
}

List<int> decrypt(Uint8List bytes, {Uint8List? cipherKey}) {
final encrypter = Encrypter(
AES(Key(cipherKey ?? SecretPersistence.to.cipherKey)),
);

final key = Key(cipherKey ?? SecretPersistence.to.cipherKey);
console.wtf('decrypt key: ${key.length}');
final encrypter = Encrypter(AES(key));
return encrypter.decryptBytes(Encrypted(bytes), iv: iv);
}

Expand Down
62 changes: 31 additions & 31 deletions lib/core/utils/minio.util.dart
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import 'package:minio/models.dart';
// import 'package:minio/models.dart';

class MinioUtil {
static Object objectFromJson(Map<String, dynamic> json) => Object(
json['e_tag'],
json['key'],
DateTime.parse(json['last_modified']),
ownerFromJson(json['owner']),
json['size'],
json['storage_class'],
);
// class MinioUtil {
// static Object objectFromJson(Map<String, dynamic> json) => Object(
// json['e_tag'],
// json['key'],
// DateTime.parse(json['last_modified']),
// ownerFromJson(json['owner']),
// json['size'],
// json['storage_class'],
// );

static Map<String, dynamic> objectToJson(Object? object) {
return {
"e_tag": object?.eTag?.replaceAll('"', ''),
"path": object?.key,
"last_modified": object?.lastModified?.toIso8601String(),
"owner": ownerToJson(object?.owner),
"size": object?.size,
"storage_class": object?.storageClass,
};
}
// static Map<String, dynamic> objectToJson(Object? object) {
// return {
// "e_tag": object?.eTag?.replaceAll('"', ''),
// "path": object?.key,
// "last_modified": object?.lastModified?.toIso8601String(),
// "owner": ownerToJson(object?.owner),
// "size": object?.size,
// "storage_class": object?.storageClass,
// };
// }

static Owner ownerFromJson(Map<String, dynamic> json) => Owner(
json['display_name'],
json['id'],
);
// static Owner ownerFromJson(Map<String, dynamic> json) => Owner(
// json['display_name'],
// json['id'],
// );

static Map<String, dynamic> ownerToJson(Owner? owner) {
return {
"display_name": owner?.displayName,
"id": owner?.iD,
};
}
}
// static Map<String, dynamic> ownerToJson(Owner? owner) {
// return {
// "display_name": owner?.displayName,
// "id": owner?.iD,
// };
// }
// }
Loading

0 comments on commit e1884d4

Please sign in to comment.