├── .gitignore ├── .lh ├── .lhignore ├── .vscode │ └── settings.json.json └── lib │ └── app │ ├── modules │ ├── home │ │ └── views │ │ │ └── home_view.dart.json │ └── tabs │ │ ├── bindings │ │ └── tabs_binding.dart.json │ │ └── views │ │ └── tabs_view.dart.json │ └── routes │ ├── app_pages.dart.json │ └── app_routes.dart.json ├── .metadata ├── .vscode └── settings.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── kiko_getx_xmshop │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── fonts │ ├── iconfont.json │ ├── iconfont.ttf │ ├── userIconfont.json │ └── userIconfont.ttf └── images │ ├── 2.0x │ ├── hot_search.png │ ├── logo.png │ ├── service.png │ ├── user.png │ ├── user_ad1.png │ ├── user_ad2.png │ ├── xiaomiBanner.png │ └── xiaomiBanner2.png │ ├── 3.0x │ ├── hot_search.png │ ├── logo.png │ ├── service.png │ ├── user.png │ ├── user_ad1.png │ ├── user_ad2.png │ ├── xiaomiBanner.png │ └── xiaomiBanner2.png │ ├── hot_search.png │ ├── logo.png │ ├── service.png │ ├── user.png │ ├── user_ad1.png │ ├── user_ad2.png │ ├── xiaomiBanner.png │ └── xiaomiBanner2.png ├── img ├── 01首页-1.jpg ├── 02首页-2.jpg ├── 03-首页-3.jpg ├── 04-分类页面.jpg ├── 05-列表页面-1.jpg ├── 06列表页面-2.jpg ├── 07 详情页面-1.jpg ├── 08 详情页面-2.jpg ├── 08-详情页面-3.jpg ├── 09购物车页面.jpg ├── 10 提交订单.jpg ├── 11收货地址.jpg └── 13用户.jpg ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h └── RunnerTests │ └── RunnerTests.swift ├── lib ├── app │ ├── models │ │ ├── address_model.dart │ │ ├── category_model.dart │ │ ├── focus_model.dart │ │ ├── message.dart │ │ ├── pcontent_model.dart │ │ ├── plist_model.dart │ │ └── user_model.dart │ ├── modules │ │ ├── address │ │ │ ├── addressAdd │ │ │ │ ├── bindings │ │ │ │ │ └── address_add_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── address_add_controller.dart │ │ │ │ └── views │ │ │ │ │ └── address_add_view.dart │ │ │ ├── addressEdit │ │ │ │ ├── bindings │ │ │ │ │ └── address_edit_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── address_edit_controller.dart │ │ │ │ └── views │ │ │ │ │ └── address_edit_view.dart │ │ │ └── addressList │ │ │ │ ├── bindings │ │ │ │ └── address_list_binding.dart │ │ │ │ ├── controllers │ │ │ │ └── address_list_controller.dart │ │ │ │ └── views │ │ │ │ └── address_list_view.dart │ │ ├── buy │ │ │ ├── bindings │ │ │ │ └── buy_binding.dart │ │ │ ├── controllers │ │ │ │ └── buy_controller.dart │ │ │ └── views │ │ │ │ └── buy_view.dart │ │ ├── cart │ │ │ ├── controllers │ │ │ │ └── cart_controller.dart │ │ │ └── views │ │ │ │ ├── cart_item_mun_view.dart │ │ │ │ ├── cart_item_view.dart │ │ │ │ └── cart_view.dart │ │ ├── category │ │ │ ├── controllers │ │ │ │ └── category_controller.dart │ │ │ └── views │ │ │ │ └── category_view.dart │ │ ├── checkout │ │ │ ├── bindings │ │ │ │ └── checkout_binding.dart │ │ │ ├── controllers │ │ │ │ └── checkout_controller.dart │ │ │ └── views │ │ │ │ └── checkout_view.dart │ │ ├── home │ │ │ ├── controllers │ │ │ │ └── home_controller.dart │ │ │ └── views │ │ │ │ └── home_view.dart │ │ ├── login │ │ │ ├── codeLoginStepOne │ │ │ │ ├── bindings │ │ │ │ │ └── code_login_step_one_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── code_login_step_one_controller.dart │ │ │ │ └── views │ │ │ │ │ └── code_login_step_one_view.dart │ │ │ ├── codeLoginStepTwo │ │ │ │ ├── bindings │ │ │ │ │ └── code_login_step_two_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── code_login_step_two_controller.dart │ │ │ │ └── views │ │ │ │ │ └── code_login_step_two_view.dart │ │ │ ├── onStepLogin │ │ │ │ ├── bindings │ │ │ │ │ └── on_step_login_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── on_step_login_controller.dart │ │ │ │ └── views │ │ │ │ │ └── on_step_login_view.dart │ │ │ ├── passLogin │ │ │ │ ├── bindings │ │ │ │ │ └── pass_login_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── pass_login_controller.dart │ │ │ │ └── views │ │ │ │ │ └── pass_login_view.dart │ │ │ ├── registerStepOne │ │ │ │ ├── bindings │ │ │ │ │ └── register_step_one_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── register_step_one_controller.dart │ │ │ │ └── views │ │ │ │ │ └── register_step_one_view.dart │ │ │ ├── registerStepThree │ │ │ │ ├── bindings │ │ │ │ │ └── register_step_three_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── register_step_three_controller.dart │ │ │ │ └── views │ │ │ │ │ └── register_step_three_view.dart │ │ │ └── registerStepTwo │ │ │ │ ├── bindings │ │ │ │ └── register_step_two_binding.dart │ │ │ │ ├── controllers │ │ │ │ └── register_step_two_controller.dart │ │ │ │ └── views │ │ │ │ └── register_step_two_view.dart │ │ ├── productContent │ │ │ ├── bindings │ │ │ │ └── product_content_binding.dart │ │ │ ├── controllers │ │ │ │ └── product_content_controller.dart │ │ │ └── views │ │ │ │ ├── cart_item_mun_view.dart │ │ │ │ ├── frist_tab_view.dart │ │ │ │ ├── product_content_view.dart │ │ │ │ ├── three_tab_view.dart │ │ │ │ └── two_tab_view.dart │ │ ├── productList │ │ │ ├── bindings │ │ │ │ └── product_list_binding.dart │ │ │ ├── controllers │ │ │ │ └── product_list_controller.dart │ │ │ └── views │ │ │ │ └── product_list_view.dart │ │ ├── serach │ │ │ ├── bindings │ │ │ │ └── serach_binding.dart │ │ │ ├── controllers │ │ │ │ └── serach_controller.dart │ │ │ └── views │ │ │ │ └── serach_view.dart │ │ ├── service │ │ │ ├── controllers │ │ │ │ └── service_controller.dart │ │ │ ├── jiPush │ │ │ │ ├── bindings │ │ │ │ │ └── ji_push_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── ji_push_controller.dart │ │ │ │ └── views │ │ │ │ │ └── ji_push_view.dart │ │ │ ├── lanya │ │ │ │ ├── bindings │ │ │ │ │ └── lanya_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── lanya_controller.dart │ │ │ │ └── views │ │ │ │ │ └── lanya_view.dart │ │ │ ├── live │ │ │ │ ├── bindings │ │ │ │ │ └── live_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── live_controller.dart │ │ │ │ └── views │ │ │ │ │ └── live_view.dart │ │ │ ├── oneClickLogin │ │ │ │ ├── bindings │ │ │ │ │ └── one_click_login_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── one_click_login_controller.dart │ │ │ │ └── views │ │ │ │ │ └── one_click_login_view.dart │ │ │ ├── views │ │ │ │ └── service_view.dart │ │ │ ├── watch │ │ │ │ ├── bindings │ │ │ │ │ └── watch_binding.dart │ │ │ │ ├── controllers │ │ │ │ │ └── watch_controller.dart │ │ │ │ └── views │ │ │ │ │ └── watch_view.dart │ │ │ └── wift │ │ │ │ ├── bindings │ │ │ │ └── wift_binding.dart │ │ │ │ ├── controllers │ │ │ │ └── wift_controller.dart │ │ │ │ └── views │ │ │ │ └── wift_view.dart │ │ ├── tabs │ │ │ ├── bindings │ │ │ │ └── tabs_binding.dart │ │ │ ├── controllers │ │ │ │ └── tabs_controller.dart │ │ │ └── views │ │ │ │ └── tabs_view.dart │ │ └── user │ │ │ ├── controllers │ │ │ └── user_controller.dart │ │ │ └── views │ │ │ └── user_view.dart │ ├── routes │ │ ├── app_pages.dart │ │ └── app_routes.dart │ ├── units │ │ ├── cartServices.dart │ │ ├── httpsClient.dart │ │ ├── keepAliveWrapper.dart │ │ ├── myFonts.dart │ │ ├── screenAdapter.dart │ │ ├── searchServices.dart │ │ ├── signServices.dart │ │ ├── storage.dart │ │ └── userServices.dart │ └── widget │ │ ├── logo.dart │ │ ├── passButton.dart │ │ ├── passTextField.dart │ │ ├── pinInput.dart │ │ └── userAgreement.dart └── main.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── RunnerTests │ └── RunnerTests.swift ├── pubspec.lock ├── pubspec.yaml ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Android Studio will place build artifacts here 41 | /android/app/debug 42 | /android/app/profile 43 | /android/app/release 44 | -------------------------------------------------------------------------------- /.lh/.lhignore: -------------------------------------------------------------------------------- 1 | # list file to not track by the local-history extension. comment line starts with a '#' character 2 | # each line describe a regular expression pattern (search for 'Javascript regex') 3 | # it will relate to the workspace directory root. for example: 4 | # '.*\.txt' ignores any file with 'txt' extension 5 | # '/test/.*' ignores all the files under the 'test' directory 6 | # '.*/test/.*' ignores all the files under any 'test' directory (even under sub-folders) 7 | -------------------------------------------------------------------------------- /.lh/.vscode/settings.json.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourceFile": ".vscode/settings.json", 3 | "activeCommit": 0, 4 | "commits": [ 5 | { 6 | "activePatchIndex": 1, 7 | "patches": [ 8 | { 9 | "date": 1708482939337, 10 | "content": "Index: \n===================================================================\n--- \n+++ \n" 11 | }, 12 | { 13 | "date": 1708484155533, 14 | "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,3 +1,4 @@\n {\r\n- \"java.compile.nullAnalysis.mode\": \"automatic\"\r\n+ \"java.compile.nullAnalysis.mode\": \"automatic\",\r\n+ \"cmake.sourceDirectory\": \"F:/Project/flutter/kiko_getx_xmshop/windows/flutter\"\r\n }\n\\ No newline at end of file\n" 15 | } 16 | ], 17 | "date": 1708482939337, 18 | "name": "Commit-0", 19 | "content": "{\r\n \"java.compile.nullAnalysis.mode\": \"automatic\"\r\n}" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.lh/lib/app/modules/tabs/bindings/tabs_binding.dart.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourceFile": "lib/app/modules/tabs/bindings/tabs_binding.dart", 3 | "activeCommit": 0, 4 | "commits": [ 5 | { 6 | "activePatchIndex": 1, 7 | "patches": [ 8 | { 9 | "date": 1708488485607, 10 | "content": "Index: \n===================================================================\n--- \n+++ \n" 11 | }, 12 | { 13 | "date": 1708488761698, 14 | "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,4 +1,12 @@\n+/*\n+ * @Descripttion: \n+ * @version: \n+ * @Author: kiko\n+ * @Date: 2024-02-21 11:07:38\n+ * @LastEditors: kiko\n+ * @LastEditTime: 2024-02-21 12:12:41\n+ */\n import 'package:get/get.dart';\n \n import '../controllers/tabs_controller.dart';\n import '../../cart/controllers/cart_controller.dart';\n@@ -15,6 +23,17 @@\n );\n Get.lazyPut(\n () => HomeController(),\n );\n+ Get.lazyPut(\n+ () => CartController(),\n+ );\n+ Get.lazyPut(\n+ () => CategoryController(),\n+ );Get.lazyPut(\n+ () => ServiceController(),\n+ );\n+ Get.lazyPut(\n+ () => UserController(),\n+ );\n }\n }\n" 15 | } 16 | ], 17 | "date": 1708488485607, 18 | "name": "Commit-0", 19 | "content": "import 'package:get/get.dart';\n\nimport '../controllers/tabs_controller.dart';\nimport '../../cart/controllers/cart_controller.dart';\nimport '../../category/controllers/category_controller.dart';\nimport '../../home/controllers/home_controller.dart';\nimport '../../service/controllers/service_controller.dart';\nimport '../../user/controllers/user_controller.dart';\n\nclass TabsBinding extends Bindings {\n @override\n void dependencies() {\n Get.lazyPut(\n () => TabsController(),\n );\n Get.lazyPut(\n () => HomeController(),\n );\n }\n}\n" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.lh/lib/app/routes/app_pages.dart.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourceFile": "lib/app/routes/app_pages.dart", 3 | "activeCommit": 0, 4 | "commits": [ 5 | { 6 | "activePatchIndex": 2, 7 | "patches": [ 8 | { 9 | "date": 1708487831393, 10 | "content": "Index: \n===================================================================\n--- \n+++ \n" 11 | }, 12 | { 13 | "date": 1708488281314, 14 | "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,21 +1,17 @@\n+/*\n+ * @Descripttion: \n+ * @version: \n+ * @Author: kiko\n+ * @Date: 2024-02-21 10:54:07\n+ * @LastEditors: kiko\n+ * @LastEditTime: 2024-02-21 12:04:40\n+ */\n import 'package:get/get.dart';\n \n-import '../modules/cart/bindings/cart_binding.dart';\n-import '../modules/cart/views/cart_view.dart';\n-import '../modules/category/bindings/category_binding.dart';\n-import '../modules/category/views/category_view.dart';\n-import '../modules/home/bindings/home_binding.dart';\n-import '../modules/home/views/home_view.dart';\n-import '../modules/serach/bindings/serach_binding.dart';\n-import '../modules/serach/views/serach_view.dart';\n-import '../modules/service/bindings/service_binding.dart';\n-import '../modules/service/views/service_view.dart';\n+\n import '../modules/tabs/bindings/tabs_binding.dart';\n import '../modules/tabs/views/tabs_view.dart';\n-import '../modules/user/bindings/user_binding.dart';\n-import '../modules/user/views/user_view.dart';\n-\n part 'app_routes.dart';\n \n class AppPages {\n AppPages._();\n" 15 | }, 16 | { 17 | "date": 1708524197448, 18 | "content": "Index: \n===================================================================\n--- \n+++ \n@@ -7,9 +7,8 @@\n * @LastEditTime: 2024-02-21 12:04:40\n */\n import 'package:get/get.dart';\n \n-\n import '../modules/tabs/bindings/tabs_binding.dart';\n import '../modules/tabs/views/tabs_view.dart';\n part 'app_routes.dart';\n \n@@ -18,13 +17,11 @@\n \n static const INITIAL = Routes.TABS;\n \n static final routes = [\n- \n GetPage(\n name: _Paths.TABS,\n page: () => const TabsView(),\n binding: TabsBinding(),\n ),\n- \n ];\n }\n" 19 | } 20 | ], 21 | "date": 1708487831393, 22 | "name": "Commit-0", 23 | "content": "import 'package:get/get.dart';\n\nimport '../modules/cart/bindings/cart_binding.dart';\nimport '../modules/cart/views/cart_view.dart';\nimport '../modules/category/bindings/category_binding.dart';\nimport '../modules/category/views/category_view.dart';\nimport '../modules/home/bindings/home_binding.dart';\nimport '../modules/home/views/home_view.dart';\nimport '../modules/serach/bindings/serach_binding.dart';\nimport '../modules/serach/views/serach_view.dart';\nimport '../modules/service/bindings/service_binding.dart';\nimport '../modules/service/views/service_view.dart';\nimport '../modules/tabs/bindings/tabs_binding.dart';\nimport '../modules/tabs/views/tabs_view.dart';\nimport '../modules/user/bindings/user_binding.dart';\nimport '../modules/user/views/user_view.dart';\n\npart 'app_routes.dart';\n\nclass AppPages {\n AppPages._();\n\n static const INITIAL = Routes.TABS;\n\n static final routes = [\n \n GetPage(\n name: _Paths.TABS,\n page: () => const TabsView(),\n binding: TabsBinding(),\n ),\n \n ];\n}\n" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /.lh/lib/app/routes/app_routes.dart.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourceFile": "lib/app/routes/app_routes.dart", 3 | "activeCommit": 0, 4 | "commits": [ 5 | { 6 | "activePatchIndex": 1, 7 | "patches": [ 8 | { 9 | "date": 1708487916293, 10 | "content": "Index: \n===================================================================\n--- \n+++ \n" 11 | }, 12 | { 13 | "date": 1708524186213, 14 | "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,4 +1,12 @@\n+/*\n+ * @Descripttion: \n+ * @version: \n+ * @Author: kiko\n+ * @Date: 2024-02-21 10:54:07\n+ * @LastEditors: kiko\n+ * @LastEditTime: 2024-02-21 11:58:36\n+ */\n part of 'app_pages.dart';\n // DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart\n \n abstract class Routes {\n" 15 | } 16 | ], 17 | "date": 1708487916293, 18 | "name": "Commit-0", 19 | "content": "part of 'app_pages.dart';\n// DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart\n\nabstract class Routes {\n Routes._();\n static const TABS = _Paths.TABS;\n}\n\nabstract class _Paths {\n _Paths._();\n\n static const TABS = '/tabs';\n}\n" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 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: "41456452f29d64e8deb623a3c927524bcf9f111b" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 17 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 18 | - platform: android 19 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 20 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 21 | - platform: ios 22 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 23 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 24 | - platform: linux 25 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 26 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 27 | - platform: macos 28 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 29 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 30 | - platform: web 31 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 32 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 33 | - platform: windows 34 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 35 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.compile.nullAnalysis.mode": "automatic", 3 | "cmake.sourceDirectory": "F:/Project/flutter/kiko_getx_xmshop/windows/flutter", 4 | "cSpell.words": [ 5 | "Swiper" 6 | ] 7 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kiko_getx_xmshop 2 | 3 | 一个企业级移动电商实战项目,最新稳定版3.16版本 项目中通过 get_cli 集成 Getx(状态管理、依赖注入、路由管理、国际化),并且使用真实的接口; 4 | 5 | 持续更新中,欢迎讨论,共同进步。 6 | 7 | ps:来都来了,给个star吧🐶 8 | 9 | ## 效果预览 10 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/01%E9%A6%96%E9%A1%B5-1.jpg) 11 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/02%E9%A6%96%E9%A1%B5-2.jpg) 12 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/04-%E5%88%86%E7%B1%BB%E9%A1%B5%E9%9D%A2.jpg) 13 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/05-%E5%88%97%E8%A1%A8%E9%A1%B5%E9%9D%A2-1.jpg) 14 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/07%20%E8%AF%A6%E6%83%85%E9%A1%B5%E9%9D%A2-1.jpg) 15 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/08%20%E8%AF%A6%E6%83%85%E9%A1%B5%E9%9D%A2-2.jpg) 16 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/09%E8%B4%AD%E7%89%A9%E8%BD%A6%E9%A1%B5%E9%9D%A2.jpg) 17 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/10%20%E6%8F%90%E4%BA%A4%E8%AE%A2%E5%8D%95.jpg) 18 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/11%E6%94%B6%E8%B4%A7%E5%9C%B0%E5%9D%80.jpg) 19 | ![image](https://github.com/web-kiko/flutter3_getx_shop/blob/main/img/13%E7%94%A8%E6%88%B7.jpg) 20 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | def localProperties = new Properties() 8 | def localPropertiesFile = rootProject.file('local.properties') 9 | if (localPropertiesFile.exists()) { 10 | localPropertiesFile.withReader('UTF-8') { reader -> 11 | localProperties.load(reader) 12 | } 13 | } 14 | 15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 16 | if (flutterVersionCode == null) { 17 | flutterVersionCode = '1' 18 | } 19 | 20 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 21 | if (flutterVersionName == null) { 22 | flutterVersionName = '1.0' 23 | } 24 | 25 | android { 26 | namespace "com.example.kiko_getx_xmshop" 27 | compileSdkVersion flutter.compileSdkVersion 28 | ndkVersion flutter.ndkVersion 29 | 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | 35 | kotlinOptions { 36 | jvmTarget = '1.8' 37 | } 38 | 39 | sourceSets { 40 | main.java.srcDirs += 'src/main/kotlin' 41 | } 42 | 43 | defaultConfig { 44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 45 | applicationId "com.example.kiko_getx_xmshop" 46 | // You can update the following values to match your application needs. 47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 48 | minSdkVersion flutter.minSdkVersion 49 | targetSdkVersion flutter.targetSdkVersion 50 | versionCode flutterVersionCode.toInteger() 51 | versionName flutterVersionName 52 | } 53 | 54 | buildTypes { 55 | release { 56 | // TODO: Add your own signing config for the release build. 57 | // Signing with the debug keys for now, so `flutter run --release` works. 58 | signingConfig signingConfigs.debug 59 | } 60 | } 61 | } 62 | 63 | flutter { 64 | source '../..' 65 | } 66 | 67 | dependencies {} 68 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/kiko_getx_xmshop/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.kiko_getx_xmshop 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | mavenCentral() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | tasks.register("clean", Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | #distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.5-all.zip -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | repositories { 14 | google() 15 | mavenCentral() 16 | gradlePluginPortal() 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false 21 | } 22 | } 23 | 24 | plugins { 25 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 26 | id "com.android.application" version "7.3.0" apply false 27 | } 28 | 29 | include ":app" 30 | -------------------------------------------------------------------------------- /assets/fonts/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "", 3 | "name": "", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "5387432", 10 | "name": "维修服务", 11 | "font_class": "weixiufuwu", 12 | "unicode": "ead5", 13 | "unicode_decimal": 60117 14 | }, 15 | { 16 | "icon_id": "26849841", 17 | "name": "小米", 18 | "font_class": "XiaoMi", 19 | "unicode": "e623", 20 | "unicode_decimal": 58915 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /assets/fonts/userIconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "", 3 | "name": "", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "1376", 10 | "name": "充电", 11 | "font_class": "chongdian", 12 | "unicode": "f01bf", 13 | "unicode_decimal": 983487 14 | }, 15 | { 16 | "icon_id": "2076258", 17 | "name": "客服", 18 | "font_class": "kefu", 19 | "unicode": "e88f", 20 | "unicode_decimal": 59535 21 | }, 22 | { 23 | "icon_id": "3858839", 24 | "name": "维修", 25 | "font_class": "weixiu", 26 | "unicode": "e607", 27 | "unicode_decimal": 58887 28 | }, 29 | { 30 | "icon_id": "5387432", 31 | "name": "维修服务", 32 | "font_class": "weixiufuwu", 33 | "unicode": "ead5", 34 | "unicode_decimal": 60117 35 | }, 36 | { 37 | "icon_id": "7287091", 38 | "name": "退换货", 39 | "font_class": "tuihuanhuo", 40 | "unicode": "e624", 41 | "unicode_decimal": 58916 42 | }, 43 | { 44 | "icon_id": "11064389", 45 | "name": "进度", 46 | "font_class": "schedule", 47 | "unicode": "e634", 48 | "unicode_decimal": 58932 49 | }, 50 | { 51 | "icon_id": "12319699", 52 | "name": " 建筑安装业", 53 | "font_class": "anzhuangyewu", 54 | "unicode": "e63c", 55 | "unicode_decimal": 58940 56 | }, 57 | { 58 | "icon_id": "21233105", 59 | "name": "兑换", 60 | "font_class": "duihuan", 61 | "unicode": "f4b0", 62 | "unicode_decimal": 62640 63 | }, 64 | { 65 | "icon_id": "22724211", 66 | "name": "icon-小米归属", 67 | "font_class": "icon-xiaomiguishu", 68 | "unicode": "e613", 69 | "unicode_decimal": 58899 70 | }, 71 | { 72 | "icon_id": "26849841", 73 | "name": "小米", 74 | "font_class": "XiaoMi", 75 | "unicode": "e623", 76 | "unicode_decimal": 58915 77 | } 78 | ] 79 | } 80 | -------------------------------------------------------------------------------- /assets/fonts/userIconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/fonts/userIconfont.ttf -------------------------------------------------------------------------------- /assets/images/2.0x/hot_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/hot_search.png -------------------------------------------------------------------------------- /assets/images/2.0x/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/logo.png -------------------------------------------------------------------------------- /assets/images/2.0x/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/service.png -------------------------------------------------------------------------------- /assets/images/2.0x/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/user.png -------------------------------------------------------------------------------- /assets/images/2.0x/user_ad1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/user_ad1.png -------------------------------------------------------------------------------- /assets/images/2.0x/user_ad2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/user_ad2.png -------------------------------------------------------------------------------- /assets/images/2.0x/xiaomiBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/xiaomiBanner.png -------------------------------------------------------------------------------- /assets/images/2.0x/xiaomiBanner2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/2.0x/xiaomiBanner2.png -------------------------------------------------------------------------------- /assets/images/3.0x/hot_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/hot_search.png -------------------------------------------------------------------------------- /assets/images/3.0x/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/logo.png -------------------------------------------------------------------------------- /assets/images/3.0x/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/service.png -------------------------------------------------------------------------------- /assets/images/3.0x/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/user.png -------------------------------------------------------------------------------- /assets/images/3.0x/user_ad1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/user_ad1.png -------------------------------------------------------------------------------- /assets/images/3.0x/user_ad2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/user_ad2.png -------------------------------------------------------------------------------- /assets/images/3.0x/xiaomiBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/xiaomiBanner.png -------------------------------------------------------------------------------- /assets/images/3.0x/xiaomiBanner2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/3.0x/xiaomiBanner2.png -------------------------------------------------------------------------------- /assets/images/hot_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/hot_search.png -------------------------------------------------------------------------------- /assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/logo.png -------------------------------------------------------------------------------- /assets/images/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/service.png -------------------------------------------------------------------------------- /assets/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/user.png -------------------------------------------------------------------------------- /assets/images/user_ad1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/user_ad1.png -------------------------------------------------------------------------------- /assets/images/user_ad2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/user_ad2.png -------------------------------------------------------------------------------- /assets/images/xiaomiBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/xiaomiBanner.png -------------------------------------------------------------------------------- /assets/images/xiaomiBanner2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/assets/images/xiaomiBanner2.png -------------------------------------------------------------------------------- /img/01首页-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/01首页-1.jpg -------------------------------------------------------------------------------- /img/02首页-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/02首页-2.jpg -------------------------------------------------------------------------------- /img/03-首页-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/03-首页-3.jpg -------------------------------------------------------------------------------- /img/04-分类页面.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/04-分类页面.jpg -------------------------------------------------------------------------------- /img/05-列表页面-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/05-列表页面-1.jpg -------------------------------------------------------------------------------- /img/06列表页面-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/06列表页面-2.jpg -------------------------------------------------------------------------------- /img/07 详情页面-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/07 详情页面-1.jpg -------------------------------------------------------------------------------- /img/08 详情页面-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/08 详情页面-2.jpg -------------------------------------------------------------------------------- /img/08-详情页面-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/08-详情页面-3.jpg -------------------------------------------------------------------------------- /img/09购物车页面.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/09购物车页面.jpg -------------------------------------------------------------------------------- /img/10 提交订单.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/10 提交订单.jpg -------------------------------------------------------------------------------- /img/11收货地址.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/11收货地址.jpg -------------------------------------------------------------------------------- /img/13用户.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/img/13用户.jpg -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Kiko Getx Xmshop 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | kiko_getx_xmshop 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/models/address_model.dart: -------------------------------------------------------------------------------- 1 | class AddressModel { 2 | bool? success; 3 | String? message; 4 | List? result; 5 | AddressModel({ 6 | this.success, 7 | this.message, 8 | this.result, 9 | }); 10 | 11 | 12 | AddressModel.fromJson(Map json) { 13 | success = json['success']; 14 | message = json['message']; 15 | 16 | if (json['result'] != null) { 17 | result = []; 18 | json['result'].forEach((v) { 19 | result?.add(AddressItemModel.fromJson(v)); 20 | }); 21 | } 22 | } 23 | } 24 | 25 | class AddressItemModel { 26 | String? sId; 27 | String? uid; 28 | String? name; 29 | String? phone; 30 | String? address; 31 | int? defaultAddress; 32 | int? status; 33 | 34 | AddressItemModel({ 35 | this.sId, 36 | this.uid, 37 | this.name, 38 | this.phone, 39 | this.address, 40 | this.defaultAddress, 41 | this.status, 42 | }); 43 | 44 | AddressItemModel.fromJson(Map json) { 45 | sId = json['_id']; 46 | uid = json['uid']; 47 | name = json['name']; 48 | phone = json['phone']; 49 | address = json['address']; 50 | defaultAddress = json['default_address']; 51 | status = json['status']; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/app/models/category_model.dart: -------------------------------------------------------------------------------- 1 | class CategoryModel { 2 | List? result; 3 | 4 | CategoryModel({this.result}); 5 | 6 | CategoryModel.fromJson(Map json) { 7 | if (json['result'] != null) { 8 | result = []; 9 | json['result'].forEach((v) { 10 | result?.add(CategoryItemModel.fromJson(v)); 11 | }); 12 | } 13 | } 14 | 15 | Map toJson() { 16 | final data = {}; 17 | if (result != null) { 18 | data['result'] = result?.map((v) => v.toJson()).toList(); 19 | } 20 | return data; 21 | } 22 | } 23 | 24 | class CategoryItemModel { 25 | String? sId; 26 | String? title; 27 | int? status; 28 | String? pic; 29 | String? pid; 30 | int? sort; 31 | int? isBest; 32 | int? goProduct; 33 | String? productId; 34 | 35 | CategoryItemModel( 36 | {this.sId, 37 | this.title, 38 | this.status, 39 | this.pic, 40 | this.pid, 41 | this.sort, 42 | this.isBest, 43 | this.goProduct, 44 | this.productId}); 45 | 46 | CategoryItemModel.fromJson(Map json) { 47 | sId = json['_id']; 48 | title = json['title']; 49 | status = json['status']; 50 | pic = json['pic']; 51 | pid = json['pid']; 52 | sort = json['sort']; 53 | isBest = json['is_best']; 54 | goProduct = json['go_product']; 55 | productId = json['product_id']; 56 | } 57 | 58 | Map toJson() { 59 | final data = {}; 60 | data['_id'] = sId; 61 | data['title'] = title; 62 | data['status'] = status; 63 | data['pic'] = pic; 64 | data['pid'] = pid; 65 | data['sort'] = sort; 66 | data['is_best'] = isBest; 67 | data['go_product'] = goProduct; 68 | data['product_id'] = productId; 69 | return data; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/app/models/focus_model.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-27 21:54:26 6 | * @LastEditors: kiko 7 | * @LastEditTime: 2024-02-27 21:59:32 8 | */ 9 | class FocusModel { 10 | List? result; 11 | 12 | FocusModel({this.result}); 13 | 14 | FocusModel.fromJson(Map json) { 15 | if (json['result'] != null) { 16 | result = []; 17 | json['result'].forEach((v) { 18 | result?.add(FocusItemModel.fromJson(v)); 19 | }); 20 | } 21 | } 22 | 23 | Map toJson() { 24 | final data = {}; 25 | if (result != null) { 26 | data['result'] = result?.map((v) => v.toJson()).toList(); 27 | } 28 | return data; 29 | } 30 | } 31 | 32 | class FocusItemModel { 33 | String? sId; 34 | String? title; 35 | String? status; 36 | String? pic; 37 | String? url; 38 | int? position; 39 | 40 | FocusItemModel( 41 | {this.sId, this.title, this.status, this.pic, this.url, this.position}); 42 | 43 | FocusItemModel.fromJson(Map json) { 44 | sId = json['_id']; 45 | title = json['title']; 46 | status = json['status']; 47 | pic = json['pic']; 48 | url = json['url']; 49 | position = json['position']; 50 | } 51 | 52 | Map toJson() { 53 | final data = {}; 54 | data['_id'] = sId; 55 | data['title'] = title; 56 | data['status'] = status; 57 | data['pic'] = pic; 58 | data['url'] = url; 59 | data['position'] = position; 60 | return data; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/app/models/message.dart: -------------------------------------------------------------------------------- 1 | class MessageModel{ 2 | String message; 3 | bool success; 4 | 5 | MessageModel({required this.message,required this.success}); 6 | } -------------------------------------------------------------------------------- /lib/app/models/pcontent_model.dart: -------------------------------------------------------------------------------- 1 | class PcontentModel { 2 | PcontentItemModel? result; 3 | 4 | PcontentModel({this.result}); 5 | 6 | PcontentModel.fromJson(Map json) { 7 | result = json['result'] != null ? PcontentItemModel?.fromJson(json['result']) : null; 8 | } 9 | 10 | Map toJson() { 11 | final data = {}; 12 | if (result != null) { 13 | data['result'] = result?.toJson(); 14 | } 15 | return data; 16 | } 17 | } 18 | 19 | class PcontentItemModel { 20 | String? sId; 21 | String? title; 22 | String? cid; 23 | int? price; 24 | int? oldPrice; 25 | int? isBest; 26 | int? isHot; 27 | int? isNew; 28 | int? status; 29 | String? pic; 30 | String? content; 31 | String? specs; 32 | String? cname; 33 | List? attr; 34 | String? subTitle; 35 | int? salecount; 36 | 37 | PcontentItemModel( 38 | {this.sId, 39 | this.title, 40 | this.cid, 41 | this.price, 42 | this.oldPrice, 43 | this.isBest, 44 | this.isHot, 45 | this.isNew, 46 | this.status, 47 | this.pic, 48 | this.content, 49 | this.specs, 50 | this.cname, 51 | this.attr, 52 | this.subTitle, 53 | this.salecount}); 54 | 55 | PcontentItemModel.fromJson(Map json) { 56 | sId = json['_id']; 57 | title = json['title']; 58 | cid = json['cid']; 59 | price = json['price']; 60 | oldPrice = json['old_price']; 61 | isBest = json['is_best']; 62 | isHot = json['is_hot']; 63 | isNew = json['is_new']; 64 | status = json['status']; 65 | pic = json['pic']; 66 | content = json['content']; 67 | specs = json['specs']; 68 | cname = json['cname']; 69 | if (json['attr'] != null) { 70 | attr = []; 71 | json['attr'].forEach((v) { 72 | attr?.add(PcontentAttrModel.fromJson(v)); 73 | }); 74 | } 75 | subTitle = json['sub_title']; 76 | salecount = json['salecount']; 77 | } 78 | 79 | Map toJson() { 80 | final data = {}; 81 | data['_id'] = sId; 82 | data['title'] = title; 83 | data['cid'] = cid; 84 | data['price'] = price; 85 | data['old_price'] = oldPrice; 86 | data['is_best'] = isBest; 87 | data['is_hot'] = isHot; 88 | data['is_new'] = isNew; 89 | data['status'] = status; 90 | data['pic'] = pic; 91 | data['content'] = content; 92 | data['specs'] = specs; 93 | data['cname'] = cname; 94 | if (attr != null) { 95 | data['attr'] = attr?.map((v) => v.toJson()).toList(); 96 | } 97 | data['sub_title'] = subTitle; 98 | data['salecount'] = salecount; 99 | return data; 100 | } 101 | } 102 | 103 | class PcontentAttrModel { 104 | String? cate; 105 | List? list; 106 | List? attrList; //新增 107 | PcontentAttrModel({this.cate, this.list}); 108 | 109 | PcontentAttrModel.fromJson(Map json) { 110 | cate = json['cate']; 111 | list = json['list'].cast(); 112 | attrList=[]; 113 | } 114 | 115 | Map toJson() { 116 | final data = {}; 117 | data['cate'] = cate; 118 | data['list'] = list; 119 | return data; 120 | } 121 | } -------------------------------------------------------------------------------- /lib/app/models/plist_model.dart: -------------------------------------------------------------------------------- 1 | class PlistModel { 2 | List? result; 3 | 4 | PlistModel({this.result}); 5 | 6 | PlistModel.fromJson(Map json) { 7 | if (json['result'] != null) { 8 | result = []; 9 | json['result'].forEach((v) { 10 | result?.add(PlistItemModel.fromJson(v)); 11 | }); 12 | } 13 | } 14 | 15 | Map toJson() { 16 | final data = {}; 17 | if (result != null) { 18 | data['result'] = result?.map((v) => v.toJson()).toList(); 19 | } 20 | return data; 21 | } 22 | } 23 | 24 | class PlistItemModel { 25 | String? sId; 26 | String? title; 27 | String? cid; 28 | int? price; 29 | String? pic; 30 | String? subTitle; 31 | String? sPic; 32 | 33 | PlistItemModel( 34 | {this.sId, 35 | this.title, 36 | this.cid, 37 | this.price, 38 | this.pic, 39 | this.subTitle, 40 | this.sPic}); 41 | 42 | PlistItemModel.fromJson(Map json) { 43 | sId = json['_id']; 44 | title = json['title']; 45 | cid = json['cid']; 46 | price = json['price']; 47 | pic = json['pic']; 48 | subTitle = json['sub_title']; 49 | sPic = json['s_pic']; 50 | } 51 | 52 | Map toJson() { 53 | final data = {}; 54 | data['_id'] = sId; 55 | data['title'] = title; 56 | data['cid'] = cid; 57 | data['price'] = price; 58 | data['pic'] = pic; 59 | data['sub_title'] = subTitle; 60 | data['s_pic'] = sPic; 61 | return data; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/app/models/user_model.dart: -------------------------------------------------------------------------------- 1 | class UserModel { 2 | String? sId; 3 | String? username; 4 | String? tel; 5 | String? password; 6 | String? salt; 7 | int? gold; 8 | int? coupon; 9 | int? redPacket; 10 | int? quota; 11 | int? collect; 12 | int? footmark; 13 | int? follow; 14 | 15 | UserModel({ 16 | this.sId, 17 | this.username, 18 | this.tel, 19 | this.password, 20 | this.salt, 21 | this.gold, 22 | this.coupon, 23 | this.redPacket, 24 | this.quota, 25 | this.collect, 26 | this.footmark, 27 | this.follow, 28 | }); 29 | 30 | UserModel.fromJson(Map json) { 31 | sId = json['_id']; 32 | username = json['username']; 33 | tel = json['tel']; 34 | password = json['password']; 35 | salt = json['salt']; 36 | gold = json['gold']; 37 | coupon = json['coupon']; 38 | redPacket = json['redPacket']; 39 | quota = json['quota']; 40 | collect = json['collect']; 41 | footmark = json['footmark']; 42 | follow = json['follow']; 43 | } 44 | 45 | Map toJson() { 46 | final _data = {}; 47 | _data['_id'] = sId; 48 | _data['username'] = username; 49 | _data['tel'] = tel; 50 | _data['password'] = password; 51 | _data['salt'] = salt; 52 | _data['gold'] = gold; 53 | _data['coupon'] = coupon; 54 | _data['redPacket'] = redPacket; 55 | _data['quota'] = quota; 56 | _data['collect'] = collect; 57 | _data['footmark'] = footmark; 58 | _data['follow'] = follow; 59 | return _data; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/app/modules/address/addressAdd/bindings/address_add_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/address_add_controller.dart'; 4 | 5 | class AddressAddBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => AddressAddController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/address/addressAdd/controllers/address_add_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../../../../models/user_model.dart'; 5 | import '../../../../units/httpsClient.dart'; 6 | import '../../../../units/signServices.dart'; 7 | import '../../../../units/userServices.dart'; 8 | import '../../addressList/controllers/address_list_controller.dart'; 9 | 10 | class AddressAddController extends GetxController { 11 | TextEditingController nameController = TextEditingController(); 12 | TextEditingController phoneController = TextEditingController(); 13 | TextEditingController addressController = TextEditingController(); 14 | RxString area = "".obs; 15 | HttpsClient httpsClient = HttpsClient(); 16 | 17 | AddressListController listController=Get.find(); 18 | 19 | @override 20 | void onInit() { 21 | super.onInit(); 22 | } 23 | 24 | @override 25 | void onClose() { 26 | //销毁的时候更新listController.getAddressList 27 | listController.getAddressList(); 28 | super.onClose(); 29 | } 30 | 31 | setArea(String str) { 32 | area.value = str; 33 | update(); 34 | } 35 | 36 | doAddAddress() async { 37 | List userList = await UserServices.getUserInfo(); 38 | print(userList); 39 | UserModel userInfo = UserModel.fromJson(userList[0]); 40 | if (nameController.text.length < 2) { 41 | Get.snackbar("提示信息", "请把姓名填写完整"); 42 | } else if (!GetUtils.isPhoneNumber(phoneController.text) || 43 | phoneController.text.length != 11) { 44 | Get.snackbar("提示信息", "手机号不合法"); 45 | } else if (area.value.length < 2) { 46 | Get.snackbar("提示信息", "请选择地区"); 47 | } else if (addressController.text.length < 2) { 48 | Get.snackbar("提示信息", "请填写详细的地址"); 49 | } else { 50 | Map tempJson = { 51 | "uid": userInfo.sId, 52 | "name": nameController.text, 53 | "phone": phoneController.text, 54 | "address": "${area.value} ${addressController.text}", 55 | }; 56 | String sign = SignServices.getSign({ 57 | ...tempJson, //合并对象 58 | "salt": userInfo.salt, //登录成功后服务器返回的salt 私钥 59 | }); 60 | var response=await httpsClient.post("api/addAddress", data: { 61 | ...tempJson, 62 | "sign":sign 63 | }); 64 | if(response.data["success"]){ 65 | Get.back(); 66 | }else{ 67 | Get.snackbar("提示信息", response.data["message"]); 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/app/modules/address/addressEdit/bindings/address_edit_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/address_edit_controller.dart'; 4 | 5 | class AddressEditBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => AddressEditController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/address/addressEdit/controllers/address_edit_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../../../../models/user_model.dart'; 5 | import '../../../../units/httpsClient.dart'; 6 | import '../../../../units/signServices.dart'; 7 | import '../../../../units/userServices.dart'; 8 | import '../../addressList/controllers/address_list_controller.dart'; 9 | 10 | class AddressEditController extends GetxController { 11 | TextEditingController nameController = TextEditingController(); 12 | TextEditingController phoneController = TextEditingController(); 13 | TextEditingController addressController = TextEditingController(); 14 | RxString area = "".obs; 15 | String addressId = Get.arguments["id"]; 16 | HttpsClient httpsClient = HttpsClient(); 17 | //返回的时候更新收货地址列表里面的数据 18 | AddressListController listController = Get.find(); 19 | 20 | @override 21 | void onInit() { 22 | initAddressData(); 23 | super.onInit(); 24 | } 25 | 26 | //拿到收货地址传过来的值 27 | initAddressData() { 28 | nameController.text = Get.arguments["name"]; 29 | phoneController.text = Get.arguments["phone"]; 30 | //拆分字符串只要详细部分不要省市区 31 | String address = Get.arguments["address"]; 32 | List addressList = address.split(" "); 33 | area.value = "${addressList[0]} ${addressList[1]} ${addressList[2]}"; 34 | print(addressList); 35 | print("------------"); 36 | addressList.removeRange(0, 3); 37 | addressController.text = Get.arguments["address"]; 38 | print(addressList); 39 | addressController.text = addressList.join(" "); 40 | } 41 | 42 | @override 43 | void onClose() { 44 | //返回的时候更新收货地址列表里面的数据 45 | listController.getAddressList(); 46 | super.onClose(); 47 | } 48 | 49 | setArea(String str) { 50 | area.value = str; 51 | update(); 52 | } 53 | 54 | //保存修改后的收货地址 55 | doEditAddress() async { 56 | List userList = await UserServices.getUserInfo(); 57 | UserModel userInfo = UserModel.fromJson(userList[0]); 58 | 59 | if (nameController.text.length < 2) { 60 | Get.snackbar("提示信息", "请把姓名填写完整"); 61 | } else if (!GetUtils.isPhoneNumber(phoneController.text) || 62 | phoneController.text.length != 11) { 63 | Get.snackbar("提示信息", "手机号不合法"); 64 | } else if (area.value.length < 2) { 65 | Get.snackbar("提示信息", "请选择地区"); 66 | } else if (addressController.text.length < 2) { 67 | Get.snackbar("提示信息", "请填写详细的地址"); 68 | } else { 69 | Map tempJson = { 70 | "id": addressId, 71 | "uid": userInfo.sId, 72 | "name": nameController.text, 73 | "phone": phoneController.text, 74 | "address": "${area.value} ${addressController.text}", 75 | }; 76 | String sign = SignServices.getSign({ 77 | ...tempJson, //合并对象 78 | "salt": userInfo.salt, //登录成功后服务器返回的salt 私钥 79 | }); 80 | var response = await httpsClient 81 | .post("api/editAddress", data: {...tempJson, "sign": sign}); 82 | if (response.data["success"]) { 83 | Get.back(); 84 | } else { 85 | Get.snackbar("提示信息", response.data["message"]); 86 | } 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/app/modules/address/addressList/bindings/address_list_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/address_list_controller.dart'; 4 | 5 | class AddressListBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => AddressListController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/address/addressList/controllers/address_list_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../../../../models/address_model.dart'; 4 | import '../../../../models/user_model.dart'; 5 | import '../../../../units/httpsClient.dart'; 6 | import '../../../../units/signServices.dart'; 7 | import '../../../../units/userServices.dart'; 8 | import '../../../checkout/controllers/checkout_controller.dart'; 9 | 10 | class AddressListController extends GetxController { 11 | HttpsClient httpsClient = HttpsClient(); 12 | RxList addressList=[].obs; 13 | 14 | CheckoutController checkoutController=Get.find(); 15 | @override 16 | void onInit() { 17 | getAddressList(); 18 | super.onInit(); 19 | } 20 | 21 | @override 22 | void onClose() { 23 | checkoutController.getDefaultAddress(); 24 | super.onClose(); 25 | } 26 | 27 | getAddressList() async { 28 | List userList = await UserServices.getUserInfo(); 29 | UserModel userInfo = UserModel.fromJson(userList[0]); 30 | Map tempJson = {"uid": userInfo.sId}; 31 | String sign = SignServices.getSign({ 32 | ...tempJson, 33 | "salt": userInfo.salt //私钥 34 | }); 35 | var response = 36 | await httpsClient.get("api/addressList?uid=${userInfo.sId}&sign=$sign"); 37 | if(response!=null){ 38 | var tempAddressList= AddressModel.fromJson(response.data); 39 | addressList.value=tempAddressList.result!; 40 | update(); 41 | } 42 | } 43 | //改变默认地址 44 | changeDefaultAddress(id) async { 45 | List userList = await UserServices.getUserInfo(); 46 | UserModel userInfo = UserModel.fromJson(userList[0]); 47 | Map tempJson = {"uid": userInfo.sId,"id":id}; 48 | String sign = SignServices.getSign({ 49 | ...tempJson, 50 | "salt": userInfo.salt //私钥 51 | }); 52 | var response = 53 | await httpsClient.post("api/changeDefaultAddress",data: { 54 | ...tempJson, 55 | "sign":sign 56 | }); 57 | if(response!=null){ 58 | Get.back(); 59 | } 60 | } 61 | //删除收货地址 62 | deleteAddress(id) async { 63 | List userList = await UserServices.getUserInfo(); 64 | UserModel userInfo = UserModel.fromJson(userList[0]); 65 | Map tempJson = {"uid": userInfo.sId,"id":id}; 66 | String sign = SignServices.getSign({ 67 | ...tempJson, 68 | "salt": userInfo.salt //私钥 69 | }); 70 | var response = 71 | await httpsClient.post("api/deleteAddress",data: { 72 | ...tempJson, 73 | "sign":sign 74 | }); 75 | if(response!=null){ 76 | //删除成功重新更新当前页面的数据 77 | getAddressList(); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/app/modules/buy/bindings/buy_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/buy_controller.dart'; 4 | 5 | class BuyBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => BuyController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/buy/controllers/buy_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class BuyController extends GetxController { 4 | RxList buyList = [ 5 | { 6 | "id": 1, 7 | "title": "支付宝支付", 8 | "chekced": true, 9 | "image": "https://www.itying.com/themes/itying/images/alipay.png" 10 | }, 11 | { 12 | "id": 2, 13 | "title": "微信支付", 14 | "chekced": false, 15 | "image": "https://www.itying.com/themes/itying/images/weixinpay.png" 16 | } 17 | ].obs; 18 | 19 | int buyType = 0; 20 | @override 21 | void onInit() { 22 | super.onInit(); 23 | } 24 | 25 | @override 26 | void onReady() { 27 | super.onReady(); 28 | } 29 | 30 | @override 31 | void onClose() { 32 | super.onClose(); 33 | } 34 | //改变支付方式 35 | changeBuyList(index) { 36 | List> tempList = []; 37 | for (var i = 0; i < buyList.length; i++) { 38 | buyList[i]["chekced"] = false; 39 | tempList.add(buyList[i]); 40 | } 41 | tempList[index]["chekced"] = true; 42 | buyType=index; 43 | buyList.value = tempList; 44 | update(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/app/modules/buy/views/buy_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:tobias/tobias.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | import '../../../units/screenAdapter.dart'; 7 | import '../../../widget/passButton.dart'; 8 | import '../controllers/buy_controller.dart'; 9 | 10 | class BuyView extends GetView { 11 | const BuyView({Key? key}) : super(key: key); 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar( 16 | backgroundColor: Colors.white, 17 | elevation: 0, 18 | title: const Text('去支付'), 19 | centerTitle: true, 20 | ), 21 | body: ListView( 22 | padding: EdgeInsets.all(ScreenAdapter.width(20)), 23 | children: [ 24 | Obx(()=>ListView.builder( 25 | itemCount: controller.buyList.length, 26 | shrinkWrap: true, 27 | itemBuilder: (context, index) { 28 | return Column( 29 | children: [ 30 | ListTile( 31 | onTap: (){ 32 | controller.changeBuyList(index); 33 | }, 34 | leading: 35 | Image.network(controller.buyList[index]["image"]), 36 | title: Text("${controller.buyList[index]["title"]}"), 37 | trailing: controller.buyList[index]["chekced"] 38 | ? Icon(Icons.check) 39 | : Text(""), 40 | ), 41 | const Divider() 42 | ], 43 | ); 44 | })), 45 | SizedBox( 46 | height: ScreenAdapter.height(200), 47 | ), 48 | PassButton( 49 | text: "支付", 50 | onPressed: () { 51 | // print("支付"); 52 | if(controller.buyType==0){ 53 | 54 | print("支付宝支付"); 55 | // Get.toNamed('/alipay'); 56 | _doAliPay(); 57 | 58 | }else{ 59 | print("微信支付"); 60 | } 61 | }) 62 | ], 63 | ), 64 | ); 65 | } 66 | } 67 | //支付宝支付 68 | _doAliPay() async { 69 | var response = await Dio().get("https://agent.itying.com/alipay/"); 70 | print(response.data); 71 | print(response.data is String); 72 | 73 | var aliPayResult = await aliPay(response.data); 74 | print(aliPayResult); //跳转到订单列表 75 | 76 | /* 77 | Unhandled Exception: MissingPluginException(No implementation found for method pay on channel com.jarvanmo/tobias) 78 | https://github.com/OpenFlutter/tobias/issues/65 79 | */ 80 | } 81 | 82 | -------------------------------------------------------------------------------- /lib/app/modules/cart/views/cart_item_mun_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../units/screenAdapter.dart'; 6 | import '../controllers/cart_controller.dart'; 7 | 8 | class CartItemMunView extends GetView { 9 | 10 | @override 11 | final CartController controller = Get.find(); 12 | final Map cartItem; 13 | CartItemMunView(this.cartItem,{Key? key}) : super(key: key); 14 | 15 | Widget _left(){ 16 | return InkWell( 17 | onTap: (){ 18 | controller.decCartNum(cartItem); 19 | }, 20 | child: Container( 21 | alignment: Alignment.center, 22 | width:ScreenAdapter.width(80) , 23 | height: ScreenAdapter.height(80), 24 | child: const Text("-"), 25 | ), 26 | ); 27 | } 28 | Widget _center(){ 29 | return Container( 30 | 31 | decoration: BoxDecoration( 32 | border: Border( 33 | left: BorderSide(width: ScreenAdapter.width(2),color: Colors.black12), 34 | right: BorderSide(width: ScreenAdapter.width(2),color: Colors.black12), 35 | ) 36 | ), 37 | alignment: Alignment.center, 38 | width:ScreenAdapter.width(80) , 39 | height: ScreenAdapter.height(80), 40 | child: Text("${cartItem["count"]}"), 41 | ); 42 | } 43 | Widget _right(){ 44 | return InkWell( 45 | onTap: (){ 46 | controller.incCartNum(cartItem); 47 | }, 48 | child: Container( 49 | alignment: Alignment.center, 50 | width:ScreenAdapter.width(80) , 51 | height: ScreenAdapter.height(80), 52 | child: const Text("+"), 53 | ), 54 | ); 55 | } 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return Container( 60 | width: ScreenAdapter.width(244), 61 | height: ScreenAdapter.height(60), 62 | decoration: BoxDecoration( 63 | border: Border.all( 64 | width: ScreenAdapter.width(2), 65 | color: Colors.black12 66 | ) 67 | ), 68 | child: Row( 69 | children: [ 70 | _left(), 71 | _center(), 72 | _right() 73 | 74 | ], 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/app/modules/cart/views/cart_item_view.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @ Author: kiko 3 | * @ Create Time: 2024-03-26 06:34:32 4 | * @ Modified by: kiko 5 | * @ Modified time: 2024-03-29 04:01:47 6 | * @ Description: 7 | */ 8 | 9 | import 'package:flutter/material.dart'; 10 | 11 | import 'package:get/get.dart'; 12 | 13 | import '../../../units/screenAdapter.dart'; 14 | import '../controllers/cart_controller.dart'; 15 | import '../views/cart_item_mun_view.dart'; 16 | import '../../../units/httpsClient.dart'; 17 | 18 | class CartItemView extends GetView { 19 | @override 20 | final CartController controller = Get.find(); 21 | final Map cartItem; 22 | CartItemView(this.cartItem, {Key? key}) : super(key: key); 23 | @override 24 | Widget build(BuildContext context) { 25 | return Container( 26 | padding: EdgeInsets.all(ScreenAdapter.height(20)), 27 | decoration: BoxDecoration( 28 | color: Colors.white, 29 | border: Border( 30 | bottom: BorderSide( 31 | color: const Color.fromARGB(178, 240, 236, 236), 32 | width: ScreenAdapter.height(2))), 33 | ), 34 | child: Row( 35 | children: [ 36 | SizedBox( 37 | width: ScreenAdapter.width(100), 38 | child: Checkbox( 39 | activeColor: Colors.red, 40 | value: cartItem["checked"], 41 | onChanged: (value) { 42 | controller.checkCartItem(cartItem); 43 | }), 44 | ), 45 | Container( 46 | width: ScreenAdapter.width(260), 47 | padding: EdgeInsets.all(ScreenAdapter.height(24)), 48 | margin: EdgeInsets.only(right: ScreenAdapter.width(20)), 49 | child: Image.network(HttpsClient.replaeUri(cartItem["pic"]), 50 | fit: BoxFit.fitHeight), 51 | ), 52 | Expanded( 53 | child: Column( 54 | crossAxisAlignment: CrossAxisAlignment.start, 55 | children: [ 56 | Text( 57 | "${cartItem["title"]}", 58 | style: TextStyle( 59 | fontSize: ScreenAdapter.fontSize(36), 60 | fontWeight: FontWeight.bold), 61 | ), 62 | SizedBox(height: ScreenAdapter.height(20)), 63 | Row( 64 | children: [Chip(label: Text("${cartItem["selectedAttr"]}"))], 65 | ), 66 | SizedBox(height: ScreenAdapter.height(20)), 67 | Row( 68 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 69 | children: [ 70 | Text("¥${cartItem["price"]}", 71 | style: TextStyle( 72 | fontSize: ScreenAdapter.fontSize(38), 73 | color: Colors.red)), 74 | CartItemMunView(cartItem) 75 | ], 76 | ) 77 | ], 78 | )) 79 | ], 80 | ), 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/app/modules/category/controllers/category_controller.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: web-kiko kikoiiii@163.com 3 | * @Date: 2024-03-04 11:57:43 4 | * @LastEditors: web-kiko kikoiiii@163.com 5 | * @LastEditTime: 2024-03-06 17:04:07 6 | * @FilePath: \flutter3_getx_shop\lib\app\modules\category\controllers\category_controller.dart 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE 8 | */ 9 | import 'package:get/get.dart'; 10 | import '../../../models/category_model.dart'; 11 | // import 'package:dio/dio.dart'; 12 | import '../../../units/httpsClient.dart'; 13 | 14 | class CategoryController extends GetxController { 15 | //TODO: Implement CategoryController 16 | 17 | RxInt selectIndex = 0.obs; 18 | RxList leftCategoryList = [].obs; 19 | RxList rightCategoryList = [].obs; 20 | HttpsClient httpsClient = HttpsClient(); 21 | @override 22 | void onInit() { 23 | super.onInit(); 24 | getLeftCategoryData(); 25 | } 26 | 27 | @override 28 | void onReady() { 29 | super.onReady(); 30 | } 31 | 32 | @override 33 | void onClose() { 34 | super.onClose(); 35 | } 36 | 37 | void changeIndex(index, id) { 38 | selectIndex.value = index; 39 | getRightCategoryData(id); 40 | update(); 41 | } 42 | 43 | //一级分类 44 | getLeftCategoryData() async { 45 | var response = await httpsClient.get("api/pcate"); 46 | if (response != null) { 47 | var category = CategoryModel.fromJson(response.data); 48 | leftCategoryList.value = category.result!; 49 | getRightCategoryData(leftCategoryList[0].sId!); 50 | update(); 51 | } 52 | } 53 | 54 | //二级分类 55 | getRightCategoryData(String pid) async { 56 | var response = await httpsClient.get("api/pcate?pid=$pid"); 57 | if (response != null) { 58 | var category = CategoryModel.fromJson(response.data); 59 | rightCategoryList.value = category.result!; 60 | update(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/app/modules/checkout/bindings/checkout_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/checkout_controller.dart'; 4 | 5 | class CheckoutBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => CheckoutController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/checkout/controllers/checkout_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../models/address_model.dart'; 6 | import '../../../models/user_model.dart'; 7 | import '../../../units/cartServices.dart'; 8 | import '../../../units/httpsClient.dart'; 9 | import '../../../units/signServices.dart'; 10 | import '../../../units/storage.dart'; 11 | import '../../../units/userServices.dart'; 12 | import '../../cart/controllers/cart_controller.dart'; 13 | 14 | class CheckoutController extends GetxController { 15 | RxList checkoutList = [].obs; 16 | HttpsClient httpsClient = HttpsClient(); 17 | RxList addressList = [].obs; 18 | CartController cartController = Get.find(); 19 | RxDouble allPrice = 0.0.obs; 20 | RxInt allNum = 0.obs; 21 | @override 22 | void onInit() { 23 | super.onInit(); 24 | getCheckoutData(); 25 | getDefaultAddress(); 26 | } 27 | 28 | @override 29 | void onReady() { 30 | super.onReady(); 31 | } 32 | 33 | @override 34 | void onClose() { 35 | super.onClose(); 36 | } 37 | 38 | //获取要结算的商品 39 | getCheckoutData() async { 40 | List tempList = await Storage.getData("checkoutList"); 41 | checkoutList.value = tempList; 42 | computedAllPrice(); 43 | update(); 44 | } 45 | 46 | //默认收货地址 47 | getDefaultAddress() async { 48 | List userList = await UserServices.getUserInfo(); 49 | UserModel userInfo = UserModel.fromJson(userList[0]); 50 | 51 | Map tempJson = {"uid": userInfo.sId}; 52 | String sign = SignServices.getSign({ 53 | ...tempJson, 54 | "salt": userInfo.salt //私钥 55 | }); 56 | var response = await httpsClient 57 | .get("api/oneAddressList?uid=${userInfo.sId}&sign=$sign"); 58 | print(response); 59 | 60 | if (response != null) { 61 | var tempAddressList = AddressModel.fromJson(response.data); 62 | addressList.value = tempAddressList.result!; 63 | update(); 64 | } 65 | } 66 | 67 | //计算总价 68 | computedAllPrice() { 69 | double tempAllPrice = 0.0; 70 | int tempNum = 0; 71 | for (var i = 0; i < checkoutList.length; i++) { 72 | tempAllPrice += checkoutList[i]["price"] * checkoutList[i]["count"]; 73 | tempNum += checkoutList[i]["count"] as int; 74 | } 75 | allNum.value = tempNum; 76 | allPrice.value = tempAllPrice; 77 | } 78 | 79 | //去结算 80 | doCheckOut() async { 81 | if (addressList.isNotEmpty) { 82 | List userList = await UserServices.getUserInfo(); 83 | UserModel userInfo = UserModel.fromJson(userList[0]); 84 | 85 | Map tempJson = { 86 | "uid": userInfo.sId, 87 | "phone": addressList[0].phone, 88 | "address": addressList[0].address, 89 | "name": addressList[0].name, 90 | "all_price": allPrice.value.toStringAsFixed(1), //注意:保留 1 位小数 91 | "products": json.encode(checkoutList), //需要传入json字符串 92 | }; 93 | 94 | String sign = SignServices.getSign({ 95 | ...tempJson, 96 | "salt": userInfo.salt //私钥 97 | }); 98 | var response = await httpsClient 99 | .post("api/doOrder", data: {...tempJson, "sign": sign}); 100 | print(response.data); 101 | if (response.data["success"]) { 102 | //删除购物车中选中的商品 103 | await CartServices.deleteCheckOutData(checkoutList); 104 | //更新购物车数据 105 | cartController.getCartListData(); 106 | //跳转到支付页面 107 | Get.toNamed("/buy"); 108 | } else { 109 | Get.snackbar("提示信息", response.data["message"]); 110 | } 111 | } else { 112 | Get.snackbar("提示信息", "请选择收货地址"); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /lib/app/modules/login/codeLoginStepOne/bindings/code_login_step_one_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/code_login_step_one_controller.dart'; 4 | 5 | class CodeLoginStepOneBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => CodeLoginStepOneController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/codeLoginStepOne/controllers/code_login_step_one_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../../models/message.dart'; 6 | import '../../../../units/httpsClient.dart'; 7 | 8 | class CodeLoginStepOneController extends GetxController { 9 | //TODO: Implement CodeLoginStepOneController 10 | 11 | TextEditingController telController = TextEditingController(); 12 | HttpsClient httpsClient = HttpsClient(); 13 | 14 | @override 15 | void onInit() { 16 | super.onInit(); 17 | } 18 | 19 | @override 20 | void onReady() { 21 | super.onReady(); 22 | } 23 | 24 | @override 25 | void onClose() { 26 | super.onClose(); 27 | } 28 | 29 | //发送验证码 30 | Future sendCode() async { 31 | var response = await httpsClient 32 | .post("api/sendLoginCode", data: {"tel": telController.text}); 33 | if (response != null) { 34 | print(response); 35 | if (response.data["success"]) { 36 | //方便测试 正式上线需要删掉Clipboard代码 37 | Clipboard.setData(ClipboardData(text: response.data["code"])); 38 | 39 | return MessageModel(message: "发送验证码成功", success: true); 40 | } 41 | return MessageModel(message: response.data["message"], success: false); 42 | } else { 43 | return MessageModel(message: "网络异常", success: false); 44 | } 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /lib/app/modules/login/codeLoginStepOne/views/code_login_step_one_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../../models/message.dart'; 6 | import '../../../../units/screenAdapter.dart'; 7 | import '../../../../widget/logo.dart'; 8 | import '../../../../widget/passButton.dart'; 9 | import '../../../../widget/passTextField.dart'; 10 | import '../../../../widget/userAgreement.dart'; 11 | import '../controllers/code_login_step_one_controller.dart'; 12 | 13 | class CodeLoginStepOneView extends GetView { 14 | const CodeLoginStepOneView({Key? key}) : super(key: key); 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | backgroundColor: Colors.white, 19 | appBar: AppBar( 20 | backgroundColor: Colors.white, 21 | elevation: 0, 22 | actions: [TextButton(onPressed: () {}, child: Text("帮助"))], 23 | ), 24 | body: ListView( 25 | padding: EdgeInsets.all(ScreenAdapter.width(40)), 26 | children: [ 27 | //logo 28 | const Logo(), 29 | //输入手机号 30 | PassTextFiled( 31 | controller: controller.telController, 32 | hintText: "请输入手机号", 33 | onChanged: (value) { 34 | print(value); 35 | }), 36 | 37 | //用户协议 38 | const UserAgreement(), 39 | //登录按钮 40 | PassButton(text: "获取验证码", onPressed: () async{ 41 | if (!GetUtils.isPhoneNumber(controller.telController.text) || 42 | controller.telController.text.length != 11) { 43 | Get.snackbar("提示信息!", "手机号格式不合法"); 44 | }else{ 45 | MessageModel result=await controller.sendCode(); 46 | if(result.success){ 47 | //替换路由 48 | Get.offAndToNamed("/code-login-step-two",arguments: { 49 | "tel":controller.telController.text 50 | }); 51 | 52 | }else{ 53 | Get.snackbar("提示信息!", result.message); 54 | } 55 | } 56 | 57 | }), 58 | SizedBox(height: ScreenAdapter.height(40)), 59 | Row( 60 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 61 | children: [ 62 | TextButton(onPressed: (){ 63 | Get.toNamed("/register-step-one"); 64 | }, child: const Text("新用户注册")), 65 | TextButton(onPressed: (){ 66 | // Get.toNamed("/pass-login"); 67 | //替换路由 68 | Get.offAndToNamed("/pass-login"); 69 | }, child: const Text("账户密码登录")) 70 | ], 71 | ) 72 | 73 | ], 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/app/modules/login/codeLoginStepTwo/bindings/code_login_step_two_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/code_login_step_two_controller.dart'; 4 | 5 | class CodeLoginStepTwoBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => CodeLoginStepTwoController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/codeLoginStepTwo/controllers/code_login_step_two_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/services.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | import '../../../../models/message.dart'; 8 | import '../../../../units/httpsClient.dart'; 9 | import '../../../../units/storage.dart'; 10 | import '../../../user/controllers/user_controller.dart'; 11 | class CodeLoginStepTwoController extends GetxController { 12 | //TODO: Implement CodeLoginStepTwoController 13 | 14 | /* 15 | final TextEditingController fieldOne = TextEditingController(); 16 | final TextEditingController fieldTwo = TextEditingController(); 17 | final TextEditingController fieldThree = TextEditingController(); 18 | final TextEditingController fieldFour = TextEditingController(); 19 | final TextEditingController fieldFive = TextEditingController(); 20 | final TextEditingController fieldSix = TextEditingController(); 21 | 22 | */ 23 | final TextEditingController editingController = TextEditingController(); 24 | 25 | HttpsClient httpsClient = HttpsClient(); 26 | String tel=Get.arguments["tel"]; 27 | RxInt seconds = 60.obs; 28 | UserController userController =Get.find(); 29 | @override 30 | void onInit() { 31 | super.onInit(); 32 | countDown(); 33 | } 34 | @override 35 | void onClose() { 36 | //更新用户状态 37 | print("更新用户状态"); 38 | userController.getUserInfo(); 39 | super.onClose(); 40 | } 41 | //倒计时的方法 42 | countDown() { 43 | Timer.periodic(const Duration(milliseconds: 1000), (timer) { 44 | seconds.value--; 45 | if (seconds.value == 0) { 46 | timer.cancel(); 47 | } 48 | update(); 49 | }); 50 | } 51 | 52 | 53 | //发送验证码 54 | Future sendCode() async { 55 | var response = await httpsClient 56 | .post("api/sendLoginCode", data: {"tel": tel}); 57 | if (response != null) { 58 | print(response); 59 | if (response.data["success"]) { 60 | //方便测试 粘贴验证码正式上线看需求 61 | Clipboard.setData(ClipboardData(text: response.data["code"])); 62 | seconds.value=10; 63 | countDown(); 64 | return MessageModel(message: "发送验证码成功", success: true); 65 | } 66 | return MessageModel(message: response.data["message"], success: false); 67 | } else { 68 | return MessageModel(message: "网络异常", success: false); 69 | } 70 | } 71 | 72 | //执行登录 73 | Future doLogin() async{ 74 | var response = await httpsClient.post("api/validateLoginCode",data:{ 75 | "tel":tel, 76 | "code":editingController.text 77 | }); 78 | 79 | if (response != null) { 80 | print(response); 81 | if(response.data["success"]){ 82 | //执行登录 保存用户信息 83 | Storage.setData("userinfo",response.data["userinfo"]); 84 | 85 | return MessageModel(message: "登录成功", success: true); 86 | } 87 | return MessageModel(message: response.data["message"], success: false); 88 | }else{ 89 | return MessageModel(message:"网络异常", success: false); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/app/modules/login/onStepLogin/bindings/on_step_login_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/on_step_login_controller.dart'; 4 | 5 | class OnStepLoginBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => OnStepLoginController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/onStepLogin/controllers/on_step_login_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class OnStepLoginController extends GetxController { 4 | //TODO: Implement OnStepLoginController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/login/onStepLogin/views/on_step_login_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/on_step_login_controller.dart'; 6 | 7 | class OnStepLoginView extends GetView { 8 | const OnStepLoginView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('OnStepLoginView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'OnStepLoginView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/login/passLogin/bindings/pass_login_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/pass_login_controller.dart'; 4 | 5 | class PassLoginBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => PassLoginController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/passLogin/controllers/pass_login_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../../../../models/message.dart'; 5 | import '../../../../units/httpsClient.dart'; 6 | import '../../../../units/storage.dart'; 7 | import '../../../user/controllers/user_controller.dart'; 8 | class PassLoginController extends GetxController { 9 | //TODO: Implement PassLoginController 10 | 11 | TextEditingController telController=TextEditingController(); 12 | TextEditingController passController=TextEditingController(); 13 | HttpsClient httpsClient = HttpsClient(); 14 | UserController userController =Get.find(); 15 | @override 16 | void onInit() { 17 | 18 | super.onInit(); 19 | } 20 | 21 | @override 22 | void onReady() { 23 | super.onReady(); 24 | } 25 | 26 | @override 27 | void onClose() { 28 | //更新用户状态 29 | print("更新用户状态"); 30 | userController.getUserInfo(); 31 | super.onClose(); 32 | } 33 | 34 | Future doLogin() async{ 35 | var response = await httpsClient.post("api/doLogin",data:{ 36 | "username":telController.text, 37 | "password":passController.text, 38 | }); 39 | if (response != null) { 40 | print(response); 41 | if(response.data["success"]){ 42 | //保存用户信息 43 | Storage.setData("userinfo",response.data["userinfo"]); 44 | return MessageModel(message: "登录成功", success: true); 45 | } 46 | return MessageModel(message: response.data["message"], success: false); 47 | }else{ 48 | return MessageModel(message:"网络异常", success: false); 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /lib/app/modules/login/passLogin/views/pass_login_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | import '../controllers/pass_login_controller.dart'; 5 | 6 | import '../../../../models/message.dart'; 7 | import '../../../../units/screenAdapter.dart'; 8 | import '../../../../widget/logo.dart'; 9 | import '../../../../widget/passButton.dart'; 10 | import '../../../../widget/passTextField.dart'; 11 | import '../../../../widget/userAgreement.dart'; 12 | 13 | 14 | 15 | class PassLoginView extends GetView { 16 | const PassLoginView({Key? key}) : super(key: key); 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | backgroundColor: Colors.white, 21 | appBar: AppBar( 22 | backgroundColor: Colors.white, 23 | elevation: 0, 24 | actions: [TextButton(onPressed: () {}, child: Text("帮助"))], 25 | ), 26 | body: ListView( 27 | padding: EdgeInsets.all(ScreenAdapter.width(40)), 28 | children: [ 29 | const Logo(), 30 | //输入手机号 31 | PassTextFiled( 32 | controller: controller.telController, 33 | hintText: "请输入手机号", 34 | onChanged: (value) { 35 | print(value); 36 | }), 37 | 38 | PassTextFiled( 39 | controller: controller.passController, 40 | hintText: "请输入密码", 41 | onChanged: (value) { 42 | print(value); 43 | }), 44 | //用户协议 45 | const UserAgreement(), 46 | //登录按钮 47 | PassButton( 48 | text: "登录", 49 | onPressed: () async { 50 | // print("获取验证码"); 51 | if (!GetUtils.isPhoneNumber(controller.telController.text) || 52 | controller.telController.text.length != 11) { 53 | Get.snackbar("提示信息!", "手机号格式不合法"); 54 | } else if (controller.passController.text.length < 6) { 55 | Get.snackbar("提示信息!", "密码长度不能小于6位"); 56 | } else { 57 | MessageModel result = await controller.doLogin(); 58 | if(result.success){ 59 | //执行跳转 回到根 60 | // Get.offAllNamed("/tabs",arguments: { 61 | // "initialPage":4 //注册完成后会加载tabs第五个页面 62 | // }); 63 | Get.back(); 64 | }else{ 65 | Get.snackbar("提示信息!",result.message); 66 | } 67 | } 68 | }), 69 | Row( 70 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 71 | children: [ 72 | TextButton(onPressed: () {}, child: const Text("忘记密码")), 73 | TextButton(onPressed: () {}, child: const Text("验证码登录")) 74 | ], 75 | ) 76 | ], 77 | ), 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepOne/bindings/register_step_one_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/register_step_one_controller.dart'; 4 | 5 | class RegisterStepOneBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => RegisterStepOneController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepOne/controllers/register_step_one_controller.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:get/get.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import '../../../../models/message.dart'; 6 | import '../../../../units/httpsClient.dart'; 7 | 8 | class RegisterStepOneController extends GetxController { 9 | //TODO: Implement RegisterStepOneController 10 | 11 | TextEditingController editingController=TextEditingController(); 12 | HttpsClient httpsClient = HttpsClient(); 13 | @override 14 | void onInit() { 15 | super.onInit(); 16 | } 17 | 18 | @override 19 | void onClose() { 20 | super.onClose(); 21 | } 22 | //发送验证码 23 | Future sendCode() async{ 24 | var response = await httpsClient.post("api/sendCode",data:{ 25 | "tel":editingController.text 26 | }); 27 | if (response != null) { 28 | print(response); 29 | if(response.data["success"]){ 30 | //测试:把验证码复制到剪切板上面,正式上线不需要这句话,这个为了方便测试 31 | Clipboard.setData(ClipboardData(text: response.data["code"])); 32 | return MessageModel(message: "发送验证码成功", success: true); 33 | } 34 | return MessageModel(message: response.data["message"], success: false); 35 | }else{ 36 | return MessageModel(message:"网络异常", success: false); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepOne/views/register_step_one_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../../models/message.dart'; 6 | import '../../../../units/screenAdapter.dart'; 7 | import '../../../../widget/logo.dart'; 8 | import '../../../../widget/passButton.dart'; 9 | import '../../../../widget/passTextField.dart'; 10 | import '../controllers/register_step_one_controller.dart'; 11 | 12 | class RegisterStepOneView extends GetView { 13 | const RegisterStepOneView({Key? key}) : super(key: key); 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | backgroundColor: Colors.white, 18 | appBar: AppBar( 19 | backgroundColor: Colors.white, 20 | elevation: 0, 21 | centerTitle: true, 22 | title: const Text("手机号快速注册"), 23 | ), 24 | body: ListView( 25 | padding: EdgeInsets.all(ScreenAdapter.width(40)), 26 | children: [ 27 | //logo 28 | const Logo(), 29 | //输入手机号 30 | PassTextFiled( 31 | controller: controller.editingController, //这是获取电话 32 | hintText: "请输入手机号", 33 | onChanged: (value) { 34 | print(value); 35 | }), 36 | SizedBox(height: ScreenAdapter.height(40)), 37 | 38 | PassButton( 39 | text: "下一步", 40 | onPressed: () async { 41 | //判断手机号是否合法GetUtils.isPhoneNumber也可以用正则 42 | if (GetUtils.isPhoneNumber(controller.editingController.text) && 43 | controller.editingController.text.length == 11) { 44 | //因为是异步所以前面加await 45 | MessageModel result = await controller.sendCode(); 46 | if (result.success) { 47 | Get.toNamed("/register-step-two", arguments: { 48 | "tel": controller.editingController.text //把手机号传到下个页面以便验证 49 | }); 50 | } else { 51 | Get.snackbar("提示信息!", result.message); 52 | } 53 | } else { 54 | Get.snackbar("提示信息!", "手机号格式不合法"); 55 | } 56 | }), 57 | Container( 58 | margin: EdgeInsets.only(top: ScreenAdapter.height(20)), 59 | child: Row( 60 | mainAxisAlignment: MainAxisAlignment.center, 61 | children: [ 62 | const Text("遇到问题?您可以"), 63 | TextButton( 64 | onPressed: () { 65 | print("获取帮助"); 66 | }, 67 | child: const Text("获取帮助")) 68 | ], 69 | ), 70 | ) 71 | ], 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepThree/bindings/register_step_three_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/register_step_three_controller.dart'; 4 | 5 | class RegisterStepThreeBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => RegisterStepThreeController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepThree/controllers/register_step_three_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../../../../models/message.dart'; 5 | import '../../../../units/httpsClient.dart'; 6 | import '../../../../units/storage.dart'; 7 | 8 | class RegisterStepThreeController extends GetxController { 9 | //TODO: Implement RegisterStepThreeController 10 | 11 | TextEditingController passController=TextEditingController(); 12 | TextEditingController confirmPassController=TextEditingController(); 13 | HttpsClient httpsClient = HttpsClient(); 14 | String tel=Get.arguments["tel"]; 15 | String code=Get.arguments["code"]; 16 | 17 | @override 18 | void onInit() { 19 | super.onInit(); 20 | } 21 | 22 | @override 23 | void onReady() { 24 | super.onReady(); 25 | } 26 | 27 | @override 28 | void onClose() { 29 | super.onClose(); 30 | } 31 | 32 | //执行注册 33 | Future doRegister() async{ 34 | var response = await httpsClient.post("api/register",data:{ 35 | "tel":tel, 36 | "password":passController.text, 37 | "code":code 38 | }); 39 | if (response != null) { 40 | print(response); 41 | if(response.data["success"]){ 42 | //执行登录 保存用户信息 43 | Storage.setData("userinfo",response.data["userinfo"]); 44 | return MessageModel(message: "注册成功", success: true); 45 | } 46 | 47 | return MessageModel(message: response.data["message"], success: false); 48 | }else{ 49 | return MessageModel(message: "网络异常", success: false); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepThree/views/register_step_three_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../../models/message.dart'; 6 | import '../../../../units/screenAdapter.dart'; 7 | import '../../../../widget/logo.dart'; 8 | import '../../../../widget/passButton.dart'; 9 | import '../../../../widget/passTextField.dart'; 10 | import '../controllers/register_step_three_controller.dart'; 11 | 12 | class RegisterStepThreeView extends GetView { 13 | const RegisterStepThreeView({Key? key}) : super(key: key); 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | backgroundColor: Colors.white, 18 | appBar: AppBar( 19 | backgroundColor: Colors.white, 20 | elevation: 0, 21 | centerTitle: true, 22 | title: const Text("手机号快速注册"), 23 | actions: [TextButton(onPressed: () {}, child: const Text("帮助"))], 24 | ), 25 | body: ListView( 26 | padding: EdgeInsets.all(ScreenAdapter.width(40)), 27 | children: [ 28 | const Logo(), 29 | //输入手机号 30 | PassTextFiled( 31 | controller: controller.passController, 32 | isPassWord: true, 33 | hintText: "请输入密码", 34 | keyboardType:TextInputType.text, 35 | onChanged: (value) { 36 | print(value); 37 | }), 38 | 39 | PassTextFiled( 40 | controller: controller.confirmPassController, 41 | isPassWord: true, 42 | keyboardType:TextInputType.text, 43 | hintText: "请输入确认密码", 44 | onChanged: (value) { 45 | print(value); 46 | }), 47 | 48 | SizedBox(height: ScreenAdapter.height(20)), 49 | PassButton( 50 | text: "完成注册", 51 | onPressed: () async{ 52 | if(controller.passController.text!=controller.confirmPassController.text){ 53 | Get.snackbar("提示信息!","密码和确认密码不一致"); 54 | }else if(controller.passController.text.length<6){ 55 | Get.snackbar("提示信息!","密码长度不能小于6位"); 56 | }else{ 57 | //model类你也可以用map表示返回的各种多个信息 58 | MessageModel result= await controller.doRegister(); 59 | if(result.success){ 60 | //执行跳转 回到根 61 | Get.offAllNamed("/tabs",arguments: { 62 | "initialPage":4 //注册完成后会加载tabs第五个页面 63 | }); 64 | }else{ 65 | Get.snackbar("提示信息!",result.message); 66 | } 67 | } 68 | 69 | }), 70 | ], 71 | ), 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepTwo/bindings/register_step_two_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/register_step_two_controller.dart'; 4 | 5 | class RegisterStepTwoBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => RegisterStepTwoController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/login/registerStepTwo/controllers/register_step_two_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | import '../../../../units/httpsClient.dart'; 8 | 9 | class RegisterStepTwoController extends GetxController { 10 | //TODO: Implement RegisterStepTwoController 11 | 12 | final TextEditingController editingController = TextEditingController(); 13 | HttpsClient httpsClient = HttpsClient(); 14 | String tel = Get.arguments["tel"]; 15 | RxInt seconds = 60.obs; 16 | @override 17 | void onInit() { 18 | super.onInit(); 19 | countDown(); 20 | } 21 | 22 | @override 23 | void onReady() { 24 | super.onReady(); 25 | } 26 | 27 | @override 28 | void onClose() { 29 | super.onClose(); 30 | } 31 | 32 | //验证验证码 33 | Future validateCode() async { 34 | var response = await httpsClient.post("api/validateCode", data: { 35 | "tel": tel, //上一个页面穿过来的手机号 36 | "code": editingController.text //验证码的值 37 | }); 38 | if (response != null) { 39 | if (response.data["success"]) { 40 | return true; 41 | } 42 | return false; 43 | } else { 44 | return false; 45 | } 46 | } 47 | 48 | //重新发送验证码 49 | void sendCode() async { 50 | var response = await httpsClient.post("api/sendCode", data: {"tel": tel}); 51 | if (response != null) { 52 | print(response); 53 | if (!response.data["success"]) { 54 | Get.snackbar("提示信息!", "非法请求"); 55 | }else{ 56 | 57 | //测试:把验证码复制到剪切板上面,正式上线不需要这句话,这个为了方便测试 58 | Clipboard.setData(ClipboardData(text: response.data["code"])); 59 | 60 | seconds.value=60; 61 | countDown(); 62 | update(); 63 | } 64 | } else { 65 | Get.snackbar("提示信息!", "网络异常请重试"); 66 | } 67 | } 68 | //倒计时的方法 69 | countDown() { 70 | Timer.periodic(const Duration(milliseconds: 1000), (timer) { 71 | seconds.value--; 72 | if (seconds.value == 0) { 73 | timer.cancel(); 74 | } 75 | update(); 76 | }); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/app/modules/productContent/bindings/product_content_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/product_content_controller.dart'; 4 | 5 | class ProductContentBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => ProductContentController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/productContent/views/cart_item_mun_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../../../units/screenAdapter.dart'; 6 | import '../controllers/product_content_controller.dart'; 7 | 8 | class CartItemMunView extends GetView { 9 | @override 10 | final ProductContentController controller = Get.find(); 11 | CartItemMunView({Key? key}) : super(key: key); 12 | 13 | Widget _left() { 14 | return InkWell( 15 | onTap: () { 16 | controller.decBuyNum(); 17 | print(controller.buyNum); 18 | }, 19 | child: Container( 20 | alignment: Alignment.center, 21 | width: ScreenAdapter.width(80), 22 | height: ScreenAdapter.height(80), 23 | child: const Text("-"), 24 | ), 25 | ); 26 | } 27 | 28 | Widget _center() { 29 | return Obx(()=>Container( 30 | decoration: BoxDecoration( 31 | border: Border( 32 | left: BorderSide(width: ScreenAdapter.width(2), color: Colors.black12), 33 | right: BorderSide(width: ScreenAdapter.width(2), color: Colors.black12), 34 | )), 35 | alignment: Alignment.center, 36 | width: ScreenAdapter.width(80), 37 | height: ScreenAdapter.height(80), 38 | child: Text("${controller.buyNum.value}"), 39 | )); 40 | } 41 | 42 | Widget _right() { 43 | return InkWell( 44 | onTap: (){ 45 | controller.incBuyNum(); 46 | print(controller.buyNum); 47 | }, 48 | child: Container( 49 | alignment: Alignment.center, 50 | width: ScreenAdapter.width(80), 51 | height: ScreenAdapter.height(80), 52 | child: const Text("+"), 53 | ), 54 | ); 55 | } 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return Container( 60 | width: ScreenAdapter.width(244), 61 | height: ScreenAdapter.height(60), 62 | decoration: BoxDecoration( 63 | border: Border.all( 64 | width: ScreenAdapter.width(2), 65 | color: Colors.black12 66 | ) 67 | ), 68 | child: Row( 69 | children: [ 70 | _left(), 71 | _center(), 72 | _right() 73 | 74 | ], 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/app/modules/productContent/views/three_tab_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | import '../../../units/screenAdapter.dart'; 5 | import '../controllers/product_content_controller.dart'; 6 | 7 | class ThreeTabView extends GetView { 8 | @override 9 | final ProductContentController controller = Get.find(); 10 | ThreeTabView({Key? key}) : super(key: key); 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | key: controller.gk3, 15 | alignment: Alignment.center, 16 | width: ScreenAdapter.width(1080), 17 | height: ScreenAdapter.height(3600), 18 | color: Colors.yellow, 19 | child: const Text("推荐", style: TextStyle(fontSize: 100)), 20 | ); 21 | } 22 | } -------------------------------------------------------------------------------- /lib/app/modules/productContent/views/two_tab_view.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @ Author: kiko 3 | * @ Create Time: 2024-03-24 00:43:39 4 | * @ Modified by: kiko 5 | * @ Modified time: 2024-03-27 01:48:29 6 | * @ Description: 7 | */ 8 | 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_html/flutter_html.dart'; 11 | 12 | import 'package:get/get.dart'; 13 | import '../../../units/screenAdapter.dart'; 14 | import '../controllers/product_content_controller.dart'; 15 | 16 | 17 | class TwoTabView extends GetView { 18 | @override 19 | final ProductContentController controller = Get.find(); 20 | final Function subHeader; 21 | TwoTabView(this.subHeader, {Key? key}) : super(key: key); 22 | @override 23 | Widget build(BuildContext context) { 24 | return Container( 25 | key: controller.gk2, 26 | alignment: Alignment.center, 27 | width: ScreenAdapter.width(1080), 28 | child: Obx(()=> controller.pcontent.value.content!=null?Column( 29 | children: [ 30 | subHeader(), 31 | 32 | controller.selectedSubTabsIndex.value==1?SizedBox( 33 | width: ScreenAdapter.width(1080), 34 | child: Html( 35 | data: controller.pcontent.value.content, 36 | style: { 37 | "body":Style( 38 | backgroundColor: Colors.white 39 | ), 40 | "p":Style( 41 | fontSize: FontSize.large 42 | ), 43 | }, 44 | ) 45 | ):SizedBox( 46 | width: ScreenAdapter.width(1080), 47 | child: Html( 48 | data: controller.pcontent.value.specs, 49 | style: { 50 | "body":Style( 51 | backgroundColor: Colors.white 52 | ), 53 | "p":Style( 54 | fontSize: FontSize.large 55 | ), 56 | }, 57 | ), 58 | ) 59 | ], 60 | ):const Text("")), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/app/modules/productList/bindings/product_list_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/product_list_controller.dart'; 4 | 5 | class ProductListBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => ProductListController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/serach/bindings/serach_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/serach_controller.dart'; 4 | 5 | class SerachBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => SerachController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/serach/controllers/serach_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import '../../../units/searchServices.dart'; 3 | import '../../../units/storage.dart'; 4 | 5 | class SerachController extends GetxController { 6 | //TODO: Implement SerachController、 7 | String keywords = ""; 8 | RxList historyList = [].obs; 9 | final count = 0.obs; 10 | @override 11 | void onInit() { 12 | super.onInit(); 13 | getHistoryData(); 14 | } 15 | 16 | @override 17 | void onReady() { 18 | super.onReady(); 19 | } 20 | 21 | @override 22 | void onClose() { 23 | super.onClose(); 24 | } 25 | 26 | //获取历史记录 27 | getHistoryData() async { 28 | var tempList = await SearchServices.getHistoryData(); 29 | //如果不为空,则把数据赋值给它 30 | if (tempList.isNotEmpty) { 31 | historyList.addAll(tempList); 32 | update(); 33 | } 34 | } 35 | 36 | //删除全部历史记录 37 | clearHistoryData() async{ 38 | await SearchServices.clearHistoryData(); 39 | historyList.clear(); 40 | update(); 41 | } 42 | 43 | 44 | //长按删除单个历史记录 45 | removeHistoryData(keywords) async{ 46 | var tempList=await SearchServices.getHistoryData(); 47 | if(tempList.isNotEmpty){ 48 | tempList.remove(keywords); 49 | await Storage.setData("searchList", tempList); 50 | //注意当前历史数据 51 | historyList.remove(keywords); 52 | update(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/app/modules/service/controllers/service_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class ServiceController extends GetxController { 4 | 5 | final count = 0.obs; 6 | @override 7 | void onInit() { 8 | super.onInit(); 9 | } 10 | 11 | @override 12 | void onReady() { 13 | super.onReady(); 14 | } 15 | 16 | @override 17 | void onClose() { 18 | super.onClose(); 19 | } 20 | 21 | void increment() => count.value++; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/jiPush/bindings/ji_push_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/ji_push_controller.dart'; 4 | 5 | class JiPushBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => JiPushController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/service/jiPush/controllers/ji_push_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class JiPushController extends GetxController { 4 | //TODO: Implement JiPushController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/jiPush/views/ji_push_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/ji_push_controller.dart'; 6 | 7 | class JiPushView extends GetView { 8 | const JiPushView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('JiPushView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'JiPushView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/service/lanya/bindings/lanya_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/lanya_controller.dart'; 4 | 5 | class LanyaBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => LanyaController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/service/lanya/controllers/lanya_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class LanyaController extends GetxController { 4 | //TODO: Implement LanyaController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/lanya/views/lanya_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/lanya_controller.dart'; 6 | 7 | class LanyaView extends GetView { 8 | const LanyaView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('LanyaView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'LanyaView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/service/live/bindings/live_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/live_controller.dart'; 4 | 5 | class LiveBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => LiveController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/service/live/controllers/live_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class LiveController extends GetxController { 4 | //TODO: Implement LiveController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/live/views/live_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/live_controller.dart'; 6 | 7 | class LiveView extends GetView { 8 | const LiveView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('LiveView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'LiveView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/service/oneClickLogin/bindings/one_click_login_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/one_click_login_controller.dart'; 4 | 5 | class OneClickLoginBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => OneClickLoginController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/service/oneClickLogin/controllers/one_click_login_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class OneClickLoginController extends GetxController { 4 | //TODO: Implement OneClickLoginController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/oneClickLogin/views/one_click_login_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/one_click_login_controller.dart'; 6 | 7 | class OneClickLoginView extends GetView { 8 | const OneClickLoginView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('OneClickLoginView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'OneClickLoginView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/service/views/service_view.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @ Author: kiko 3 | * @ Create Time: 2024-04-21 20:51:55 4 | * @ Modified by: kiko 5 | * @ Modified time: 2024-04-22 03:53:29 6 | * @ Description: 7 | */ 8 | 9 | 10 | 11 | import 'package:flutter/material.dart'; 12 | 13 | import 'package:get/get.dart'; 14 | 15 | import '../controllers/service_controller.dart'; 16 | import '../jiPush/views/ji_push_view.dart'; 17 | import '../lanya/views/lanya_view.dart'; 18 | import '../live/views/live_view.dart'; 19 | import '../watch/views/watch_view.dart'; 20 | import '../wift/views/wift_view.dart'; 21 | import '../oneClickLogin/views/one_click_login_view.dart'; 22 | 23 | class ServiceView extends GetView { 24 | ServiceView({Key? key}) : super(key: key); 25 | List> blocks = [ 26 | { 27 | '极光推送': Icons.ad_units_sharp, 28 | '实时聊天': Icons.speaker_notes_off, 29 | '娱乐直播': Icons.screen_share, 30 | }, 31 | { 32 | '蓝牙通讯': Icons.camera_alt, 33 | 'wift': Icons.camera, 34 | }, 35 | { 36 | '一键登录': Icons.assignment, 37 | }, 38 | ]; 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return ListView.builder( 43 | itemCount: blocks.length, 44 | itemBuilder: (context, index) { 45 | return Container( 46 | margin: const EdgeInsets.symmetric(vertical: 10), 47 | decoration: const BoxDecoration( 48 | border: Border( 49 | top: BorderSide( 50 | width: 2.0, 51 | color: Color.fromARGB(255, 201, 198, 198), 52 | ), 53 | bottom: BorderSide( 54 | width: 2.0, 55 | color: Color.fromARGB(255, 201, 198, 198), 56 | ), 57 | ), 58 | ), 59 | child: ListView.separated( 60 | physics: const NeverScrollableScrollPhysics(), //解决滑动 61 | shrinkWrap: true, 62 | itemBuilder: (context, itemIndex) { 63 | return InkWell( 64 | onTap: () { 65 | _handClickItem(blocks[index].keys.elementAt(itemIndex)); 66 | }, 67 | child: ListTile( 68 | leading: Icon(blocks[index].values.elementAt(itemIndex)), 69 | title: Text(blocks[index].keys.elementAt(itemIndex)), 70 | trailing: const Icon(Icons.arrow_forward_ios), 71 | ), 72 | ); 73 | }, 74 | separatorBuilder: (context, itemIndex) { 75 | return const Divider(); 76 | }, 77 | itemCount: blocks[index].length), 78 | ); 79 | }, 80 | ); 81 | } 82 | } 83 | 84 | _handClickItem(String itemTitle) { 85 | switch (itemTitle) { 86 | case "极光推送": 87 | Get.to(const JiPushView()); 88 | print("激光通讯"); 89 | break; 90 | case "实时聊天": 91 | Get.to(const WatchView()); 92 | break; 93 | case "娱乐直播": 94 | Get.to(const LiveView()); 95 | break; 96 | case "蓝牙通讯": 97 | Get.to(const LanyaView()); 98 | break; 99 | case "wift": 100 | Get.to(const WiftView()); 101 | break; 102 | case "一键登录": 103 | Get.to(const OneClickLoginView()); 104 | 105 | break; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /lib/app/modules/service/watch/bindings/watch_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/watch_controller.dart'; 4 | 5 | class WatchBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => WatchController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/service/watch/controllers/watch_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class WatchController extends GetxController { 4 | //TODO: Implement WatchController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/watch/views/watch_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/watch_controller.dart'; 6 | 7 | class WatchView extends GetView { 8 | const WatchView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('WatchView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'WatchView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/service/wift/bindings/wift_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../controllers/wift_controller.dart'; 4 | 5 | class WiftBinding extends Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => WiftController(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/app/modules/service/wift/controllers/wift_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class WiftController extends GetxController { 4 | //TODO: Implement WiftController 5 | 6 | final count = 0.obs; 7 | @override 8 | void onInit() { 9 | super.onInit(); 10 | } 11 | 12 | @override 13 | void onReady() { 14 | super.onReady(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | void increment() => count.value++; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/modules/service/wift/views/wift_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../controllers/wift_controller.dart'; 6 | 7 | class WiftView extends GetView { 8 | const WiftView({Key? key}) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('WiftView'), 14 | centerTitle: true, 15 | ), 16 | body: const Center( 17 | child: Text( 18 | 'WiftView is working', 19 | style: TextStyle(fontSize: 20), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/modules/tabs/bindings/tabs_binding.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-21 11:07:38 6 | * @LastEditors: kiko 7 | * @LastEditTime: 2024-02-21 12:12:41 8 | */ 9 | import 'package:get/get.dart'; 10 | 11 | import '../controllers/tabs_controller.dart'; 12 | 13 | 14 | import '../../category/controllers/category_controller.dart'; 15 | import '../../home/controllers/home_controller.dart'; 16 | import '../../service/controllers/service_controller.dart'; 17 | import '../../user/controllers/user_controller.dart'; 18 | 19 | class TabsBinding extends Bindings { 20 | @override 21 | void dependencies() { 22 | Get.lazyPut( 23 | () => TabsController(), 24 | ); 25 | Get.lazyPut( 26 | () => HomeController(), 27 | ); 28 | // Get.lazyPut( 29 | // () => CartController(), 30 | // ); 31 | Get.lazyPut( 32 | () => CategoryController(), 33 | );Get.lazyPut( 34 | () => ServiceController(), 35 | ); 36 | Get.lazyPut( 37 | () => UserController(), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/app/modules/tabs/controllers/tabs_controller.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-21 11:07:38 6 | * @LastEditors: kiko 7 | * @LastEditTime: 2024-02-22 15:05:16 8 | */ 9 | import 'package:flutter/material.dart'; 10 | import 'package:get/get.dart'; 11 | import '../../cart/views/cart_view.dart'; 12 | import '../../category/views/category_view.dart'; 13 | import '../../service/views/service_view.dart'; 14 | import '../../user/views/user_view.dart'; 15 | import '../../home/views/home_view.dart'; 16 | 17 | class TabsController extends GetxController { 18 | //TODO: Implement TabsController 19 | final List pages = [ 20 | const HomeView(), 21 | const CategoryView(), 22 | ServiceView(), 23 | CartView(), 24 | const UserView() 25 | ]; 26 | 27 | //用于控制默认加载的tabs选项 28 | RxInt currentIndex = 0.obs; 29 | PageController pageController=Get.arguments!=null?PageController(initialPage:Get.arguments["initialPage"]): PageController(initialPage:0); 30 | @override 31 | void onInit() { 32 | if(Get.arguments!=null){ 33 | currentIndex.value=Get.arguments["initialPage"]; 34 | update(); 35 | } 36 | 37 | super.onInit(); 38 | } 39 | 40 | @override 41 | void onClose() { 42 | super.onClose(); 43 | } 44 | 45 | void setCurrentIndex(index) { 46 | currentIndex.value = index; 47 | update(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/app/modules/tabs/views/tabs_view.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-21 11:07:38 6 | * @LastEditors: kiko 7 | * @LastEditTime: 2024-02-22 15:11:39 8 | */ 9 | import 'package:flutter/material.dart'; 10 | 11 | import 'package:get/get.dart'; 12 | 13 | import '../controllers/tabs_controller.dart'; 14 | 15 | class TabsView extends GetView { 16 | const TabsView({Key? key}) : super(key: key); 17 | @override 18 | Widget build(BuildContext context) { 19 | return Obx(() => Scaffold( 20 | body: PageView(//左右滑动切换页面 21 | controller: controller.pageController, 22 | children: controller.pages, 23 | onPageChanged: (index) { 24 | controller.setCurrentIndex(index); 25 | }, 26 | ), // 27 | bottomNavigationBar: BottomNavigationBar( 28 | fixedColor: Colors.red, //选中的颜色 29 | currentIndex: controller.currentIndex.value, //第几个菜单选中 30 | type: 31 | BottomNavigationBarType.fixed, //如果底部有4个或者4个以上的菜单的时候就需要配置这个参数 32 | onTap: (index) { 33 | controller.setCurrentIndex(index); 34 | controller.pageController.jumpToPage(index);//pageVIew转换页面 35 | }, 36 | items: const [ 37 | BottomNavigationBarItem(icon: Icon(Icons.home), label: "首页"), 38 | BottomNavigationBarItem( 39 | icon: Icon(Icons.category), label: "分类"), 40 | BottomNavigationBarItem( 41 | icon: Icon(Icons.room_service), label: "服务"), 42 | BottomNavigationBarItem( 43 | icon: Icon(Icons.shopping_cart), label: "购物车"), 44 | BottomNavigationBarItem(icon: Icon(Icons.people), label: "用户") 45 | ]), 46 | )); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/app/modules/user/controllers/user_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import '../../../models/user_model.dart'; 4 | import '../../../units/userServices.dart'; 5 | 6 | class UserController extends GetxController { 7 | RxBool isLogin = false.obs; 8 | // RxList userList = [].obs; 9 | var userInfo = UserModel().obs;//把用户信息模块化 10 | @override 11 | void onInit() { 12 | super.onInit(); 13 | print("userinfo"); 14 | getUserInfo(); 15 | } 16 | 17 | @override 18 | void onClose() { 19 | super.onClose(); 20 | } 21 | 22 | //获取用户信息 23 | getUserInfo() async { 24 | var tempLoginState = await UserServices.getUserLoginState(); 25 | isLogin.value = tempLoginState; 26 | var tempList = await UserServices.getUserInfo(); 27 | if (tempList.isNotEmpty) { 28 | userInfo.value = UserModel.fromJson(tempList[0]); 29 | update(); 30 | } 31 | } 32 | 33 | //退出登录 34 | loginOut() { 35 | UserServices.loginOut(); 36 | isLogin.value = false; 37 | //把信息值为空 38 | userInfo.value = UserModel(); 39 | update(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/app/routes/app_routes.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-21 10:54:07 6 | * @LastEditors: web-kiko kikoiiii@163.com 7 | * @LastEditTime: 2024-03-15 19:29:14 8 | */ 9 | part of 'app_pages.dart'; 10 | // DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart 11 | 12 | abstract class Routes { 13 | Routes._(); 14 | static const TABS = _Paths.TABS; 15 | static const PRODUCT_LIST = _Paths.PRODUCT_LIST; 16 | static const SERACH = _Paths.SERACH; 17 | static const PRODUCT_CONTENT = _Paths.PRODUCT_CONTENT; 18 | static const Cart = _Paths.Cart; 19 | static const CODE_LOGIN_STEP_ONE = _Paths.CODE_LOGIN_STEP_ONE; 20 | static const CODE_LOGIN_STEP_TWO = _Paths.CODE_LOGIN_STEP_TWO; 21 | static const ON_STEP_LOGIN = _Paths.ON_STEP_LOGIN; 22 | static const PASS_LOGIN = _Paths.PASS_LOGIN; 23 | static const REGISTER_STEP_ONE = _Paths.REGISTER_STEP_ONE; 24 | static const REGISTER_STEP_TWO = _Paths.REGISTER_STEP_TWO; 25 | static const REGISTER_STEP_THREE = _Paths.REGISTER_STEP_THREE; 26 | static const CHECKOUT = _Paths.CHECKOUT; 27 | static const ADDRESS_ADD = _Paths.ADDRESS_ADD; 28 | static const ADDRESS_LIST = _Paths.ADDRESS_LIST; 29 | static const ADDRESS_EDIT = _Paths.ADDRESS_EDIT; 30 | static const BUY = _Paths.BUY; 31 | static const ORDER = _Paths.ORDER; 32 | static const ORDER_INFO = _Paths.ORDER_INFO; 33 | static const J_PUSH = _Paths.J_PUSH; 34 | static const WATCH = _Paths.WATCH; 35 | static const JI_PUSH = _Paths.JI_PUSH; 36 | static const LIVE = _Paths.LIVE; 37 | static const ONE_CLICK_LOGIN = _Paths.ONE_CLICK_LOGIN; 38 | static const LANYA = _Paths.LANYA; 39 | static const WIFT = _Paths.WIFT; 40 | } 41 | 42 | abstract class _Paths { 43 | _Paths._(); 44 | 45 | static const TABS = '/tabs'; 46 | static const PRODUCT_LIST = '/product-list'; 47 | static const SERACH = '/serach'; 48 | static const PRODUCT_CONTENT = '/product-content'; 49 | static const Cart = '/cart'; 50 | static const CODE_LOGIN_STEP_ONE = '/code-login-step-one'; 51 | static const CODE_LOGIN_STEP_TWO = '/code-login-step-two'; 52 | static const ON_STEP_LOGIN = '/on-step-login'; 53 | static const PASS_LOGIN = '/pass-login'; 54 | static const REGISTER_STEP_ONE = '/register-step-one'; 55 | static const REGISTER_STEP_TWO = '/register-step-two'; 56 | static const REGISTER_STEP_THREE = '/register-step-three'; 57 | static const CHECKOUT = '/checkout'; 58 | static const ADDRESS_ADD = '/address-add'; 59 | static const ADDRESS_LIST = '/address-list'; 60 | static const ADDRESS_EDIT = '/address-edit'; 61 | static const BUY = '/buy'; 62 | static const ORDER = '/order'; 63 | static const ORDER_INFO = '/order-info'; 64 | static const J_PUSH = '/j-push'; 65 | static const WATCH = '/watch'; 66 | static const JI_PUSH = '/ji-push'; 67 | static const LIVE = '/live'; 68 | static const ONE_CLICK_LOGIN = '/one-click-login'; 69 | static const LANYA = '/lanya'; 70 | static const WIFT = '/wift'; 71 | } 72 | -------------------------------------------------------------------------------- /lib/app/units/httpsClient.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | class HttpsClient { 4 | static String domain = "https://miapp.itying.com/"; 5 | static Dio dio = Dio(); 6 | HttpsClient() { 7 | dio.options.baseUrl = domain; 8 | dio.options.connectTimeout = 5000; //5s 9 | dio.options.receiveTimeout = 5000; 10 | } 11 | 12 | Future get(apiUrl) async { 13 | try { 14 | var response = await dio.get(apiUrl); 15 | return response; 16 | } catch (e) { 17 | print("请求超时"); 18 | return null; 19 | } 20 | } 21 | //加载网络图片 22 | static replaeUri(picUrl){ 23 | String tempUrl=domain+picUrl; 24 | return tempUrl.replaceAll("\\", "/"); 25 | } 26 | 27 | Future post(String apiUrl,{Map? data}) async { 28 | try { 29 | var response = await dio.post(apiUrl,data:data); 30 | return response; 31 | } catch (e) { 32 | print("请求超时"); 33 | return null; 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /lib/app/units/keepAliveWrapper.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: web-kiko kikoiiii@163.com 3 | * @Date: 2024-03-04 11:57:43 4 | * @LastEditors: web-kiko kikoiiii@163.com 5 | * @LastEditTime: 2024-03-06 17:06:16 6 | * @FilePath: \flutter3_getx_shop\lib\app\services\keepAliveWrapper.dart 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A 8 | */ 9 | 10 | import 'package:flutter/material.dart'; 11 | 12 | class KeepAliveWrapper extends StatefulWidget { 13 | const KeepAliveWrapper( 14 | {Key? key, @required this.child, this.keepAlive = true}) 15 | : super(key: key); 16 | 17 | final Widget? child; 18 | final bool keepAlive; 19 | 20 | @override 21 | State createState() => _KeepAliveWrapperState(); 22 | } 23 | 24 | class _KeepAliveWrapperState extends State 25 | with AutomaticKeepAliveClientMixin { 26 | @override 27 | Widget build(BuildContext context) { 28 | super.build(context); 29 | return widget.child!; 30 | } 31 | 32 | @override 33 | bool get wantKeepAlive => widget.keepAlive; 34 | } 35 | -------------------------------------------------------------------------------- /lib/app/units/myFonts.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-24 11:25:57 6 | * @LastEditors: kiko 7 | * @LastEditTime: 2024-02-24 11:58:21 8 | */ 9 | import 'package:flutter/material.dart'; 10 | 11 | class MyFonts { 12 | static const IconData xiaomi = 13 | IconData(0xe623, fontFamily: "MyIcon", matchTextDirection: true); 14 | static const IconData weixiufuwu = 15 | IconData(0xead5, fontFamily: "MyIcon", matchTextDirection: true); 16 | static const IconData anzhuang = 17 | IconData(0xead5, fontFamily: "userIcon", matchTextDirection: true); 18 | 19 | static const IconData chongdian = 20 | IconData(0xf01bf, fontFamily: "userIcon", matchTextDirection: true); 21 | static const IconData kefu = 22 | IconData(0xe88f, fontFamily: "userIcon", matchTextDirection: true); 23 | static const IconData weixiu = 24 | IconData(0xe607, fontFamily: "userIcon", matchTextDirection: true); 25 | static const IconData tuihuanhuo = 26 | IconData(0xe624, fontFamily: "userIcon", matchTextDirection: true); 27 | static const IconData schedule = 28 | IconData(0xe634, fontFamily: "userIcon", matchTextDirection: true); 29 | static const IconData anzhuangyewu = 30 | IconData(0xe63c, fontFamily: "userIcon", matchTextDirection: true); 31 | static const IconData duihuan = 32 | IconData(0xf4b0, fontFamily: "userIcon", matchTextDirection: true); 33 | } 34 | -------------------------------------------------------------------------------- /lib/app/units/screenAdapter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 | 3 | class ScreenAdapter{ 4 | 5 | static width(num v){ 6 | return v.w; 7 | } 8 | static height(num v){ 9 | return v.h; 10 | } 11 | static fontSize(num v){ 12 | return v.sp; 13 | } 14 | static getScreenWidth(){ 15 | // return ScreenUtil().screenWidth; 16 | return 1.sw; 17 | } 18 | static getScreenHeight (){ 19 | // return ScreenUtil().screenHeight; 20 | return 1.sh; 21 | } 22 | 23 | 24 | static getStatusBarHeight (){ 25 | return ScreenUtil().statusBarHeight; //状态栏高度 刘海屏会更高 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /lib/app/units/searchServices.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: web-kiko kikoiiii@163.com 3 | * @Date: 2024-03-19 15:47:48 4 | * @LastEditors: web-kiko kikoiiii@163.com 5 | * @LastEditTime: 2024-03-19 16:06:50 6 | * @FilePath: \flutter3_getx_shop\lib\app\units\searchServices.dart 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE 8 | */ 9 | import 'storage.dart'; 10 | 11 | class SearchServices { 12 | //保存历史搜索记录 13 | static setHistoryData(keywords) async { 14 | /* 15 | 1、获取本地存储里面的数据 (searchList) 16 | 2、判断本地存储是否有数据 17 | 2.1、如果有数据 18 | 1、读取本地存储的数据 19 | 2、判断本地存储中有没有当前数据, 20 | 如果有不做操作、 21 | 如果没有当前数据,本地存储的数据和当前数据拼接后重新写入 22 | 2.2、如果没有数据 23 | 直接把当前数据放在数组中写入到本地存储 24 | 25 | */ 26 | 27 | List? searchListData = await Storage.getData("searchList"); 28 | if (searchListData != null) { 29 | var hasData = searchListData.any((v) { 30 | return v == keywords; 31 | }); 32 | if (!hasData) { 33 | searchListData.add(keywords); 34 | await Storage.setData("searchList", searchListData); 35 | } 36 | } else { 37 | List tempList = []; 38 | tempList.add(keywords); 39 | await Storage.setData("searchList", tempList); 40 | } 41 | } 42 | 43 | //获取历史搜索记录 44 | static Future getHistoryData() async { 45 | List? searchListData = await Storage.getData("searchList"); 46 | if (searchListData != null) { 47 | return searchListData; 48 | } else { 49 | return []; 50 | } 51 | } 52 | 53 | //删除搜索记录 54 | static deleteHistoryData(keywords) async { 55 | List? searchListData = await Storage.getData("searchList"); 56 | if (searchListData != null) { 57 | searchListData.remove(keywords); 58 | await Storage.setData("searchList", searchListData); 59 | } 60 | } 61 | 62 | //清空搜索记录 63 | static clearHistoryData() async { 64 | await Storage.clear('searchList'); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/app/units/signServices.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:crypto/crypto.dart'; 4 | class SignServices { 5 | // 1.获取登录成功后服务器传回来的salt 6 | // 2.获取请求的所有参数 7 | // 3.生成一个map类型的对象 8 | // 4.获取map类型对象所有的key按照 ASCII 字符顺序进行升序排列 9 | // 5.在把数据进行拼接后在用MD5加密生成签名 10 | 11 | 12 | static String getSign(Map json) { 13 | List jsonKeys=json.keys.toList(); 14 | 15 | jsonKeys.sort(); 16 | 17 | String str=''; 18 | for (var i = 0; i < jsonKeys.length; i++) { 19 | str+="${jsonKeys[i]}${json[jsonKeys[i]]}"; 20 | } 21 | var sign=md5.convert(utf8.encode(str)); 22 | return "$sign"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/units/storage.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class Storage { 6 | static setData(String key, dynamic value) async { 7 | var prefs = await SharedPreferences.getInstance(); 8 | prefs.setString(key, json.encode(value)); 9 | } 10 | 11 | static getData(String key) async { 12 | try { 13 | var prefs = await SharedPreferences.getInstance(); 14 | String? tempData = prefs.getString(key); 15 | if (tempData != null) { 16 | return json.decode(tempData); 17 | } else { 18 | return null; 19 | } 20 | } catch (e) { 21 | return null; 22 | } 23 | } 24 | 25 | static removeData(String key) async { 26 | var prefs = await SharedPreferences.getInstance(); 27 | prefs.remove(key); 28 | } 29 | 30 | static clear(String key) async { 31 | var prefs = await SharedPreferences.getInstance(); 32 | prefs.clear(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/app/units/userServices.dart: -------------------------------------------------------------------------------- 1 | import "./storage.dart"; 2 | 3 | class UserServices { 4 | static Future getUserInfo() async { 5 | List? userInfo = await Storage.getData("userinfo"); 6 | if (userInfo != null) { 7 | return userInfo; 8 | } else { 9 | return []; 10 | } 11 | } 12 | static Future getUserLoginState() async{ 13 | List userInfo = await getUserInfo(); 14 | if (userInfo.isNotEmpty && userInfo[0]["username"] != "") { 15 | return true; 16 | } else { 17 | return false; 18 | } 19 | } 20 | 21 | static loginOut() async{ 22 | Storage.removeData("userinfo"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/widget/logo.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../units/screenAdapter.dart'; 4 | 5 | class Logo extends StatelessWidget { 6 | const Logo({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | alignment: Alignment.center, 12 | margin: EdgeInsets.all(ScreenAdapter.width(80)), 13 | child: SizedBox( 14 | width: ScreenAdapter.width(220), 15 | height: ScreenAdapter.width(220), 16 | child: Image.asset("assets/images/logo.png", fit: BoxFit.cover), 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/app/widget/passButton.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../units/screenAdapter.dart'; 4 | 5 | 6 | class PassButton extends StatelessWidget { 7 | final String text; 8 | final void Function()? onPressed; 9 | const PassButton({super.key, required this.text, required this.onPressed}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | margin: EdgeInsets.only(top: ScreenAdapter.height(80)), 15 | height: ScreenAdapter.height(140), 16 | child: ElevatedButton( 17 | style: ButtonStyle( 18 | backgroundColor: 19 | MaterialStateProperty.all(const Color.fromRGBO(240, 115, 49, 1)), 20 | foregroundColor: MaterialStateProperty.all(Colors.white), 21 | shape: MaterialStateProperty.all(RoundedRectangleBorder( 22 | borderRadius: 23 | BorderRadius.circular(ScreenAdapter.height(70))))), 24 | onPressed: onPressed, 25 | child: Text( 26 | text, 27 | style: TextStyle(fontSize: ScreenAdapter.fontSize(46)), 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/app/widget/passTextField.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../units/screenAdapter.dart'; 3 | 4 | class PassTextFiled extends StatelessWidget { 5 | final bool isPassWord; 6 | final String hintText; 7 | final TextInputType? keyboardType; 8 | final void Function(String)? onChanged; 9 | final TextEditingController? controller;//这是为了获取手机号 10 | const PassTextFiled({super.key,this.controller,required this.hintText,this.onChanged,this.isPassWord=false,this.keyboardType=TextInputType.number}); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | alignment: Alignment.center, 16 | height: ScreenAdapter.height(180), 17 | margin: EdgeInsets.only(top: ScreenAdapter.height(40)), 18 | padding: EdgeInsets.only(left:ScreenAdapter.width(40)), 19 | decoration: BoxDecoration( 20 | color: Colors.black12, 21 | borderRadius: BorderRadius.circular(20) 22 | ), 23 | child: TextField( 24 | // autofocus: true, 25 | controller: controller, 26 | obscureText:isPassWord, 27 | style: TextStyle( 28 | fontSize: ScreenAdapter.fontSize(48) 29 | ), 30 | keyboardType: keyboardType, //默认弹出数字键盘 31 | decoration: InputDecoration( 32 | hintText: hintText, 33 | border: InputBorder.none //去掉下划线 34 | ), 35 | onChanged: onChanged, 36 | ), 37 | ); 38 | } 39 | } -------------------------------------------------------------------------------- /lib/app/widget/pinInput.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import '../units/screenAdapter.dart'; 4 | 5 | class PinInput extends StatelessWidget { 6 | final bool isFirst; 7 | final TextEditingController controller; 8 | final bool autoFocus; 9 | const PinInput( {Key? key,required this.controller, required this.autoFocus,this.isFirst=false,}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return SizedBox( 14 | height: ScreenAdapter.height(180), 15 | width: ScreenAdapter.height(120), 16 | child: TextField( 17 | autofocus: autoFocus, 18 | textAlign: TextAlign.center, 19 | keyboardType: TextInputType.number,//默认调取数字键盘 20 | controller: controller,//调取TextField里的值 21 | maxLength: 1, 22 | cursorColor: Theme.of(context).primaryColor, 23 | decoration: InputDecoration(//边框 24 | border: const OutlineInputBorder(), 25 | counterText: '', //位于右下方显示的文本,常用于显示输入的字符数量 26 | hintStyle: TextStyle(color: Colors.black, fontSize: ScreenAdapter.fontSize(40))), 27 | onChanged: (value) { 28 | print(value); 29 | print(Clipboard.getData(Clipboard.kTextPlain)); 30 | if (value.isNotEmpty) { 31 | 32 | //自动跳转到下一个焦点 33 | FocusScope.of(context).nextFocus(); 34 | } 35 | if (value.isEmpty&&!isFirst) { 36 | //自动跳转到上一个焦点 37 | FocusScope.of(context).previousFocus(); 38 | } 39 | }, 40 | 41 | ), 42 | ); 43 | } 44 | } -------------------------------------------------------------------------------- /lib/app/widget/userAgreement.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../units/screenAdapter.dart'; 4 | 5 | class UserAgreement extends StatelessWidget { 6 | const UserAgreement({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | margin: EdgeInsets.only(top: ScreenAdapter.height(80)), 12 | child: Wrap( 13 | crossAxisAlignment:WrapCrossAlignment.center, 14 | children: [ 15 | Checkbox( 16 | activeColor: Colors.red, value: true, onChanged: (v) {}), 17 | const Text( 18 | "意阅读并同意"), 19 | const Text( 20 | "《商城用户协议》", 21 | style: TextStyle(color: Colors.red), 22 | ), 23 | const Text( 24 | "《商城用户协议》", 25 | style: TextStyle(color: Colors.red), 26 | ), 27 | const Text("《商城隐私协议》", style: TextStyle(color: Colors.red)), 28 | ], 29 | ), 30 | ); 31 | } 32 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * @Descripttion: 3 | * @version: 4 | * @Author: kiko 5 | * @Date: 2024-02-21 10:54:07 6 | * @LastEditors: kiko 7 | * @LastEditTime: 2024-02-22 16:48:16 8 | */ 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:get/get.dart'; 13 | 14 | import 'app/routes/app_pages.dart'; 15 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 16 | 17 | void main() { 18 | //配置透明的状态栏 19 | SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(statusBarColor: Colors.transparent); 20 | SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); 21 | 22 | 23 | runApp(ScreenUtilInit( 24 | designSize: const Size(1080, 2400), //设计稿的宽度和高度 px 25 | minTextAdapt: true, 26 | splitScreenMode: true, 27 | builder: (context, child) { 28 | return GetMaterialApp( 29 | debugShowCheckedModeBanner: false, 30 | title: "Application", 31 | initialRoute: AppPages.INITIAL, 32 | getPages: AppPages.routes, 33 | ); 34 | })); 35 | } 36 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import shared_preferences_foundation 9 | 10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 11 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 12 | } 13 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = kiko_getx_xmshop 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.kikoGetxXmshop 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: kiko_getx_xmshop 2 | version: 1.0.0+1 3 | publish_to: none 4 | description: A new Flutter project. 5 | environment: 6 | sdk: '>=3.1.6 <4.0.0' 7 | 8 | dependencies: 9 | cupertino_icons: ^1.0.2 10 | get: 4.6.6 11 | flutter_screenutil: ^5.5.4 #适配 12 | flutter_swiper_view: ^1.1.8 #轮播图 13 | dio: ^4.0.6 #网络请求 14 | flutter_staggered_grid_view: ^0.6.2 #瀑布流 15 | shared_preferences: ^2.0.15 #本地储存历史记录 16 | flutter_html: ^3.0.0-alpha.6 #html 17 | pin_code_fields: ^7.4.0 #验证码 18 | city_pickers: ^1.1.3 # 城市 19 | crypto: ^3.0.2 20 | tobias: ^2.4.1 #支付宝支付插件 21 | flutter: 22 | sdk: flutter 23 | 24 | dev_dependencies: 25 | flutter_lints: ^2.0.0 26 | flutter_test: 27 | sdk: flutter 28 | 29 | flutter: 30 | uses-material-design: true 31 | fonts: 32 | - family: MyIcon #指定一个字体名 根据自己的需求定义 33 | fonts: 34 | - asset: assets/fonts/iconfont.ttf 35 | - family: userIcon #指定一个字体名 根据自己的需求定义 36 | fonts: 37 | - asset: assets/fonts/userIconfont.ttf 38 | assets: 39 | - assets/images/xiaomiBanner.png 40 | - assets/images/2.0x/xiaomiBanner.png 41 | - assets/images/3.0x/xiaomiBanner.png 42 | - assets/images/xiaomiBanner2.png 43 | - assets/images/2.0x/xiaomiBanner2.png 44 | - assets/images/3.0x/xiaomiBanner2.png 45 | - assets/images/hot_search.png 46 | - assets/images/2.0x/hot_search.png 47 | - assets/images/3.0x/hot_search.png 48 | - assets/images/service.png 49 | - assets/images/2.0x/service.png 50 | - assets/images/3.0x/service.png 51 | - assets/images/user.png 52 | - assets/images/2.0x/user.png 53 | - assets/images/3.0x/user.png 54 | - assets/images/user_ad1.png 55 | - assets/images/2.0x/user_ad1.png 56 | - assets/images/3.0x/user_ad1.png 57 | - assets/images/user_ad2.png 58 | - assets/images/2.0x/user_ad2.png 59 | - assets/images/3.0x/user_ad2.png 60 | - assets/images/logo.png 61 | - assets/images/2.0x/logo.png 62 | - assets/images/3.0x/logo.png 63 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | kiko_getx_xmshop 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kiko_getx_xmshop", 3 | "short_name": "kiko_getx_xmshop", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"kiko_getx_xmshop", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web-kiko/flutter3_getx_shop/9b18185cf86ebbc37a7ab045a3fb87d41d3684b5/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length <= 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | --------------------------------------------------------------------------------