2024年Android最新flutter 进阶 GetX系列教程---Cli使用以及常用命令,2024年最新Android自学资料

总结

学习技术是一条慢长而艰苦的道路,不能靠一时激情,也不是熬几天几夜就能学好的,必须养成平时努力学习的习惯。所以:贵在坚持!

最后如何才能让我们在面试中对答如流呢?

答案当然是平时在工作或者学习中多提升自身实力的啦,那如何才能正确的学习,有方向的学习呢?有没有免费资料可以借鉴?为此我整理了一份Android学习资料路线:

这里是一部分我工作以来以及参与过的大大小小的面试收集总结出来的一套BAT大厂面试资料专题包,主要还是希望大家在如今大环境不好的情况下面试能够顺利一点,希望可以帮助到大家。

好了,今天的分享就到这里,如果你对在面试中遇到的问题,或者刚毕业及工作几年迷茫不知道该如何准备面试并突破现状提升自己,对于自己的未来还不够了解不知道给如何规划。来看看同行们都是如何突破现状,怎么学习的,来吸收他们的面试以及工作经验完善自己的之后的面试计划及职业规划。

最后,祝愿即将跳槽和已经开始求职的大家都能找到一份好的工作!

这些只是整理出来的部分面试题,后续会持续更新,希望通过这些高级面试题能够降低面试Android岗位的门槛,让更多的Android工程师理解Android系统,掌握Android系统。喜欢的话麻烦点击一个喜欢再关注一下~

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!


JMdeMacBook-Pro:getx jm$ get create project



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


-->   1) Flutter Project

      2) Get Server



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


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 get` …



$ flutter 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



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

Cli创建页面


第一种:Getx_pattern


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


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



第二种:CLEAN


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


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



Cli创建控制器


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


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



Cli创建View


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


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



Cli创建Provider


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


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



Cli创建国际化


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


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



Cli通过json生成模型


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

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


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$ 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



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


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



Cli安装包(dependencies)


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


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



第二种:同时安装多个包


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



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


JMdeMacBook-Pro:getx_example jm$ get install prodiver:5.0.0



Installing package "prodiver" …



✓  'Package: prodiver installed!



Cli安装包(dev_dependencies)


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


JMdeMacBook-Pro:getx_example jm$ get install flutter_launcher_icons --dev





The [--dev] is not necessary





Installing package "flutter_launcher_icons" …



### 最后

由于题目很多整理答案的工作量太大,所以仅限于提供知识点,详细的很多问题和参考答案我都整理成了 PDF文件

![](https://img-blog.csdnimg.cn/img_convert/af58b06316c9a970f72aa5099b895887.webp?x-oss-process=image/format,png)

![](https://img-blog.csdnimg.cn/img_convert/84fa44cddf8885e611e321381d2ebcf4.webp?x-oss-process=image/format,png)

![](https://img-blog.csdnimg.cn/img_convert/7d10dd986735b1bcf5b0f76f7bd50e2f.webp?x-oss-process=image/format,png)



**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化学习资料的朋友,可以戳这里获取](https://bbs.csdn.net/topics/618156601)**

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

lling package "prodiver" …



✓  'Package: prodiver installed!



Cli安装包(dev_dependencies)


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


JMdeMacBook-Pro:getx_example jm$ get install flutter_launcher_icons --dev





The [--dev] is not necessary





Installing package "flutter_launcher_icons" …



### 最后

由于题目很多整理答案的工作量太大,所以仅限于提供知识点,详细的很多问题和参考答案我都整理成了 PDF文件

[外链图片转存中...(img-QU5xBRzU-1715666084393)]

[外链图片转存中...(img-bNoBX51a-1715666084394)]

[外链图片转存中...(img-rhQTKwL3-1715666084394)]



**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化学习资料的朋友,可以戳这里获取](https://bbs.csdn.net/topics/618156601)**

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值