Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6bf1bbc

Browse files
Added function getJsonAsString
0 parents commit 6bf1bbc

File tree

9 files changed

+318
-0
lines changed

9 files changed

+318
-0
lines changed

‎.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
build/
32+
33+
# Android related
34+
**/android/**/gradle-wrapper.jar
35+
**/android/.gradle
36+
**/android/captures/
37+
**/android/gradlew
38+
**/android/gradlew.bat
39+
**/android/local.properties
40+
**/android/**/GeneratedPluginRegistrant.java
41+
42+
# iOS/XCode related
43+
**/ios/**/*.mode1v3
44+
**/ios/**/*.mode2v3
45+
**/ios/**/*.moved-aside
46+
**/ios/**/*.pbxuser
47+
**/ios/**/*.perspectivev3
48+
**/ios/**/*sync/
49+
**/ios/**/.sconsign.dblite
50+
**/ios/**/.tags*
51+
**/ios/**/.vagrant/
52+
**/ios/**/DerivedData/
53+
**/ios/**/Icon?
54+
**/ios/**/Pods/
55+
**/ios/**/.symlinks/
56+
**/ios/**/profile
57+
**/ios/**/xcuserdata
58+
**/ios/.generated/
59+
**/ios/Flutter/App.framework
60+
**/ios/Flutter/Flutter.framework
61+
**/ios/Flutter/Flutter.podspec
62+
**/ios/Flutter/Generated.xcconfig
63+
**/ios/Flutter/app.flx
64+
**/ios/Flutter/app.zip
65+
**/ios/Flutter/flutter_assets/
66+
**/ios/Flutter/flutter_export_environment.sh
67+
**/ios/ServiceDefinitions.json
68+
**/ios/Runner/GeneratedPluginRegistrant.*
69+
70+
# Exceptions to above rules.
71+
!**/ios/**/default.mode1v3
72+
!**/ios/**/default.mode2v3
73+
!**/ios/**/default.pbxuser
74+
!**/ios/**/default.perspectivev3
75+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

‎.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 2738a1148ba6c9a6114df62358109407c3ef2553
8+
channel: beta
9+
10+
project_type: package

‎CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## [0.0.1] - TODO: Add release date.
2+
3+
* TODO: Describe initial release.

‎LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

‎README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# jsonloader
2+
3+
JSON Loader Package
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Dart
8+
[package](https://flutter.dev/developing-packages/),
9+
a library module containing code that can be shared easily across
10+
multiple Flutter or Dart projects.
11+
12+
For help getting started with Flutter, view our
13+
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
samples, guidance on mobile development, and a full API reference.

‎lib/jsonloader.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
library jsonloader;
2+
3+
import 'package:flutter/services.dart';
4+
5+
class JSONLoader {
6+
Future<String> getJsonAsString(String filename) async {
7+
var jsonString = rootBundle.loadString(filename);
8+
return jsonString;
9+
}
10+
}

‎pubspec.lock

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Generated by pub
2+
# See https://dart.dev/tools/pub/glossary#lockfile
3+
packages:
4+
async:
5+
dependency: transitive
6+
description:
7+
name: async
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "2.4.1"
11+
boolean_selector:
12+
dependency: transitive
13+
description:
14+
name: boolean_selector
15+
url: "https://pub.dartlang.org"
16+
source: hosted
17+
version: "2.0.0"
18+
charcode:
19+
dependency: transitive
20+
description:
21+
name: charcode
22+
url: "https://pub.dartlang.org"
23+
source: hosted
24+
version: "1.1.3"
25+
clock:
26+
dependency: transitive
27+
description:
28+
name: clock
29+
url: "https://pub.dartlang.org"
30+
source: hosted
31+
version: "1.0.1"
32+
collection:
33+
dependency: transitive
34+
description:
35+
name: collection
36+
url: "https://pub.dartlang.org"
37+
source: hosted
38+
version: "1.14.12"
39+
fake_async:
40+
dependency: transitive
41+
description:
42+
name: fake_async
43+
url: "https://pub.dartlang.org"
44+
source: hosted
45+
version: "1.1.0"
46+
flutter:
47+
dependency: "direct main"
48+
description: flutter
49+
source: sdk
50+
version: "0.0.0"
51+
flutter_test:
52+
dependency: "direct dev"
53+
description: flutter
54+
source: sdk
55+
version: "0.0.0"
56+
matcher:
57+
dependency: transitive
58+
description:
59+
name: matcher
60+
url: "https://pub.dartlang.org"
61+
source: hosted
62+
version: "0.12.6"
63+
meta:
64+
dependency: transitive
65+
description:
66+
name: meta
67+
url: "https://pub.dartlang.org"
68+
source: hosted
69+
version: "1.1.8"
70+
path:
71+
dependency: transitive
72+
description:
73+
name: path
74+
url: "https://pub.dartlang.org"
75+
source: hosted
76+
version: "1.7.0"
77+
sky_engine:
78+
dependency: transitive
79+
description: flutter
80+
source: sdk
81+
version: "0.0.99"
82+
source_span:
83+
dependency: transitive
84+
description:
85+
name: source_span
86+
url: "https://pub.dartlang.org"
87+
source: hosted
88+
version: "1.7.0"
89+
stack_trace:
90+
dependency: transitive
91+
description:
92+
name: stack_trace
93+
url: "https://pub.dartlang.org"
94+
source: hosted
95+
version: "1.9.3"
96+
stream_channel:
97+
dependency: transitive
98+
description:
99+
name: stream_channel
100+
url: "https://pub.dartlang.org"
101+
source: hosted
102+
version: "2.0.0"
103+
string_scanner:
104+
dependency: transitive
105+
description:
106+
name: string_scanner
107+
url: "https://pub.dartlang.org"
108+
source: hosted
109+
version: "1.0.5"
110+
term_glyph:
111+
dependency: transitive
112+
description:
113+
name: term_glyph
114+
url: "https://pub.dartlang.org"
115+
source: hosted
116+
version: "1.1.0"
117+
test_api:
118+
dependency: transitive
119+
description:
120+
name: test_api
121+
url: "https://pub.dartlang.org"
122+
source: hosted
123+
version: "0.2.15"
124+
typed_data:
125+
dependency: transitive
126+
description:
127+
name: typed_data
128+
url: "https://pub.dartlang.org"
129+
source: hosted
130+
version: "1.1.6"
131+
vector_math:
132+
dependency: transitive
133+
description:
134+
name: vector_math
135+
url: "https://pub.dartlang.org"
136+
source: hosted
137+
version: "2.0.8"
138+
sdks:
139+
dart: ">=2.7.0 <3.0.0"

‎pubspec.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: jsonloader
2+
description: JSON Loader Package
3+
version: 0.0.1
4+
author:
5+
homepage:
6+
7+
environment:
8+
sdk: ">=2.7.0 <3.0.0"
9+
10+
dependencies:
11+
flutter:
12+
sdk: flutter
13+
14+
dev_dependencies:
15+
flutter_test:
16+
sdk: flutter
17+
18+
# For information on the generic Dart part of this file, see the
19+
# following page: https://dart.dev/tools/pub/pubspec
20+
21+
# The following section is specific to Flutter.
22+
flutter:
23+
24+
# To add assets to your package, add an assets section, like this:
25+
# assets:
26+
# - images/a_dot_burr.jpeg
27+
# - images/a_dot_ham.jpeg
28+
#
29+
# For details regarding assets in packages, see
30+
# https://flutter.dev/assets-and-images/#from-packages
31+
#
32+
# An image asset can refer to one or more resolution-specific "variants", see
33+
# https://flutter.dev/assets-and-images/#resolution-aware.
34+
35+
# To add custom fonts to your package, add a fonts section here,
36+
# in this "flutter" section. Each entry in this list should have a
37+
# "family" key with the font family name, and a "fonts" key with a
38+
# list giving the asset and other descriptors for the font. For
39+
# example:
40+
# fonts:
41+
# - family: Schyler
42+
# fonts:
43+
# - asset: fonts/Schyler-Regular.ttf
44+
# - asset: fonts/Schyler-Italic.ttf
45+
# style: italic
46+
# - family: Trajan Pro
47+
# fonts:
48+
# - asset: fonts/TrajanPro.ttf
49+
# - asset: fonts/TrajanPro_Bold.ttf
50+
# weight: 700
51+
#
52+
# For details regarding fonts in packages, see
53+
# https://flutter.dev/custom-fonts/#from-packages

‎test/jsonloader_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:flutter_test/flutter_test.dart';
2+
3+
import 'package:jsonloader/jsonloader.dart';
4+
5+
void main() {
6+
test('adds one to input values', () {
7+
final calculator = Calculator();
8+
expect(calculator.addOne(2), 3);
9+
expect(calculator.addOne(-7), -6);
10+
expect(calculator.addOne(0), 1);
11+
expect(() => calculator.addOne(null), throwsNoSuchMethodError);
12+
});
13+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /