forked from Frezyx/flutter_json_view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgreen_custom.dart
97 lines (95 loc) · 2.57 KB
/
green_custom.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import 'package:flutter/material.dart';
import 'package:flutter_json_view/flutter_json_view.dart';
void main() {
runApp(JsonViewApp());
}
class JsonViewApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Json View',
theme: ThemeData(
primarySwatch: Colors.green,
brightness: Brightness.light,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: Text('flutter_json_view 1.1.2')),
body: Padding(
padding: const EdgeInsets.all(10),
child: JsonView.string(
// '{"author":{"name": "Stas", "lastName": "Ilin", "githubLogin": "Frezyx", "age": 19, "man": true, "height": 186.5}}',
'''{
"users": {
"sammy" : {
"username" : "SammyShark",
"location" : "Indian Ocean",
"online" : true,
"followers" : 987
},
"jesse" : {
"username" : "JesseOctopus",
"location" : "Pacific Ocean",
"online" : false,
"followers" : 432
},
"drew" : {
"username" : "DrewSquid",
"location" : "Atlantic Ocean",
"online" : false,
"followers" : 321
},
"jamie" : {
"username" : "JamieMantisShrimp",
"location" : "Pacific Ocean",
"online" : true,
"followers" : 654
}}
}''',
theme: JsonViewTheme(
keyStyle: TextStyle(
color: Colors.black54,
fontSize: 16,
fontWeight: FontWeight.w600,
),
doubleStyle: TextStyle(
color: Colors.green,
fontSize: 16,
),
intStyle: TextStyle(
color: Colors.green,
fontSize: 16,
),
stringStyle: TextStyle(
color: Colors.green,
fontSize: 16,
),
boolStyle: TextStyle(
color: Colors.green,
fontSize: 16,
),
closeIcon: Icon(
Icons.close,
color: Colors.green,
size: 20,
),
openIcon: Icon(
Icons.add,
color: Colors.green,
size: 20,
),
separator: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Icon(
Icons.arrow_right_alt_outlined,
size: 20,
color: Colors.green,
),
),
),
),
),
),
);
}
}