Skip to content

Commit

Permalink
Merge pull request #5 from Frezyx/dev
Browse files Browse the repository at this point in the history
Release version 0.2.1
  • Loading branch information
Frezyx committed Jun 3, 2021
2 parents cb957eb + 5c7860a commit e08f99d
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 38 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
## 0.2.1

* Small refactoring
* Update example

## 0.2.0

* Add map constructor to build widget from json objects withuot serialization
* Add map constructor to build widget from json objects without serialization

## 0.1.2

* Fix naming seporator -> separator
* Fix naming separator -> separator

## 0.1.1

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

```yaml
dependencies:
flutter_json_view: ^0.2.0
flutter_json_view: ^0.2.1
```

### Add import package
Expand All @@ -42,6 +42,12 @@ JsonView.string('{"key":"value"}'),
JsonView.asset('assets/data.json'),
```

#### Map constructor

```dart
JsonView.map({"key":"value"}),
```

## Customization
🎨 The package was created in order to be able to customize your json view

Expand Down
62 changes: 61 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,61 @@
include: package:lint/analysis_options.yaml
# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
# Google internally enforced rules. See README.md for more information,
# including a list of lints that are intentionally _not_ enforced.

linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_types_as_parameter_names
- await_only_futures
- camel_case_extensions
- curly_braces_in_flow_control_structures
- empty_catches
- empty_constructor_bodies
- library_names
- library_prefixes
- no_duplicate_case_values
- null_closures
- omit_local_variable_types
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_inlined_adds
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_spread_collections
- recursive_getters
- slash_for_doc_comments
- sort_child_properties_last
- type_init_formals
- unawaited_futures
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- unsafe_html
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- valid_regexps
2 changes: 1 addition & 1 deletion example/lib/examples/github_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class JsonViewApp extends StatelessWidget {
brightness: Brightness.dark,
),
home: Scaffold(
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
body: Padding(
padding: const EdgeInsets.all(10),
child: JsonView.asset('assets/github_user.json'),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/examples/green_custom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class JsonViewApp extends StatelessWidget {
),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
body: Padding(
padding: const EdgeInsets.all(10),
child: JsonView.string(
Expand Down
16 changes: 8 additions & 8 deletions example/lib/examples/map_сonstructor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ class JsonViewApp extends StatelessWidget {
),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
body: Padding(
padding: const EdgeInsets.all(10),
child: JsonView.map(
{
"author": {
"name": "Stas",
"lastName": "Ilin",
"githubLogin": "Frezyx",
"age": 19,
"man": true,
"height": 186.5
'author': {
'name': 'Stas',
'lastName': 'lin',
'githubLogin': 'Frezyx',
'age': 19,
'man': true,
'height': 186.5
},
},
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/examples/pink.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonViewApp extends StatelessWidget {
primarySwatch: Colors.pink,
),
home: Scaffold(
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
body: Padding(
padding: const EdgeInsets.all(10),
child: JsonView.string(
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class JsonViewApp extends StatelessWidget {
),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: Text('flutter_json_view 0.2.0')),
appBar: AppBar(title: Text('flutter_json_view 0.2.1')),
body: Padding(
padding: const EdgeInsets.all(10),
child: JsonView.string(
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.2.0"
version: "0.2.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
24 changes: 12 additions & 12 deletions lib/src/flutter_json_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ import 'package:flutter_json_view/src/builders/builders.dart';
import 'package:flutter_json_view/src/theme/json_view_theme.dart';

class JsonView extends StatefulWidget {
/// The constructor creates a widget
/// from a json map model
JsonView.map(
Map<String, dynamic> map, {
Key? key,
JsonViewTheme? theme,
}) : _builder = MapJsonViewBuilder(
map,
jsonViewTheme: theme,
),
super(key: key);

/// The constructor creates a widget
/// from a json string
JsonView.string(
Expand Down Expand Up @@ -42,6 +30,18 @@ class JsonView extends StatefulWidget {
),
super(key: key);

/// The constructor creates a widget
/// from a json map model
JsonView.map(
Map<String, dynamic> map, {
Key? key,
JsonViewTheme? theme,
}) : _builder = MapJsonViewBuilder(
map,
jsonViewTheme: theme,
),
super(key: key);

final JsonViewBuilder _builder;

@override
Expand Down
7 changes: 0 additions & 7 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
lint:
dependency: "direct dev"
description:
name: lint
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.3"
matcher:
dependency: transitive
description:
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_json_view
description: Displaying json models in a Flutter widget with customization.
version: 0.2.0
version: 0.2.1
author: 'youngfrezyx@gmail.com'
homepage: https://github.com/Frezyx/flutter_json_view

Expand All @@ -15,7 +15,6 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
lint: ^1.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down

0 comments on commit e08f99d

Please sign in to comment.