Add package json_field_editor

This commit is contained in:
Ankit Mahato
2025-04-09 03:21:33 +05:30
parent 01871b397c
commit 474b9d7112
25 changed files with 1713 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:json_field_editor/src/json_highlight/json_highlight.dart';
void main() {
group('JsonHighlight', () {
test(
'build method should create TextSpan with correct number of children',
() {
// Arrange
var jsonHighlight = JsonHighlight(isFormating: true);
var data =
'{"key": "value", "number": 123, "bool": true, "null": null}';
// Act
TextSpan result = jsonHighlight.build(data);
// Assert
expect(
result.children!.length,
23,
); // adjust this based on your expected result
},
);
});
}