14.7.flutter_GetX

GetX Cli安装

视频教程地址

零基础视频教程地址

第一步:安装Cli脚手架

我们通过命令flutter pub global activate get_cli 进行脚手架的全局安装,本文以Mac OS为例。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">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
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:~ jm$ flutter pub global activate get_cli

Resolving dependencies...

  • _fe_analyzer_shared 25.0.0
  • analyzer 2.2.0
  • ansicolor 2.0.1
  • archive 3.1.2
  • args 2.2.0
  • async 2.8.2
  • charcode 1.3.1
  • cli_dialog 0.5.0
  • cli_menu 0.3.0-nullsafety.0
  • cli_util 0.3.3
  • clock 1.1.0
  • collection 1.15.0
  • convert 3.0.1
  • crypto 3.0.1
  • dart_console 1.0.0
  • dart_style 2.0.3
  • ffi 1.1.2
  • file 6.1.2
  • get_cli 1.6.0
  • glob 2.0.1
  • http 0.13.3
  • http_parser 4.0.0
  • intl 0.17.0
  • matcher 0.12.11
  • meta 1.7.0
  • package_config 2.0.0
  • path 1.8.0
  • pedantic 1.11.1
  • process_run 0.12.1+1
  • pub_semver 2.0.0
  • pubspec 2.0.1
  • quiver 3.0.1
  • recase 4.0.0
  • source_span 1.8.1
  • stack_trace 1.10.0
  • string_scanner 1.1.0
  • synchronized 3.0.0
  • term_glyph 1.2.0
  • typed_data 1.3.0
  • uri 1.0.0
  • version 2.0.0
  • watcher 1.0.0
  • win32 2.2.9
  • yaml 3.1.0
    Downloading get_cli 1.6.0...
    Downloading version 2.0.0...
    Downloading recase 4.0.0...
    Downloading pubspec 2.0.1...
    Downloading cli_menu 0.3.0-nullsafety.0...
    Downloading cli_dialog 0.5.0...
    Downloading ansicolor 2.0.1...
    Downloading uri 1.0.0...
    Downloading process_run 0.12.1+1...
    Downloading synchronized 3.0.0...
    Downloading dart_console 1.0.0...
    Downloading quiver 3.0.1...
    Downloading dart_style 2.0.3...
    Downloading analyzer 2.2.0...
    Downloading _fe_analyzer_shared 25.0.0...
    Downloading win32 2.2.9...
    Building package executables...
    Built get_cli:get.
    Installed executables get and getx.
    Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
    You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):

export PATH="PATH":"HOME/.pub-cache/bin"

Activated get_cli 1.6.0. </pre>

|`

第二步:设置环境变量

一般Mac的环境变量都是通过根目录的.bash_profile进行环境变量设置。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">#getX
export PATH="PATH":"HOME/.pub-cache/bin"
</pre>

|`

第三步:使设置的环境变量生效

我们可以通过source 加上路径,对环境变量生效。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:~ jm$ source "/Users/jm/.bash_profile"
</pre>

|`

第四步:校验是否成功安装

我们通过get命令,看能不能打印如下,如果有,那么恭喜你安装成功了。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:~ jm$ get

List available commands:

create:
controller: Generate controller
page: Use to generate pages
project: Use to generate new project
provider: Create a new Provider
screen: Generate new screen
view: Generate view
generate:
locales: Generate translation file from json files
model: generate Class model from json
help: Show this help
init: generate the chosen structure on an existing project:
install: Use to install a package in your project (dependencies):
remove: Use to remove a package in your project (dependencies):
sort: Sort imports and format dart files
update: To update GET_CLI
--version: Shows the current CLI version'

Time: 1814 Milliseconds </pre>

|`

Cli创建工程

我们可以通过get create project来进行创建工程,

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx jm$ get create project
</pre>

|`

然后出现如下提示,我们选择创建Flutter Project

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">--> 1) Flutter Project
2) Get Server
</pre>

|`

选择之后需要输入工程名称公司域名选择iOS语言选择Android语言是否空安全是否校验,选完知道就会为我们开始创建工程。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx jm$ get create project
--> 1) Flutter Project
2) Get Server
? what is the name of the project? getx_example
? What is your company's domain? Example: com.yourcompany com.jimi

what language do you want to use on ios?

  1) Swift

--> 2) Objective-C

what language do you want to use on android?

  1) Kotlin

--> 2) Java

Do you want to use null safe?

--> 1) Yes!
2) No

do you want to use some linter?

  1) no
  2) Pedantic [Deprecated]
  3) Effective Dart [Deprecated]

--> 4) Dart Recommended

Running flutter create /Users/jm/Desktop/Project/getx/getx_example … $ flutter create --no-pub -i objc -a java --org com.jimi /Users/jm/Desktop/Project/getx/getx_example
Creating project ....
test/widget_test.dart (created)
pubspec.yaml (created)
README.md (created)
lib/main.dart (created)
windows/runner/flutter_window.cpp (created)
windows/runner/utils.h (created)
windows/runner/utils.cpp (created)
windows/runner/runner.exe.manifest (created)
windows/runner/CMakeLists.txt (created)
windows/runner/win32_window.h (created)
windows/runner/Runner.rc (created)
windows/runner/win32_window.cpp (created)
windows/runner/resources/app_icon.ico (created)
windows/runner/main.cpp (created)
windows/runner/resource.h (created)
windows/runner/flutter_window.h (created)
windows/flutter/CMakeLists.txt (created)
windows/.gitignore (created)
windows/CMakeLists.txt (created)
ios/Runner.xcworkspace/contents.xcworkspacedata (created)
ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (created)
ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (created)
ios/Runner/Info.plist (created)
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png (created)
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png (created)
ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (created)
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (created)
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (created)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (created)
ios/Runner/Base.lproj/LaunchScreen.storyboard (created)
ios/Runner/Base.lproj/Main.storyboard (created)
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (created)
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (created)
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (created)
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (created)
ios/Flutter/Debug.xcconfig (created)
ios/Flutter/Release.xcconfig (created)
ios/Flutter/AppFrameworkInfo.plist (created)
ios/.gitignore (created)
getx_example.iml (created)
.gitignore (created)
web/favicon.png (created)
web/index.html (created)
web/manifest.json (created)
web/icons/Icon-maskable-512.png (created)
web/icons/Icon-192.png (created)
web/icons/Icon-maskable-192.png (created)
web/icons/Icon-512.png (created)
.metadata (created)
macos/Runner.xcworkspace/contents.xcworkspacedata (created)
macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (created)
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png (created)
macos/Runner/DebugProfile.entitlements (created)
macos/Runner/Base.lproj/MainMenu.xib (created)
macos/Runner/MainFlutterWindow.swift (created)
macos/Runner/Configs/Debug.xcconfig (created)
macos/Runner/Configs/Release.xcconfig (created)
macos/Runner/Configs/Warnings.xcconfig (created)
macos/Runner/Configs/AppInfo.xcconfig (created)
macos/Runner/AppDelegate.swift (created)
macos/Runner/Info.plist (created)
macos/Runner/Release.entitlements (created)
macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (created)
macos/Runner.xcodeproj/project.pbxproj (created)
macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (created)
macos/Flutter/Flutter-Debug.xcconfig (created)
macos/Flutter/Flutter-Release.xcconfig (created)
macos/.gitignore (created)
ios/Runner/AppDelegate.h (created)
ios/Runner/main.m (created)
ios/Runner/AppDelegate.m (created)
ios/Runner.xcodeproj/project.pbxproj (created)
android/app/src/profile/AndroidManifest.xml (created)
android/app/src/main/res/mipmap-mdpi/ic_launcher.png (created)
android/app/src/main/res/mipmap-hdpi/ic_launcher.png (created)
android/app/src/main/res/drawable/launch_background.xml (created)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (created)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (created)
android/app/src/main/res/values-night/styles.xml (created)
android/app/src/main/res/values/styles.xml (created)
android/app/src/main/res/drawable-v21/launch_background.xml (created)
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (created)
android/app/src/main/AndroidManifest.xml (created)
android/app/src/debug/AndroidManifest.xml (created)
android/gradle/wrapper/gradle-wrapper.properties (created)
android/gradle.properties (created)
android/.gitignore (created)
android/settings.gradle (created)
android/app/build.gradle (created)
android/app/src/main/java/com/jimi/getx_example/MainActivity.java (created)
android/build.gradle (created)
android/getx_example_android.iml (created)
analysis_options.yaml (created)
.idea/runConfigurations/main_dart.xml (created)
.idea/libraries/Dart_SDK.xml (created)
.idea/libraries/KotlinJavaRuntime.xml (created)
.idea/modules.xml (created)
.idea/workspace.xml (created)
linux/main.cc (created)
linux/my_application.h (created)
linux/my_application.cc (created)
linux/flutter/CMakeLists.txt (created)
linux/.gitignore (created)
linux/CMakeLists.txt (created)
Wrote 129 files.

All done!
In order to run your application, type: cd . flutter run

Your application code is in ./lib/main.dart.

Running flutter pub getflutter pub get Running "flutter pub get" in getx_example... 898ms dart migrate --apply-changes --skip-import-check
Migrating /Users/jm/Desktop/Project/getx/getx_example

See https://dart.dev/go/null-safety-migration for a migration guide.

Analyzing project...
All sources appear to be already migrated. Nothing to do.
✖ + HandshakeException: Connection terminated during handshake

✓ File: analysis_options.yaml created successfully at path: analysis_options.yaml
--> 1) GetX Pattern (by Kauê)
2) CLEAN (by Arktekko)

Your lib folder is not empty. Are you sure you want to overwrite your application?
WARNING: This action is irreversible

--> 1) Yes!
2) No
✓ 'Package: get installed!
✓ File: main.dart created successfully at path: lib/main.dart
✓ File: home_controller.dart created successfully at path: ./lib/app/modules/home/controllers/home_controller.dart
✓ File: home_view.dart created successfully at path: ./lib/app/modules/home/views/home_view.dart
✓ File: home_binding.dart created successfully at path: ./lib/app/modules/home/bindings/home_binding.dart
✓ File: app_routes.dart created successfully at path: lib/app/routes/app_routes.dart
✓ File: app_pages.dart created successfully at path: lib/app/routes/app_pages.dart
✓ home route created successfully.
✓ Home page created successfully.
✓ GetX Pattern structure successfully generated.

Running flutter pub get

$ flutter pub get
Running "flutter pub get" in getx_example... 968ms

Time: 53925 Milliseconds
</pre>

|`

如果能看到如上就证明通过Cli创建工程成功了。

Cli创建页面

第一种:Getx_pattern

我们可以通过get create page:login来快速创建一个页面,这个页面有controllerviewbindingroutes等配置,结构是Getx_pattern

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get create page:login
✓ File: login_controller.dart created successfully at path: ./lib/app/modules/login/controllers/login_controller.dart
✓ File: login_view.dart created successfully at path: ./lib/app/modules/login/views/login_view.dart
✓ File: login_binding.dart created successfully at path: ./lib/app/modules/login/bindings/login_binding.dart
✓ login route created successfully.
✓ Login page created successfully.

Time: 453 Milliseconds

JMdeMacBook-Pro:getx_example jm$
</pre>

|`

第二种:CLEAN

我们可以通过get create page:login来快速创建一个页面,这个页面有controllerviewbindingroutes等配置,结构是CLEAN

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get create screen:name
✓ File: name.controller.dart created successfully at path: ./lib/presentation/name/controllers/name.controller.dart
✓ File: name.screen.dart created successfully at path: ./lib/presentation/name/name.screen.dart
✓ File: name.controller.binding.dart created successfully at path: lib/infrastructure/navigation/bindings/controllers/name.controller.binding.dart
✓ File: routes.dart created successfully at path: lib/infrastructure/navigation/routes.dart
✓ File: routes.dart created successfully at path: lib/infrastructure/navigation/routes.dart
✓ name route created successfully.
✓ File: navigation.dart created successfully at path: lib/infrastructure/navigation/navigation.dart
✓ Name navigation added successfully.

Time: 482 Milliseconds
</pre>

|`

Cli创建控制器

我们可以通过get create controller:login来快速为已存在的page进行创建controller,并且他还重新了controller的生命周期以及初始化方法。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">get create controller:another on home
✓ File: another_controller.dart created successfully at path: ./lib/app/modules/home/controllers/another_controller.dart
✓ The Another has been added to binding at path: lib/app/modules/home/bindings/home_binding.dart'

Time: 387 Milliseconds

JMdeMacBook-Pro:getx_example jm$ </pre>

|`

Cli创建View

如果我们只是想单独创建一个View,那我们可以通过get create view:alogin on login来进行创建。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;"> get create view:alogin on login
✓ File: alogin_view.dart created successfully at path: ./lib/app/modules/login/views/alogin_view.dart

Time: 378 Milliseconds

JMdeMacBook-Pro:getx_example jm$
</pre>

|`

Cli创建Provider

如果我们需要创建GetConnect,那我们可以通过get create provider:blogin on login来进行创建。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get create provider:blogin on login
✓ File: blogin_provider.dart created successfully at path: ./lib/app/modules/login/providers/blogin_provider.dart

Time: 357 Milliseconds

JMdeMacBook-Pro:getx_example jm$
</pre>

|`

Cli创建国际化

如果我们需要对应用进行国际化配置,那我们可以通过get generate locales assets/locales来进行创建。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get generate locales assets/locales
✓ File: locales.g.dart created successfully at path: lib/generated/locales.g.dart
✓ locale files generated successfully.

Time: 416 Milliseconds

JMdeMacBook-Pro:getx_example jm$
</pre>

|`

Cli通过json生成模型

第一种:不仅创建模型类,还会提供Provider

如果我们需要对某个json文件生成模型,那我们可以通过get generate model on home with assets/models/user.json来进行生成

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get generate model on home with assets/models/user.json
✓ File: user_model.dart created successfully at path: ./lib/app/modules/home/user_model.dart
✓ File: user_provider.dart created successfully at path: ./lib/app/modules/home/providers/user_provider.dart

Time: 499 Milliseconds

JMdeMacBook-Pro:getx_example jm$
</pre>

|`

第二种:只生成模型类

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get generate model on login with assets/models/user.json --skipProvider
✓ File: user_model.dart created successfully at path: ./lib/app/modules/login/user_model.dart

Time: 408 Milliseconds
</pre>

|`

第三种:通过连接生成模型类

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get generate model on home from "https://api.github.com/users/CpdnCristiano"
? Could not set the model name automatically, which name do you want to use? githubHome
✓ File: github_home_model.dart created successfully at path: ./lib/app/modules/home/github_home_model.dart
✓ File: github_home_provider.dart created successfully at path: ./lib/app/modules/home/providers/github_home_provider.dart

Time: 14033 Milliseconds
</pre>

|`

Cli安装包(dependencies)

第一种:直接安装最新版本

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
12
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get install dio

Installing package "dio" …

✓ 'Package: dio installed!

Running flutter pub get … $ flutter pub get
Running "flutter pub get" in getx_example... 2,656ms

Time: 5815 Milliseconds </pre>

|`

第二种:同时安装多个包

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get install path dio

Installing package "path" …

✓ 'Package: path installed!

Installing package "dio" …

✓ 'Package: dio installed!

Running flutter pub get

$ flutter pub get
Running "flutter pub get" in getx_example... 732ms

Time: 7146 Milliseconds
</pre>

|`

第三种:安装自定版本的包

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get install prodiver:5.0.0

Installing package "prodiver" …

✓ 'Package: prodiver installed! </pre>

|`

Cli安装包(dev_dependencies)

我们可以通过get install flutter_launcher_icons --dev安装开发时所依赖的包

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get install flutter_launcher_icons --dev

The [--dev] is not necessary

Installing package "flutter_launcher_icons" …

✓ 'Package: flutter_launcher_icons installed! </pre>

|`

Cli卸载包

第一种:卸载某个安装包

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get remove http

Removing package: "http"

Package: http is not installed in this application

Running flutter pub get

$ flutter pub get
Running "flutter pub get" in getx_example... 772ms

Time: 2641 Milliseconds

</pre>

|`

第二种:同时卸载多个包

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get remove dio path

Removing package: "dio"

✓ Package: dio removed!

Removing package: "path"

✓ Package: path removed!

Running flutter pub get

$ flutter pub get
Running "flutter pub get" in getx_example... 1,085ms

Time: 3142 Milliseconds
</pre>

|`

Cli更新脚手架

我们可以通过get update对脚手架进行更新

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get update

Latest version of get_cli already installed

Time: 3315 Milliseconds
</pre>

|`

Cli查看版本号

我们可以通过get -v 查看当前脚手架的版本号

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get -v
░██████╗░███████╗████████╗   ░█████╗░██╗░░░░░░██╗
██╔════╝░██╔════╝╚══██╔══╝   ██╔══██╗██║░░░░░░██║
██║░░██╗░█████╗░░░░░██║░░░   ██║░░╚═╝██║░░░░░░██║
██║░░╚██╗██╔══╝░░░░░██║░░░   ██║░░██╗██║░░░░░░██║
╚██████╔╝███████╗░░░██║░░░   ╚█████╔╝███████╗ ██║
░╚═════╝░╚══════╝░░░╚═╝░░░   ░╚════╝░╚══════╝ ╚═╝

Version: 1.6.0

Time: 148 Milliseconds
</pre>

|`

Cli帮助

当我们忘记了命令的使用方式,我们可以通过get help进行查看帮助。

`|

<pre class="lineno" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: var(--highlight-lineno-color); line-height: 1.4rem; overflow-wrap: normal; word-break: normal; margin-left: 0.2rem; padding-right: 0.5rem; min-width: 2.2rem; text-align: right; border-right: 1px solid var(--highlight-lineno-border-color); user-select: none;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>

|

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85rem; margin-top: 0px; margin-bottom: 0px; overflow: visible; display: block; color: rgb(33, 37, 41); line-height: 1.4rem; overflow-wrap: normal; word-break: normal;">JMdeMacBook-Pro:getx_example jm$ get help

List available commands:

create:
controller: Generate controller
page: Use to generate pages
project: Use to generate new project
provider: Create a new Provider
screen: Generate new screen
view: Generate view
generate:
locales: Generate translation file from json files
model: generate Class model from json
help: Show this help
init: generate the chosen structure on an existing project:
install: Use to install a package in your project (dependencies):
remove: Use to remove a package in your project (dependencies):
sort: Sort imports and format dart files
update: To update GET_CLI
--version: Shows the current CLI version'

Time: 94 Milliseconds </pre>

|`

总结

以上就是对Cli的脚手架命令的一个实践和总结,相对于自己手动创建结构,用Cli就可以很轻松的实现。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,088评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,715评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,361评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,099评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 60,987评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,063评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,486评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,175评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,440评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,518评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,305评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,190评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,550评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,880评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,152评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,451评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,637评论 2 335

推荐阅读更多精彩内容