Skip to content

Commit e08f99d

Browse files
authored
Merge pull request #5 from Frezyx/dev
Release version 0.2.1
2 parents cb957eb + 5c7860a commit e08f99d

12 files changed

Lines changed: 101 additions & 38 deletions

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
## 0.2.1
2+
3+
* Small refactoring
4+
* Update example
5+
16
## 0.2.0
27

3-
* Add map constructor to build widget from json objects withuot serialization
8+
* Add map constructor to build widget from json objects without serialization
49

510
## 0.1.2
611

7-
* Fix naming seporator -> separator
12+
* Fix naming separator -> separator
813

914
## 0.1.1
1015

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
```yaml
1919
dependencies:
20-
flutter_json_view: ^0.2.0
20+
flutter_json_view: ^0.2.1
2121
```
2222
2323
### Add import package
@@ -42,6 +42,12 @@ JsonView.string('{"key":"value"}'),
4242
JsonView.asset('assets/data.json'),
4343
```
4444

45+
#### Map constructor
46+
47+
```dart
48+
JsonView.map({"key":"value"}),
49+
```
50+
4551
## Customization
4652
🎨 The package was created in order to be able to customize your json view
4753

analysis_options.yaml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,61 @@
1-
include: package:lint/analysis_options.yaml
1+
# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- always_declare_return_types
11+
- always_require_non_null_named_parameters
12+
- annotate_overrides
13+
- avoid_init_to_null
14+
- avoid_null_checks_in_equality_operators
15+
- avoid_relative_lib_imports
16+
- avoid_return_types_on_setters
17+
- avoid_shadowing_type_parameters
18+
- avoid_single_cascade_in_expression_statements
19+
- avoid_types_as_parameter_names
20+
- await_only_futures
21+
- camel_case_extensions
22+
- curly_braces_in_flow_control_structures
23+
- empty_catches
24+
- empty_constructor_bodies
25+
- library_names
26+
- library_prefixes
27+
- no_duplicate_case_values
28+
- null_closures
29+
- omit_local_variable_types
30+
- prefer_adjacent_string_concatenation
31+
- prefer_collection_literals
32+
- prefer_conditional_assignment
33+
- prefer_contains
34+
- prefer_equal_for_default_values
35+
- prefer_final_fields
36+
- prefer_for_elements_to_map_fromIterable
37+
- prefer_generic_function_type_aliases
38+
- prefer_if_null_operators
39+
- prefer_inlined_adds
40+
- prefer_is_empty
41+
- prefer_is_not_empty
42+
- prefer_iterable_whereType
43+
- prefer_single_quotes
44+
- prefer_spread_collections
45+
- recursive_getters
46+
- slash_for_doc_comments
47+
- sort_child_properties_last
48+
- type_init_formals
49+
- unawaited_futures
50+
- unnecessary_brace_in_string_interps
51+
- unnecessary_const
52+
- unnecessary_getters_setters
53+
- unnecessary_new
54+
- unnecessary_null_in_if_null_operators
55+
- unnecessary_this
56+
- unrelated_type_equality_checks
57+
- unsafe_html
58+
- use_full_hex_values_for_flutter_colors
59+
- use_function_type_syntax_for_parameters
60+
- use_rethrow_when_possible
61+
- valid_regexps

example/lib/examples/github_user.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class JsonViewApp extends StatelessWidget {
1515
brightness: Brightness.dark,
1616
),
1717
home: Scaffold(
18-
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
18+
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
1919
body: Padding(
2020
padding: const EdgeInsets.all(10),
2121
child: JsonView.asset('assets/github_user.json'),

example/lib/examples/green_custom.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class JsonViewApp extends StatelessWidget {
1616
),
1717
debugShowCheckedModeBanner: false,
1818
home: Scaffold(
19-
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
19+
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
2020
body: Padding(
2121
padding: const EdgeInsets.all(10),
2222
child: JsonView.string(

example/lib/examples/map_сonstructor.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ class JsonViewApp extends StatelessWidget {
1515
),
1616
debugShowCheckedModeBanner: false,
1717
home: Scaffold(
18-
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
18+
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
1919
body: Padding(
2020
padding: const EdgeInsets.all(10),
2121
child: JsonView.map(
2222
{
23-
"author": {
24-
"name": "Stas",
25-
"lastName": "Ilin",
26-
"githubLogin": "Frezyx",
27-
"age": 19,
28-
"man": true,
29-
"height": 186.5
23+
'author': {
24+
'name': 'Stas',
25+
'lastName': 'lin',
26+
'githubLogin': 'Frezyx',
27+
'age': 19,
28+
'man': true,
29+
'height': 186.5
3030
},
3131
},
3232
),

example/lib/examples/pink.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class JsonViewApp extends StatelessWidget {
1414
primarySwatch: Colors.pink,
1515
),
1616
home: Scaffold(
17-
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
17+
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
1818
body: Padding(
1919
padding: const EdgeInsets.all(10),
2020
child: JsonView.string(

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class JsonViewApp extends StatelessWidget {
1515
),
1616
debugShowCheckedModeBanner: false,
1717
home: Scaffold(
18-
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
18+
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
1919
body: Padding(
2020
padding: const EdgeInsets.all(10),
2121
child: JsonView.string(

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ packages:
6868
path: ".."
6969
relative: true
7070
source: path
71-
version: "0.2.0"
71+
version: "0.2.1"
7272
flutter_test:
7373
dependency: "direct dev"
7474
description: flutter

lib/src/flutter_json_view.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ import 'package:flutter_json_view/src/builders/builders.dart';
33
import 'package:flutter_json_view/src/theme/json_view_theme.dart';
44

55
class JsonView extends StatefulWidget {
6-
/// The constructor creates a widget
7-
/// from a json map model
8-
JsonView.map(
9-
Map<String, dynamic> map, {
10-
Key? key,
11-
JsonViewTheme? theme,
12-
}) : _builder = MapJsonViewBuilder(
13-
map,
14-
jsonViewTheme: theme,
15-
),
16-
super(key: key);
17-
186
/// The constructor creates a widget
197
/// from a json string
208
JsonView.string(
@@ -42,6 +30,18 @@ class JsonView extends StatefulWidget {
4230
),
4331
super(key: key);
4432

33+
/// The constructor creates a widget
34+
/// from a json map model
35+
JsonView.map(
36+
Map<String, dynamic> map, {
37+
Key? key,
38+
JsonViewTheme? theme,
39+
}) : _builder = MapJsonViewBuilder(
40+
map,
41+
jsonViewTheme: theme,
42+
),
43+
super(key: key);
44+
4545
final JsonViewBuilder _builder;
4646

4747
@override

0 commit comments

Comments
 (0)