Skip to content

Commit 5c2527d

Browse files
committed
优化代码
1 parent 5532a9c commit 5c2527d

10 files changed

+101
-56
lines changed

.vscode/launch.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "flutter_ns_danmaku",
9+
"request": "launch",
10+
"type": "dart"
11+
},
12+
{
13+
"name": "flutter_ns_danmaku (profile mode)",
14+
"request": "launch",
15+
"type": "dart",
16+
"flutterMode": "profile"
17+
},
18+
{
19+
"name": "flutter_ns_danmaku (release mode)",
20+
"request": "launch",
21+
"type": "dart",
22+
"flutterMode": "release"
23+
},
24+
{
25+
"name": "example",
26+
"cwd": "example",
27+
"request": "launch",
28+
"type": "dart"
29+
},
30+
{
31+
"name": "example (profile mode)",
32+
"cwd": "example",
33+
"request": "launch",
34+
"type": "dart",
35+
"flutterMode": "profile"
36+
},
37+
{
38+
"name": "example (release mode)",
39+
"cwd": "example",
40+
"request": "launch",
41+
"type": "dart",
42+
"flutterMode": "release"
43+
}
44+
]
45+
}

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.0.2
2+
3+
* 优化代码
14
## 0.0.1
25

36
* first commit

analysis_options.yaml

-4
This file was deleted.

example/lib/main.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import 'dart:async';
33
import 'dart:convert';
44
import 'package:collection/collection.dart';
55
import 'package:flutter/material.dart';
6-
import 'package:ns_danmaku/danmaku_controller.dart';
7-
import 'package:ns_danmaku/danmaku_view.dart';
8-
import 'package:ns_danmaku/models/danmaku_option.dart';
9-
import 'package:ns_danmaku/models/danmaku_item.dart';
6+
import 'package:ns_danmaku/ns_danmaku.dart';
7+
108
import 'package:flutter/services.dart';
119

1210
void main() async {

example/pubspec.lock

+22-23
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,56 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
url: "https://pub.dartlang.org"
8+
url: "https://pub.flutter-io.cn"
99
source: hosted
1010
version: "2.8.2"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
15-
url: "https://pub.dartlang.org"
15+
url: "https://pub.flutter-io.cn"
1616
source: hosted
1717
version: "2.1.0"
1818
characters:
1919
dependency: transitive
2020
description:
2121
name: characters
22-
url: "https://pub.dartlang.org"
22+
url: "https://pub.flutter-io.cn"
2323
source: hosted
2424
version: "1.2.0"
2525
charcode:
2626
dependency: transitive
2727
description:
2828
name: charcode
29-
url: "https://pub.dartlang.org"
29+
url: "https://pub.flutter-io.cn"
3030
source: hosted
3131
version: "1.3.1"
3232
clock:
3333
dependency: transitive
3434
description:
3535
name: clock
36-
url: "https://pub.dartlang.org"
36+
url: "https://pub.flutter-io.cn"
3737
source: hosted
3838
version: "1.1.0"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
43-
url: "https://pub.dartlang.org"
43+
url: "https://pub.flutter-io.cn"
4444
source: hosted
4545
version: "1.16.0"
4646
cupertino_icons:
4747
dependency: "direct main"
4848
description:
4949
name: cupertino_icons
50-
url: "https://pub.dartlang.org"
50+
url: "https://pub.flutter-io.cn"
5151
source: hosted
52-
version: "1.0.4"
52+
version: "1.0.5"
5353
fake_async:
5454
dependency: transitive
5555
description:
5656
name: fake_async
57-
url: "https://pub.dartlang.org"
57+
url: "https://pub.flutter-io.cn"
5858
source: hosted
5959
version: "1.3.0"
6060
flutter:
@@ -71,21 +71,21 @@ packages:
7171
dependency: transitive
7272
description:
7373
name: matcher
74-
url: "https://pub.dartlang.org"
74+
url: "https://pub.flutter-io.cn"
7575
source: hosted
7676
version: "0.12.11"
7777
material_color_utilities:
7878
dependency: transitive
7979
description:
8080
name: material_color_utilities
81-
url: "https://pub.dartlang.org"
81+
url: "https://pub.flutter-io.cn"
8282
source: hosted
8383
version: "0.1.4"
8484
meta:
8585
dependency: transitive
8686
description:
8787
name: meta
88-
url: "https://pub.dartlang.org"
88+
url: "https://pub.flutter-io.cn"
8989
source: hosted
9090
version: "1.7.0"
9191
ns_danmaku:
@@ -94,12 +94,12 @@ packages:
9494
path: ".."
9595
relative: true
9696
source: path
97-
version: "0.0.1"
97+
version: "0.0.2"
9898
path:
9999
dependency: transitive
100100
description:
101101
name: path
102-
url: "https://pub.dartlang.org"
102+
url: "https://pub.flutter-io.cn"
103103
source: hosted
104104
version: "1.8.1"
105105
sky_engine:
@@ -111,51 +111,50 @@ packages:
111111
dependency: transitive
112112
description:
113113
name: source_span
114-
url: "https://pub.dartlang.org"
114+
url: "https://pub.flutter-io.cn"
115115
source: hosted
116116
version: "1.8.2"
117117
stack_trace:
118118
dependency: transitive
119119
description:
120120
name: stack_trace
121-
url: "https://pub.dartlang.org"
121+
url: "https://pub.flutter-io.cn"
122122
source: hosted
123123
version: "1.10.0"
124124
stream_channel:
125125
dependency: transitive
126126
description:
127127
name: stream_channel
128-
url: "https://pub.dartlang.org"
128+
url: "https://pub.flutter-io.cn"
129129
source: hosted
130130
version: "2.1.0"
131131
string_scanner:
132132
dependency: transitive
133133
description:
134134
name: string_scanner
135-
url: "https://pub.dartlang.org"
135+
url: "https://pub.flutter-io.cn"
136136
source: hosted
137137
version: "1.1.0"
138138
term_glyph:
139139
dependency: transitive
140140
description:
141141
name: term_glyph
142-
url: "https://pub.dartlang.org"
142+
url: "https://pub.flutter-io.cn"
143143
source: hosted
144144
version: "1.2.0"
145145
test_api:
146146
dependency: transitive
147147
description:
148148
name: test_api
149-
url: "https://pub.dartlang.org"
149+
url: "https://pub.flutter-io.cn"
150150
source: hosted
151151
version: "0.4.9"
152152
vector_math:
153153
dependency: transitive
154154
description:
155155
name: vector_math
156-
url: "https://pub.dartlang.org"
156+
url: "https://pub.flutter-io.cn"
157157
source: hosted
158158
version: "2.1.2"
159159
sdks:
160-
dart: ">=2.17.0 <3.0.0"
161-
flutter: ">=1.17.0"
160+
dart: ">=2.17.3 <3.0.0"

lib/ns_danmaku.dart

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
library ns_danmaku;
2+
3+
export 'danmaku_view.dart';
4+
export 'danmaku_controller.dart';
5+
export 'models/danmaku_option.dart';
6+
export 'models/danmaku_item.dart';

lib/transition/position_item_view.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PositionItemView extends StatefulWidget {
1010
final bool isTop;
1111
final Function(String)? onComplete;
1212
final Function(AnimationController)? onCreated;
13-
PositionItemView({
13+
const PositionItemView({
1414
required this.text,
1515
this.fontSize = 16,
1616
this.color = Colors.white,

lib/transition/scroll_item_view.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ScrollItemView extends StatefulWidget {
1212
final Size size;
1313
final Function(String)? onComplete;
1414
final Function(AnimationController)? onCreated;
15-
ScrollItemView({
15+
const ScrollItemView({
1616
required this.text,
1717
this.fontSize = 16,
1818
this.duration = 10,

0 commit comments

Comments
 (0)