├── doc.sh ├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── my_application.h ├── .fvm ├── flutter_sdk └── fvm_config.json ├── ios ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── 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-1024x1024@1x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── Main.storyboard │ └── Info.plist ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── lib ├── common │ ├── api │ │ ├── index.dart │ │ └── wp │ │ │ └── user.dart │ ├── i18n │ │ ├── index.dart │ │ ├── locale_zh.dart │ │ ├── locale_en.dart │ │ ├── locale_keys.dart │ │ └── translation.dart │ ├── values │ │ ├── index.dart │ │ ├── constants.dart │ │ ├── images.dart │ │ └── svgs.dart │ ├── services │ │ ├── index.dart │ │ ├── user.dart │ │ └── config.dart │ ├── routers │ │ ├── index.dart │ │ ├── middlewares.dart │ │ ├── names.dart │ │ ├── observers.dart │ │ └── pages.dart │ ├── models │ │ ├── kv.dart │ │ ├── wp │ │ │ ├── wp_user_login_req.dart │ │ │ ├── wp_user_register_req.dart │ │ │ ├── wp_res.dart │ │ │ ├── wp_product_tags.dart │ │ │ ├── wp_product_attributes_items.dart │ │ │ ├── wp_user_login_res.dart │ │ │ ├── wp_product_attributes.dart │ │ │ ├── wp_product_categories.dart │ │ │ ├── wp_product_images.dart │ │ │ ├── wp_product_prices.dart │ │ │ ├── wp_user_profile_res.dart │ │ │ └── wp_product_reviews.dart │ │ └── index.dart │ ├── style │ │ ├── index.dart │ │ ├── radius.dart │ │ ├── theme.dart │ │ ├── space.dart │ │ ├── text.dart │ │ └── lib_color_schemes.g.dart │ ├── extension │ │ ├── ex_datetime.dart │ │ ├── index.dart │ │ ├── ex_color_scheme.dart │ │ ├── ex_icon.dart │ │ ├── ex_color.dart │ │ └── ex_string.dart │ ├── widgets │ │ ├── index.dart │ │ ├── icon.dart │ │ └── list_tile.dart │ ├── utils │ │ ├── index.dart │ │ ├── functions.dart │ │ ├── screen.dart │ │ ├── storage.dart │ │ ├── loading.dart │ │ └── bottom_sheet.dart │ ├── components │ │ ├── index.dart │ │ ├── slider_indicator.dart │ │ ├── quantity.dart │ │ ├── goods_item.dart │ │ ├── picker_datetime.dart │ │ └── picker_single.dart │ └── index.dart ├── pages │ ├── system │ │ ├── main │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── forgot │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── login │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── splash │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── register │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── welcome │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── register_pin │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ └── user_agreement │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ ├── styles │ │ ├── inputs │ │ │ ├── index.dart │ │ │ └── controller.dart │ │ ├── other │ │ │ ├── index.dart │ │ │ └── controller.dart │ │ ├── buttons │ │ │ ├── index.dart │ │ │ └── controller.dart │ │ ├── carousel │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── text_form │ │ │ ├── index.dart │ │ │ └── controller.dart │ │ ├── widgets │ │ │ └── index.dart │ │ ├── components │ │ │ ├── index.dart │ │ │ ├── controller.dart │ │ │ └── view.dart │ │ ├── group_list │ │ │ ├── index.dart │ │ │ └── view.dart │ │ └── bottom_sheet │ │ │ ├── index.dart │ │ │ └── controller.dart │ └── index.dart ├── global.dart └── main.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png └── manifest.json ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── 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 │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_woo_commerce_getx_ducafecat │ │ │ │ └── MainActivity.kt │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── macos ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_512.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcodeproj │ └── project.xcworkspace │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Podfile ├── assets ├── images │ ├── default.png │ ├── p-cash.png │ ├── p-visa.png │ ├── welcome.png │ ├── p-paypal.png │ ├── welcome_1.png │ ├── welcome_2.png │ ├── welcome_3.png │ ├── 2.0x │ │ ├── default.png │ │ ├── p-cash.png │ │ ├── p-visa.png │ │ ├── welcome.png │ │ ├── p-paypal.png │ │ ├── welcome_1.png │ │ ├── welcome_2.png │ │ ├── welcome_3.png │ │ ├── p-mastercard.png │ │ ├── order-confirmed.png │ │ └── profile-background.png │ ├── 3.0x │ │ ├── default.png │ │ ├── p-cash.png │ │ ├── p-visa.png │ │ ├── welcome.png │ │ ├── p-paypal.png │ │ ├── welcome_1.png │ │ ├── welcome_2.png │ │ ├── welcome_3.png │ │ ├── p-mastercard.png │ │ ├── order-confirmed.png │ │ └── profile-background.png │ ├── p-mastercard.png │ ├── order-confirmed.png │ ├── profile-background.png │ └── files.txt └── svgs │ ├── i-star.svg │ ├── i-subtract.svg │ ├── i-arrow-down.svg │ ├── i-close.svg │ ├── i-add.svg │ ├── i-arrow-back.svg │ ├── i-like.svg │ ├── i-arrow-right.svg │ ├── p-notifications.svg │ ├── i-arrow-bottom.svg │ ├── i-indicators.svg │ ├── i-arrow-left-up.svg │ ├── i-search.svg │ ├── i-add-friend.svg │ ├── facebook.svg │ ├── i-notifications.svg │ ├── p-home.svg │ ├── google.svg │ ├── p-delivery.svg │ ├── i-camera.svg │ ├── p-gift.svg │ ├── c-more.svg │ ├── p-currency.svg │ ├── i-trash.svg │ ├── c-woman.svg │ ├── c-home.svg │ ├── files.txt │ ├── c-man.svg │ ├── i-coupon.svg │ ├── nav-message.svg │ └── p-translate.svg ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── CMakeLists.txt │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── utils.cpp │ └── flutter_window.cpp ├── .gitignore └── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugin_registrant.cc │ └── generated_plugins.cmake ├── .metadata ├── dartdoc_options.yaml ├── .vscode └── launch.json ├── .gitignore ├── README.md ├── test └── widget_test.dart └── analysis_options.yaml /doc.sh: -------------------------------------------------------------------------------- 1 | dart pub global run dartdoc 2 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /.fvm/flutter_sdk: -------------------------------------------------------------------------------- 1 | /Users/ducafecat/.fvm/versions/2.10.3 -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/common/api/index.dart: -------------------------------------------------------------------------------- 1 | library api; 2 | 3 | export 'wp/user.dart'; 4 | -------------------------------------------------------------------------------- /.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "2.10.3", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /lib/pages/system/main/index.dart: -------------------------------------------------------------------------------- 1 | library main; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/web/favicon.png -------------------------------------------------------------------------------- /lib/common/i18n/index.dart: -------------------------------------------------------------------------------- 1 | library i18n; 2 | 3 | export './locale_keys.dart'; 4 | export './translation.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/styles/inputs/index.dart: -------------------------------------------------------------------------------- 1 | library inputs; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/styles/other/index.dart: -------------------------------------------------------------------------------- 1 | library other; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/forgot/index.dart: -------------------------------------------------------------------------------- 1 | library forgot; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/login/index.dart: -------------------------------------------------------------------------------- 1 | library login; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/splash/index.dart: -------------------------------------------------------------------------------- 1 | library splash; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /lib/pages/styles/buttons/index.dart: -------------------------------------------------------------------------------- 1 | library buttons; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/styles/carousel/index.dart: -------------------------------------------------------------------------------- 1 | library carousel; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/styles/text_form/index.dart: -------------------------------------------------------------------------------- 1 | library text_form; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/styles/widgets/index.dart: -------------------------------------------------------------------------------- 1 | library widgets; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/register/index.dart: -------------------------------------------------------------------------------- 1 | library register; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/welcome/index.dart: -------------------------------------------------------------------------------- 1 | library welcome; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /lib/pages/styles/components/index.dart: -------------------------------------------------------------------------------- 1 | library components; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/styles/group_list/index.dart: -------------------------------------------------------------------------------- 1 | library group_list; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /assets/images/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/default.png -------------------------------------------------------------------------------- /assets/images/p-cash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/p-cash.png -------------------------------------------------------------------------------- /assets/images/p-visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/p-visa.png -------------------------------------------------------------------------------- /assets/images/welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/welcome.png -------------------------------------------------------------------------------- /lib/common/values/index.dart: -------------------------------------------------------------------------------- 1 | library values; 2 | 3 | export 'constants.dart'; 4 | export 'svgs.dart'; 5 | export 'images.dart'; 6 | -------------------------------------------------------------------------------- /lib/pages/styles/bottom_sheet/index.dart: -------------------------------------------------------------------------------- 1 | library bottom_sheet; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/register_pin/index.dart: -------------------------------------------------------------------------------- 1 | library register_pin; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /lib/pages/system/user_agreement/index.dart: -------------------------------------------------------------------------------- 1 | library user_agreement; 2 | 3 | export './controller.dart'; 4 | export './view.dart'; 5 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /assets/images/p-paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/p-paypal.png -------------------------------------------------------------------------------- /assets/images/welcome_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/welcome_1.png -------------------------------------------------------------------------------- /assets/images/welcome_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/welcome_2.png -------------------------------------------------------------------------------- /assets/images/welcome_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/welcome_3.png -------------------------------------------------------------------------------- /lib/common/services/index.dart: -------------------------------------------------------------------------------- 1 | library services; 2 | 3 | export 'config.dart'; 4 | export 'user.dart'; 5 | export 'wp_http.dart'; 6 | -------------------------------------------------------------------------------- /assets/images/2.0x/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/default.png -------------------------------------------------------------------------------- /assets/images/2.0x/p-cash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/p-cash.png -------------------------------------------------------------------------------- /assets/images/2.0x/p-visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/p-visa.png -------------------------------------------------------------------------------- /assets/images/2.0x/welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/welcome.png -------------------------------------------------------------------------------- /assets/images/3.0x/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/default.png -------------------------------------------------------------------------------- /assets/images/3.0x/p-cash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/p-cash.png -------------------------------------------------------------------------------- /assets/images/3.0x/p-visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/p-visa.png -------------------------------------------------------------------------------- /assets/images/3.0x/welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/welcome.png -------------------------------------------------------------------------------- /assets/images/p-mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/p-mastercard.png -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /assets/images/2.0x/p-paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/p-paypal.png -------------------------------------------------------------------------------- /assets/images/2.0x/welcome_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/welcome_1.png -------------------------------------------------------------------------------- /assets/images/2.0x/welcome_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/welcome_2.png -------------------------------------------------------------------------------- /assets/images/2.0x/welcome_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/welcome_3.png -------------------------------------------------------------------------------- /assets/images/3.0x/p-paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/p-paypal.png -------------------------------------------------------------------------------- /assets/images/3.0x/welcome_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/welcome_1.png -------------------------------------------------------------------------------- /assets/images/3.0x/welcome_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/welcome_2.png -------------------------------------------------------------------------------- /assets/images/3.0x/welcome_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/welcome_3.png -------------------------------------------------------------------------------- /assets/images/order-confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/order-confirmed.png -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /assets/images/2.0x/p-mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/p-mastercard.png -------------------------------------------------------------------------------- /assets/images/3.0x/p-mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/p-mastercard.png -------------------------------------------------------------------------------- /assets/images/2.0x/order-confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/order-confirmed.png -------------------------------------------------------------------------------- /assets/images/3.0x/order-confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/order-confirmed.png -------------------------------------------------------------------------------- /assets/images/profile-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/profile-background.png -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /assets/images/2.0x/profile-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/2.0x/profile-background.png -------------------------------------------------------------------------------- /assets/images/3.0x/profile-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/assets/images/3.0x/profile-background.png -------------------------------------------------------------------------------- /lib/common/routers/index.dart: -------------------------------------------------------------------------------- 1 | library routers; 2 | 3 | export 'names.dart'; 4 | export 'pages.dart'; 5 | export 'middlewares.dart'; 6 | export 'observers.dart'; 7 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /lib/common/models/kv.dart: -------------------------------------------------------------------------------- 1 | /// key value 键值对 2 | class KeyValueModel { 3 | String key; 4 | T? value; 5 | 6 | KeyValueModel({required this.key, this.value}); 7 | } 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/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/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /lib/common/style/index.dart: -------------------------------------------------------------------------------- 1 | library style; 2 | 3 | export 'colors.dart'; 4 | export 'lib_color_schemes.g.dart'; 5 | export 'radius.dart'; 6 | export 'space.dart'; 7 | export 'text.dart'; 8 | export 'theme.dart'; 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codertiany/flutter_woo_commerce_getx_ducafecat/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/svgs/i-star.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_woo_commerce_getx_ducafecat/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_woo_commerce_getx_ducafecat 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /lib/common/extension/ex_datetime.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | /// 扩展日期时间 4 | extension ExDateTime on DateTime { 5 | /// 格式化日期到字符串 yyyy-MM-dd 6 | String toDateString({String format = 'yyyy-MM-dd'}) => 7 | DateFormat(format).format(this); 8 | } 9 | -------------------------------------------------------------------------------- /lib/common/extension/index.dart: -------------------------------------------------------------------------------- 1 | library extension; 2 | 3 | export 'ex_color.dart'; 4 | export 'ex_icon.dart'; 5 | export 'ex_list.dart'; 6 | export 'ex_string.dart'; 7 | export 'ex_widget.dart'; 8 | export 'ex_datetime.dart'; 9 | export 'ex_color_scheme.dart'; 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/common/widgets/index.dart: -------------------------------------------------------------------------------- 1 | library widgets; 2 | 3 | export 'button.dart'; 4 | export 'checkbox.dart'; 5 | export 'group_list.dart'; 6 | export 'icon.dart'; 7 | export 'image.dart'; 8 | export 'input.dart'; 9 | export 'list_tile.dart'; 10 | 11 | export 'text.dart'; 12 | export 'text_form.dart'; 13 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/common/style/radius.dart: -------------------------------------------------------------------------------- 1 | /// 圆角定义 2 | class AppRadius { 3 | /// 按钮圆角 4 | static double get button => 6; 5 | 6 | /// 按钮 文字填充圆角 7 | static double get buttonTextFilled => 3; 8 | 9 | /// 卡片圆角 10 | static double get card => 5; 11 | 12 | /// 卡片圆角 13 | static double get input => 5; 14 | } 15 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/svgs/i-subtract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/common/utils/index.dart: -------------------------------------------------------------------------------- 1 | library utils; 2 | 3 | export 'bottom_sheet.dart'; 4 | export 'convert.dart'; 5 | export 'dialog.dart'; 6 | export 'functions.dart'; 7 | export 'loading.dart'; 8 | export 'privilege.dart'; 9 | export 'picker.dart'; 10 | export 'privilege.dart'; 11 | export 'screen.dart'; 12 | export 'storage.dart'; 13 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.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: 097d3313d8e2c7f901932d63e537c1acefb87800 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/svgs/i-arrow-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/components/index.dart: -------------------------------------------------------------------------------- 1 | library components; 2 | 3 | export './carousel.dart'; 4 | export './goods_item.dart'; 5 | export './picker_datetime.dart'; 6 | export './picker_image.dart'; 7 | export './picker_single.dart'; 8 | export './price_range.dart'; 9 | export './quantity.dart'; 10 | export './slider_indicator.dart'; 11 | export './steps.dart'; 12 | -------------------------------------------------------------------------------- /lib/common/style/theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'index.dart'; 4 | 5 | /// 主题 6 | class AppTheme { 7 | /// 亮色 8 | static ThemeData light = ThemeData( 9 | colorScheme: lightColorScheme, 10 | ); 11 | 12 | /// 暗色 13 | static ThemeData dark = ThemeData( 14 | colorScheme: darkColorScheme, 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /assets/svgs/i-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /lib/common/index.dart: -------------------------------------------------------------------------------- 1 | library common; 2 | 3 | export 'api/index.dart'; 4 | export 'components/index.dart'; 5 | export 'extension/index.dart'; 6 | export 'i18n/index.dart'; 7 | export 'models/index.dart'; 8 | export 'routers/index.dart'; 9 | export 'services/index.dart'; 10 | export 'style/index.dart'; 11 | export 'utils/index.dart'; 12 | export 'values/index.dart'; 13 | export 'widgets/index.dart'; 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/common/extension/ex_color_scheme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 扩展 ColorScheme 4 | extension ExColorScheme on ColorScheme { 5 | get isDark => brightness == Brightness.dark; 6 | 7 | /// 按钮 8 | Color get button => 9 | isDark ? const Color(0xFFB0C5FF) : const Color(0xFF5F84FF); 10 | 11 | /// 强调色 12 | Color get highlight => 13 | isDark ? const Color(0xFFFFB4A9) : const Color(0xFFF77866); 14 | } 15 | -------------------------------------------------------------------------------- /assets/svgs/i-add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/utils/functions.dart: -------------------------------------------------------------------------------- 1 | class Funs { 2 | static String imageResize( 3 | String url, { 4 | double width = 300, 5 | double? maxHeight, 6 | }) { 7 | var crop = ''; 8 | int _width = width.toInt(); 9 | int? _maxHeight = maxHeight?.toInt(); 10 | 11 | if (maxHeight != null) { 12 | crop = '/crop,h_$_maxHeight,g_center'; 13 | } 14 | return url + '?x-oss-process=image/resize,w_$_width,m_lfit$crop'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /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 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 14 | } 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 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 | -------------------------------------------------------------------------------- /lib/common/routers/middlewares.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../services/index.dart'; 5 | import 'index.dart'; 6 | 7 | class RouteAuthMiddleware extends GetMiddleware { 8 | RouteAuthMiddleware({int? priority}); 9 | 10 | @override 11 | RouteSettings? redirect(String? route) { 12 | if (UserService.to.isLogin) { 13 | return null; 14 | } 15 | return const RouteSettings(name: RouteNames.login); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/svgs/i-arrow-back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_user_login_req.dart: -------------------------------------------------------------------------------- 1 | class WpUserLoginReq { 2 | String? username; 3 | String? password; 4 | 5 | WpUserLoginReq({this.username, this.password}); 6 | 7 | factory WpUserLoginReq.fromJson(Map json) { 8 | return WpUserLoginReq( 9 | username: json['username'] as String?, 10 | password: json['password'] as String?, 11 | ); 12 | } 13 | 14 | Map toJson() => { 15 | 'username': username, 16 | 'password': password, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /assets/svgs/i-like.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/svgs/i-arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /assets/svgs/p-notifications.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/i-arrow-bottom.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/i-indicators.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | permission_handler_windows 7 | ) 8 | 9 | set(PLUGIN_BUNDLED_LIBRARIES) 10 | 11 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 12 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 13 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 15 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 16 | endforeach(plugin) 17 | -------------------------------------------------------------------------------- /lib/pages/system/login/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class LoginController extends GetxController { 4 | LoginController(); 5 | 6 | _initData() { 7 | update(["login"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/system/main/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class MainController extends GetxController { 4 | MainController(); 5 | 6 | _initData() { 7 | update(["main"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/system/forgot/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class ForgotController extends GetxController { 4 | ForgotController(); 5 | 6 | _initData() { 7 | update(["forgot"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/system/splash/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class SplashController extends GetxController { 4 | SplashController(); 5 | 6 | _initData() { 7 | update(["splash"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/common/utils/screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Screen { 6 | static MediaQueryData get mediaQuery => MediaQueryData.fromWindow(window); 7 | 8 | /// 获取屏幕宽度 9 | static double get width => mediaQuery.size.width; 10 | 11 | /// 获取屏幕高度 12 | static double get height => mediaQuery.size.height; 13 | 14 | /// 获取屏幕dp比例 15 | static double get scale => mediaQuery.devicePixelRatio; 16 | 17 | /// 获取顶部安全区域 18 | static double get statusBar => mediaQuery.padding.top; 19 | 20 | /// 获取底部安全区域 21 | static double get bottomBar => mediaQuery.padding.bottom; 22 | } 23 | -------------------------------------------------------------------------------- /lib/pages/styles/buttons/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class ButtonsController extends GetxController { 4 | ButtonsController(); 5 | 6 | _initData() { 7 | update(["buttons"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/system/welcome/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class WelcomeController extends GetxController { 4 | WelcomeController(); 5 | 6 | _initData() { 7 | update(["welcome"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/common/values/constants.dart: -------------------------------------------------------------------------------- 1 | /// 常量 2 | class Constants { 3 | // wp 服务器 4 | // static const wpApiBaseUrl = 'https://yapi.ducafecat.tech/mock/38/wp-json'; 5 | // static const wpApiBaseUrl = 'http://192.168.0.122/wp-json'; 6 | static const wpApiBaseUrl = 'http://10.131.99.77/wp-json'; 7 | 8 | // 本地存储key 9 | static const storageFirstOpen = 'first_open'; 10 | static const storageProfile = 'profile'; 11 | static const storageCategories = 'categories'; 12 | static const storageLanguageCode = 'language_code'; 13 | static const storageToken = 'token'; 14 | static const storageSearchHistory = 'search_history'; 15 | } 16 | -------------------------------------------------------------------------------- /lib/pages/system/register/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class RegisterController extends GetxController { 4 | RegisterController(); 5 | 6 | _initData() { 7 | update(["register"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_user_register_req.dart: -------------------------------------------------------------------------------- 1 | class WpUseRegisterReq { 2 | String? username; 3 | String? email; 4 | String? password; 5 | 6 | WpUseRegisterReq({this.username, this.email, this.password}); 7 | 8 | factory WpUseRegisterReq.fromJson(Map json) { 9 | return WpUseRegisterReq( 10 | username: json['username'] as String?, 11 | email: json['email'] as String?, 12 | password: json['password'] as String?, 13 | ); 14 | } 15 | 16 | Map toJson() => { 17 | 'username': username, 18 | 'email': email, 19 | 'password': password, 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /lib/common/i18n/locale_zh.dart: -------------------------------------------------------------------------------- 1 | import "locale_keys.dart"; 2 | 3 | Map localeZh = { 4 | // 通用 5 | LocaleKeys.commonBottomRemove: "删除", 6 | LocaleKeys.commonBottomCancel: "取消", 7 | LocaleKeys.commonBottomConfirm: "确认", 8 | LocaleKeys.commonBottomApply: "应用", 9 | LocaleKeys.commonSelectTips: "请选择", 10 | LocaleKeys.commonLangCodeZh: "中文", 11 | LocaleKeys.commonLangCodeEn: "英文", 12 | 13 | // 样式 14 | LocaleKeys.stylePageTitle: "样式&功能&调试", 15 | 16 | // 弹窗提示 17 | LocaleKeys.dialogRemove: "您确定删除吗?", 18 | 19 | // 拍照、相册 20 | LocaleKeys.pickerTakeCamera: "拍照", 21 | LocaleKeys.pickerSelectAlbum: "从相册中选取", 22 | }; 23 | -------------------------------------------------------------------------------- /lib/pages/system/register_pin/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class RegisterPinController extends GetxController { 4 | RegisterPinController(); 5 | 6 | _initData() { 7 | update(["register_pin"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/system/user_agreement/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class UserAgreementController extends GetxController { 4 | UserAgreementController(); 5 | 6 | _initData() { 7 | update(["user_agreement"]); 8 | } 9 | 10 | void onTap() {} 11 | 12 | // @override 13 | // void onInit() { 14 | // super.onInit(); 15 | // } 16 | 17 | @override 18 | void onReady() { 19 | super.onReady(); 20 | _initData(); 21 | } 22 | 23 | // @override 24 | // void onClose() { 25 | // super.onClose(); 26 | // } 27 | 28 | // @override 29 | // void dispose() { 30 | // super.dispose(); 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /assets/svgs/i-arrow-left-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/i-search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /lib/common/models/index.dart: -------------------------------------------------------------------------------- 1 | library models; 2 | 3 | /// common 4 | export 'kv.dart'; 5 | 6 | /// wp/wp_product 7 | 8 | export 'wp/wp_product.dart'; 9 | export 'wp/wp_product_attributes.dart'; 10 | export 'wp/wp_product_attributes_items.dart'; 11 | export 'wp/wp_product_categories.dart'; 12 | export 'wp/wp_product_images.dart'; 13 | export 'wp/wp_product_prices.dart'; 14 | export 'wp/wp_product_reviews.dart'; 15 | export 'wp/wp_product_tags.dart'; 16 | 17 | /// wp 18 | 19 | export 'wp/wp_res.dart'; 20 | export 'wp/wp_user_login_req.dart'; 21 | export 'wp/wp_user_login_res.dart'; 22 | export 'wp/wp_user_profile_res.dart'; 23 | export 'wp/wp_user_register_req.dart'; 24 | -------------------------------------------------------------------------------- /lib/pages/system/login/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class LoginPage extends GetView { 7 | const LoginPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return Container(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: LoginController(), 17 | id: "login", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/pages/system/forgot/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class ForgotPage extends GetView { 7 | const ForgotPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return Container(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: ForgotController(), 17 | id: "forgot", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/common/extension/ex_icon.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 扩展 Icon 4 | extension ExIcon on T { 5 | T copyWith({ 6 | double? size, 7 | Color? color, 8 | String? semanticLabel, 9 | TextDirection? textDirection, 10 | }) => 11 | Icon( 12 | icon, 13 | color: color ?? this.color, 14 | size: size ?? this.size, 15 | semanticLabel: semanticLabel ?? this.semanticLabel, 16 | textDirection: textDirection ?? this.textDirection, 17 | ) as T; 18 | 19 | /// 尺寸 20 | T iconSize(double size) => copyWith(size: size); 21 | 22 | /// 颜色 23 | T iconColor(Color color) => copyWith(color: color); 24 | } 25 | -------------------------------------------------------------------------------- /lib/pages/system/welcome/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class WelcomePage extends GetView { 7 | const WelcomePage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return Container(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: WelcomeController(), 17 | id: "welcome", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/pages/system/main/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class MainPage extends GetView { 7 | const MainPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return const Center(child: Text("MainPage")); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: MainController(), 17 | id: "main", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | # categories: 3 | # "First Category": 4 | # markdown: doc/First.md 5 | # name: Awesome 6 | # "Second Category": 7 | # markdown: doc/Second.md 8 | # name: Great 9 | # categoryOrder: ["First Category", "Second Category"] 10 | # examplePathPrefix: "subdir/with/examples" 11 | # includeExternal: ["bin/unusually_located_library.dart"] 12 | nodoc: ["lib/pages/**/*.dart"] 13 | # linkTo: 14 | # url: "https://my.dartdocumentationsite.org/dev/%v%" 15 | # showUndocumentedCategories: true 16 | # ignore: 17 | # - ambiguous-doc-reference 18 | # errors: 19 | # - unresolved-doc-reference 20 | # warnings: 21 | # - tool-error 22 | -------------------------------------------------------------------------------- /lib/pages/system/register/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class RegisterPage extends GetView { 7 | const RegisterPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return Container(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: RegisterController(), 17 | id: "register", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "flutter_woo_commerce_getx_ducafecat", 9 | "request": "launch", 10 | "type": "dart" 11 | }, 12 | { 13 | "name": "flutter_woo_commerce_getx_ducafecat (profile mode)", 14 | "request": "launch", 15 | "type": "dart", 16 | "flutterMode": "profile" 17 | }, 18 | { 19 | "name": "flutter_woo_commerce_getx_ducafecat (release mode)", 20 | "request": "launch", 21 | "type": "dart", 22 | "flutterMode": "release" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /assets/images/files.txt: -------------------------------------------------------------------------------- 1 | static const defaultPng = 'assets/images/default.png'; 2 | static const orderConfirmedPng = 'assets/images/order-confirmed.png'; 3 | static const pCashPng = 'assets/images/p-cash.png'; 4 | static const pMastercardPng = 'assets/images/p-mastercard.png'; 5 | static const pPaypalPng = 'assets/images/p-paypal.png'; 6 | static const pVisaPng = 'assets/images/p-visa.png'; 7 | static const profileBackgroundPng = 'assets/images/profile-background.png'; 8 | static const welcomePng = 'assets/images/welcome.png'; 9 | static const welcome_1Png = 'assets/images/welcome_1.png'; 10 | static const welcome_2Png = 'assets/images/welcome_2.png'; 11 | static const welcome_3Png = 'assets/images/welcome_3.png'; 12 | -------------------------------------------------------------------------------- /lib/pages/system/register_pin/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class RegisterPinPage extends GetView { 7 | const RegisterPinPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return Container(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: RegisterPinController(), 17 | id: "register_pin", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/common/i18n/locale_en.dart: -------------------------------------------------------------------------------- 1 | import "locale_keys.dart"; 2 | 3 | Map localeEn = { 4 | // 通用 5 | LocaleKeys.commonBottomRemove: "Remove", 6 | LocaleKeys.commonBottomCancel: "Cancel", 7 | LocaleKeys.commonBottomConfirm: "Confirm", 8 | LocaleKeys.commonBottomApply: "Apply", 9 | LocaleKeys.commonSelectTips: "Please select", 10 | LocaleKeys.commonLangCodeZh: "Chinese", 11 | LocaleKeys.commonLangCodeEn: "English", 12 | 13 | // 样式 14 | LocaleKeys.stylePageTitle: "style & function & debug", 15 | 16 | // 弹窗提示 17 | LocaleKeys.dialogRemove: "Are you sure to remove?", 18 | 19 | // 拍照、相册 20 | LocaleKeys.pickerTakeCamera: "Take camera", 21 | LocaleKeys.pickerSelectAlbum: "Select from album", 22 | }; 23 | -------------------------------------------------------------------------------- /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 = flutter_woo_commerce_getx_ducafecat 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWooCommerceGetxDucafecat 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/pages/system/splash/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class SplashPage extends GetView { 7 | const SplashPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return const Center( 11 | child: Text("SplashPage"), 12 | ); 13 | } 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GetBuilder( 18 | init: SplashController(), 19 | id: "splash", 20 | builder: (_) { 21 | return Scaffold( 22 | body: SafeArea( 23 | child: _buildView(), 24 | ), 25 | ); 26 | }, 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/pages/system/user_agreement/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'index.dart'; 5 | 6 | class UserAgreementPage extends GetView { 7 | const UserAgreementPage({Key? key}) : super(key: key); 8 | 9 | Widget _buildView() { 10 | return Container(); 11 | } 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: UserAgreementController(), 17 | id: "user_agreement", 18 | builder: (_) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: _buildView(), 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /assets/svgs/i-add-friend.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/i18n/locale_keys.dart: -------------------------------------------------------------------------------- 1 | class LocaleKeys { 2 | // 通用 3 | static const commonBottomRemove = "common_bottom_remove"; 4 | static const commonBottomCancel = "common_bottom_cancel"; 5 | static const commonBottomConfirm = "common_bottom_confirm"; 6 | static const commonBottomApply = "common_bottom_apply"; 7 | static const commonSelectTips = "common_select_tips"; 8 | static const commonLangCodeZh = "zh"; 9 | static const commonLangCodeEn = "en"; 10 | 11 | // 样式 12 | static const stylePageTitle = "style_page_title"; 13 | 14 | // 弹窗提示 15 | static const dialogRemove = "DIALOG_REMOVE"; 16 | 17 | // 拍照、相册 18 | static const pickerTakeCamera = "picker_take_camera"; 19 | static const pickerSelectAlbum = "picker_select_album"; 20 | } 21 | -------------------------------------------------------------------------------- /lib/pages/styles/inputs/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class InputsController extends GetxController { 4 | InputsController(); 5 | 6 | bool checkVal = true; 7 | void onCheckBox(bool val) { 8 | checkVal = val; 9 | update(["inputs"]); 10 | } 11 | 12 | _initData() { 13 | update(["inputs"]); 14 | } 15 | 16 | void onTap() {} 17 | 18 | // @override 19 | // void onInit() { 20 | // super.onInit(); 21 | // } 22 | 23 | @override 24 | void onReady() { 25 | super.onReady(); 26 | _initData(); 27 | } 28 | 29 | // @override 30 | // void onClose() { 31 | // super.onClose(); 32 | // } 33 | 34 | // @override 35 | // void dispose() { 36 | // super.dispose(); 37 | // } 38 | } 39 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/common/values/images.dart: -------------------------------------------------------------------------------- 1 | class AssetsImages { 2 | static const defaultPng = 'assets/images/default.png'; 3 | static const orderConfirmedPng = 'assets/images/order-confirmed.png'; 4 | static const pCashPng = 'assets/images/p-cash.png'; 5 | static const pMastercardPng = 'assets/images/p-mastercard.png'; 6 | static const pPaypalPng = 'assets/images/p-paypal.png'; 7 | static const pVisaPng = 'assets/images/p-visa.png'; 8 | static const profileBackgroundPng = 'assets/images/profile-background.png'; 9 | static const welcomePng = 'assets/images/welcome.png'; 10 | static const welcome_1Png = 'assets/images/welcome_1.png'; 11 | static const welcome_2Png = 'assets/images/welcome_2.png'; 12 | static const welcome_3Png = 'assets/images/welcome_3.png'; 13 | } 14 | -------------------------------------------------------------------------------- /assets/svgs/i-notifications.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/pages/index.dart: -------------------------------------------------------------------------------- 1 | library pages; 2 | 3 | // 样式调试 4 | export 'styles/widgets/index.dart'; 5 | export 'styles/buttons/index.dart'; 6 | export 'styles/inputs/index.dart'; 7 | export 'styles/group_list/index.dart'; 8 | export 'styles/text_form/index.dart'; 9 | export 'styles/other/index.dart'; 10 | export 'styles/components/index.dart'; 11 | export 'styles/bottom_sheet/index.dart'; 12 | export 'styles/carousel/index.dart'; 13 | 14 | // 引导欢迎 15 | export 'system/splash/index.dart'; 16 | export 'system/welcome/index.dart'; 17 | 18 | // 注册登录 19 | export 'system/login/index.dart'; 20 | export 'system/register/index.dart'; 21 | export 'system/register_pin/index.dart'; 22 | export 'system/forgot/index.dart'; 23 | export 'system/user_agreement/index.dart'; 24 | 25 | // 主界面 26 | export 'system/main/index.dart'; 27 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import package_info 9 | import path_provider_macos 10 | import photo_manager 11 | import shared_preferences_macos 12 | import sqflite 13 | 14 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 15 | FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) 16 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 17 | ImageScannerPlugin.register(with: registry.registrar(forPlugin: "ImageScannerPlugin")) 18 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 19 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 20 | } 21 | -------------------------------------------------------------------------------- /lib/common/extension/ex_color.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 扩展颜色 4 | extension ExColor on Color { 5 | /// 生成 MaterialColor 色阶表 6 | MaterialColor get materialColor { 7 | List strengths = [.05]; 8 | Map swatch = {}; 9 | final int r = red, g = green, b = blue; 10 | 11 | for (int i = 1; i < 10; i++) { 12 | strengths.add(0.1 * i); 13 | } 14 | for (var strength in strengths) { 15 | final double ds = 0.5 - strength; 16 | swatch[(strength * 1000).round()] = Color.fromRGBO( 17 | r + ((ds < 0 ? r : (255 - r)) * ds).round(), 18 | g + ((ds < 0 ? g : (255 - g)) * ds).round(), 19 | b + ((ds < 0 ? b : (255 - b)) * ds).round(), 20 | 1, 21 | ); 22 | } 23 | return MaterialColor(value, swatch); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/common/style/space.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 间距 4 | class AppSpace { 5 | /// 按钮 6 | static double get button => 5; 7 | 8 | /// 卡片内 - 12 上下左右 9 | static double get card => 12; 10 | 11 | /// 输入框 - 10, 10 上下,左右 12 | static EdgeInsetsGeometry get edgeInput => 13 | const EdgeInsets.symmetric(vertical: 10, horizontal: 10); 14 | 15 | /// 列表行 - 10 上下 16 | static double get listRow => 10; 17 | 18 | /// 列表项 19 | static double get listItem => 5; 20 | 21 | /// 页面内 - 16 左右 22 | static double get page => 16; 23 | 24 | /// 段落 - 24 25 | static double get paragraph => 24; 26 | 27 | /// 标题内容 - 10 28 | static double get titleContent => 10; 29 | 30 | /// 图标文字 - 15 31 | static double get iconTextSmail => 5; 32 | static double get iconTextMedium => 10; 33 | static double get iconTextLarge => 15; 34 | } 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 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/common/routers/names.dart: -------------------------------------------------------------------------------- 1 | class RouteNames { 2 | // 样式调试 3 | static const styleWidgets = '/style_widgets'; 4 | static const styleButtons = '/style_buttons'; 5 | static const styleInputs = '/style_inputs'; 6 | static const styleTextForm = '/style_text_form'; 7 | static const styleGroupList = '/style_group_list'; 8 | static const styleOther = '/style_other'; 9 | static const styleComponents = '/style_components'; 10 | static const styleBottomSheet = '/style_bottom_sheet'; 11 | static const styleCarousel = '/style_carousel'; 12 | 13 | // 系统 system 14 | static const splash = '/splash'; 15 | static const welcome = '/welcome'; 16 | static const login = '/login'; 17 | static const register = '/register'; 18 | static const registerPin = '/register_pin'; 19 | static const forgot = '/forgot'; 20 | static const userAgreement = '/user_agreement'; 21 | static const main = '/'; 22 | } 23 | -------------------------------------------------------------------------------- /lib/pages/styles/text_form/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class TextFormController extends GetxController { 5 | TextFormController(); 6 | 7 | GlobalKey formKey = GlobalKey(); 8 | 9 | TextEditingController unameController = 10 | TextEditingController(text: "hans001"); 11 | TextEditingController pwdController = TextEditingController(text: "123456"); 12 | 13 | _initData() { 14 | update(["text_form"]); 15 | } 16 | 17 | void onTap() {} 18 | 19 | // @override 20 | // void onInit() { 21 | // super.onInit(); 22 | // } 23 | 24 | @override 25 | void onReady() { 26 | super.onReady(); 27 | _initData(); 28 | } 29 | 30 | // @override 31 | // void onClose() { 32 | // super.onClose(); 33 | // } 34 | 35 | // @override 36 | // void dispose() { 37 | // super.dispose(); 38 | // } 39 | } 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /lib/common/api/wp/user.dart: -------------------------------------------------------------------------------- 1 | import '../../models/index.dart'; 2 | import '../../services/index.dart'; 3 | 4 | class UserAPIs { 5 | static Future login(WpUserLoginReq req) async { 6 | var res = await WPHttpService.to.post( 7 | '/jwt-auth/v1/token', 8 | data: req, 9 | ); 10 | return WpUserLoginRes.fromJson(res); 11 | } 12 | 13 | static Future register(WpUseRegisterReq req) async { 14 | var res = await WPHttpService.to.post( 15 | '/wp/v2/users/register', 16 | data: req, 17 | ); 18 | return WpRes.fromJson(res); 19 | } 20 | 21 | static Future profile() async { 22 | var res = await WPHttpService.to.post( 23 | '/wp/v2/users/me', 24 | ); 25 | return WpUserProfileRes.fromJson(res); 26 | } 27 | 28 | // static Future logout() async { 29 | // return WPHttpService.to.post( 30 | // '/app/logout', 31 | // ); 32 | // } 33 | } 34 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_res.dart: -------------------------------------------------------------------------------- 1 | class WpRes { 2 | String? code; 3 | String? message; 4 | WpDataRes? data; 5 | 6 | WpRes({this.code, this.message, this.data}); 7 | 8 | factory WpRes.fromJson(Map json) => WpRes( 9 | code: json['code'].toString(), 10 | message: json['message'] as String?, 11 | data: json['data'] == null 12 | ? null 13 | : WpDataRes.fromJson(json['data'] as Map), 14 | ); 15 | 16 | Map toJson() => { 17 | 'code': code, 18 | 'message': message, 19 | 'data': data?.toJson(), 20 | }; 21 | } 22 | 23 | class WpDataRes { 24 | int? status; 25 | 26 | WpDataRes({this.status}); 27 | 28 | factory WpDataRes.fromJson(Map json) => WpDataRes( 29 | status: json['status'] as int?, 30 | ); 31 | 32 | Map toJson() => { 33 | 'status': status, 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/svgs/p-home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/extension/ex_string.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 扩展 String 4 | extension ExString on String { 5 | /// 生成 Color 6 | Color get toColor { 7 | return Color(int.parse(this, radix: 16) | 0xFF000000); 8 | } 9 | 10 | /// 生成 MaterialColor 11 | Color get toMaterialColor { 12 | Color color = toColor; 13 | 14 | List strengths = [.05]; 15 | Map swatch = {}; 16 | final int r = color.red, g = color.green, b = color.blue; 17 | 18 | for (int i = 1; i < 10; i++) { 19 | strengths.add(0.1 * i); 20 | } 21 | for (var strength in strengths) { 22 | final double ds = 0.5 - strength; 23 | swatch[(strength * 1000).round()] = Color.fromRGBO( 24 | r + ((ds < 0 ? r : (255 - r)) * ds).round(), 25 | g + ((ds < 0 ? g : (255 - g)) * ds).round(), 26 | b + ((ds < 0 ? b : (255 - b)) * ds).round(), 27 | 1, 28 | ); 29 | } 30 | return MaterialColor(color.value, swatch); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_tags.dart: -------------------------------------------------------------------------------- 1 | /// id : 18 2 | /// name : "GetX" 3 | /// slug : "getx" 4 | /// description : "" 5 | /// parent : 0 6 | /// count : 1 7 | 8 | class WpProductTags { 9 | WpProductTags({ 10 | this.id, 11 | this.name, 12 | this.slug, 13 | this.description, 14 | this.parent, 15 | this.count, 16 | }); 17 | 18 | WpProductTags.fromJson(dynamic json) { 19 | id = json['id']; 20 | name = json['name']; 21 | slug = json['slug']; 22 | description = json['description']; 23 | parent = json['parent']; 24 | count = json['count']; 25 | } 26 | int? id; 27 | String? name; 28 | String? slug; 29 | String? description; 30 | int? parent; 31 | int? count; 32 | 33 | Map toJson() { 34 | final map = {}; 35 | map['id'] = id; 36 | map['name'] = name; 37 | map['slug'] = slug; 38 | map['description'] = description; 39 | map['parent'] = parent; 40 | map['count'] = count; 41 | return map; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter woo commerce getx 电商客户端 2 | 3 | ## 代码规范 4 | 5 | - `common` 目录下相对目录引用,这样以后复制了,能重用。 6 | 7 | ```sh 8 | import '../extension/index.dart'; 9 | import '../style/index.dart'; 10 | import 'index.dart'; 11 | ``` 12 | 13 | - `flutter_screenutil` 只在 `pages` 层使用,不要写入基础组件,比如 `widget` `button` ,否则写的到处都是很乱。 14 | 15 | - 16 | 17 | ## 初始包 18 | 19 | ```sh 20 | flutter pub add get intl flutter_screenutil pull_to_refresh flutter_easyloading modal_bottom_sheet dio dio_cookie_manager cookie_jar cached_network_image flutter_cache_manager crypto share device_info package_info permission_handler sentry carousel_slider flutter_svg validatorless flutter_multi_formatter pinput flutter_picker another_xlider photo_view wechat_assets_picker wechat_camera_picker country_code_picker dropdown_button2 shared_preferences 21 | ``` 22 | 23 | ## 生成文档 24 | 25 | https://pub.flutter-io.cn/packages/dartdoc 26 | 27 | ```sh 28 | $ dart pub global activate dartdoc 29 | $ dart pub global run dartdoc 30 | 31 | 32 | $ dart pub global activate dhttpd 33 | $ dhttpd --path doc/api 34 | ``` 35 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_attributes_items.dart: -------------------------------------------------------------------------------- 1 | /// id : 32 2 | /// name : "l" 3 | /// slug : "l" 4 | /// description : "" 5 | /// parent : 0 6 | /// count : 2 7 | 8 | class WpProductAttributesItems { 9 | WpProductAttributesItems({ 10 | this.id, 11 | this.name, 12 | this.slug, 13 | this.description, 14 | this.parent, 15 | this.count, 16 | }); 17 | 18 | WpProductAttributesItems.fromJson(dynamic json) { 19 | id = json['id']; 20 | name = json['name']; 21 | slug = json['slug']; 22 | description = json['description']; 23 | parent = json['parent']; 24 | count = json['count']; 25 | } 26 | int? id; 27 | String? name; 28 | String? slug; 29 | String? description; 30 | int? parent; 31 | int? count; 32 | 33 | Map toJson() { 34 | final map = {}; 35 | map['id'] = id; 36 | map['name'] = name; 37 | map['slug'] = slug; 38 | map['description'] = description; 39 | map['parent'] = parent; 40 | map['count'] = count; 41 | return map; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/svgs/google.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/p-delivery.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_woo_commerce_getx_ducafecat", 3 | "short_name": "flutter_woo_commerce_getx_ducafecat", 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 | -------------------------------------------------------------------------------- /lib/pages/styles/components/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class ComponentsController extends GetxController { 5 | ComponentsController(); 6 | 7 | WpProduct product = WpProduct( 8 | name: 9 | "Amazon Basics Kids Unicorns & Rainbows Patterned Throw Blanket with Stuffed Animal Unicorn", 10 | images: [ 11 | WpProductionImages( 12 | thumbnail: 13 | "https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/e12b8a142351704bf95cce1ec78936d6.jpg", 14 | ), 15 | ], 16 | prices: WpProductPrices(salePrice: "99.99"), 17 | ); 18 | 19 | _initData() { 20 | update(["components"]); 21 | } 22 | 23 | void onTap() {} 24 | 25 | // @override 26 | // void onInit() { 27 | // super.onInit(); 28 | // } 29 | 30 | @override 31 | void onReady() { 32 | super.onReady(); 33 | _initData(); 34 | } 35 | 36 | // @override 37 | // void onClose() { 38 | // super.onClose(); 39 | // } 40 | 41 | // @override 42 | // void dispose() { 43 | // super.dispose(); 44 | // } 45 | } 46 | -------------------------------------------------------------------------------- /lib/common/utils/storage.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class Storage { 4 | static final Storage _instance = Storage._internal(); 5 | factory Storage() => _instance; 6 | late final SharedPreferences _prefs; 7 | 8 | Storage._internal(); 9 | 10 | Future init() async { 11 | _prefs = await SharedPreferences.getInstance(); 12 | } 13 | 14 | Future setString(String key, String value) async { 15 | return await _prefs.setString(key, value); 16 | } 17 | 18 | Future setBool(String key, bool value) async { 19 | return await _prefs.setBool(key, value); 20 | } 21 | 22 | Future setList(String key, List value) async { 23 | return await _prefs.setStringList(key, value); 24 | } 25 | 26 | String getString(String key) { 27 | return _prefs.getString(key) ?? ''; 28 | } 29 | 30 | bool getBool(String key) { 31 | return _prefs.getBool(key) ?? false; 32 | } 33 | 34 | List getList(String key) { 35 | return _prefs.getStringList(key) ?? []; 36 | } 37 | 38 | Future remove(String key) async { 39 | return await _prefs.remove(key); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_user_login_res.dart: -------------------------------------------------------------------------------- 1 | /// token : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3QiLCJpYXQiOjE2NDUxNTAzMDEsIm5iZiI6MTY0NTE1MDMwMSwiZXhwIjoxNjQ1NzU1MTAxLCJkYXRhIjp7InVzZXIiOnsiaWQiOiIzIn19fQ.LNTkW171_qRNUEflLOr_cEh8dv8JQC7na5JHDLVamRY" 2 | /// user_email : "hans001@vip.qq.com" 3 | /// user_nicename : "hans001" 4 | /// user_display_name : "hans001" 5 | 6 | class WpUserLoginRes { 7 | WpUserLoginRes({ 8 | this.token, 9 | this.userEmail, 10 | this.userNicename, 11 | this.userDisplayName, 12 | }); 13 | 14 | WpUserLoginRes.fromJson(dynamic json) { 15 | token = json['token']; 16 | userEmail = json['user_email']; 17 | userNicename = json['user_nicename']; 18 | userDisplayName = json['user_display_name']; 19 | } 20 | String? token; 21 | String? userEmail; 22 | String? userNicename; 23 | String? userDisplayName; 24 | 25 | Map toJson() { 26 | final map = {}; 27 | map['token'] = token; 28 | map['user_email'] = userEmail; 29 | map['user_nicename'] = userNicename; 30 | map['user_display_name'] = userDisplayName; 31 | return map; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_attributes.dart: -------------------------------------------------------------------------------- 1 | /// id : 2 2 | /// name : "Color" 3 | /// taxonomy : "pa_color" 4 | /// type : "select" 5 | /// order : "menu_order" 6 | /// has_archives : false 7 | /// count : 6 8 | 9 | class WpProductAttributes { 10 | WpProductAttributes({ 11 | this.id, 12 | this.name, 13 | this.taxonomy, 14 | this.type, 15 | this.order, 16 | this.hasArchives, 17 | this.count, 18 | }); 19 | 20 | WpProductAttributes.fromJson(dynamic json) { 21 | id = json['id']; 22 | name = json['name']; 23 | taxonomy = json['taxonomy']; 24 | type = json['type']; 25 | order = json['order']; 26 | hasArchives = json['has_archives']; 27 | count = json['count']; 28 | } 29 | int? id; 30 | String? name; 31 | String? taxonomy; 32 | String? type; 33 | String? order; 34 | bool? hasArchives; 35 | int? count; 36 | 37 | Map toJson() { 38 | final map = {}; 39 | map['id'] = id; 40 | map['name'] = name; 41 | map['taxonomy'] = taxonomy; 42 | map['type'] = type; 43 | map['order'] = order; 44 | map['has_archives'] = hasArchives; 45 | map['count'] = count; 46 | return map; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/common/i18n/translation.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_localizations/flutter_localizations.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import 'locale_en.dart'; 6 | import 'locale_zh.dart'; 7 | 8 | /* 9 | 10 | https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html 11 | https://www.ibabbleon.com/iOS-Language-Codes-ISO-639.html 12 | 13 | */ 14 | 15 | class Translation extends Translations { 16 | static Locale? get locale => Get.deviceLocale; 17 | static const fallbackLocale = Locale('en', 'US'); 18 | static const supportedLocales = [ 19 | Locale('en', 'US'), 20 | Locale('zh', 'CN'), 21 | ]; 22 | static const localizationsDelegates = [ 23 | GlobalMaterialLocalizations.delegate, 24 | GlobalWidgetsLocalizations.delegate, 25 | GlobalCupertinoLocalizations.delegate, 26 | ]; 27 | @override 28 | Map> get keys => { 29 | 'en': LocaleMaps.en, 30 | 'zh': LocaleMaps.zh, 31 | }; 32 | } 33 | 34 | class LocaleMaps { 35 | static Map en = localeEn; 36 | static Map zh = localeZh; 37 | } 38 | -------------------------------------------------------------------------------- /lib/pages/styles/other/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class OtherController extends GetxController { 4 | OtherController(); 5 | 6 | // 价格 7 | final List priceRange = [20, 500]; 8 | onPriceRangeDragging( 9 | int handlerIndex, dynamic lowerValue, dynamic upperValue) { 10 | priceRange[0] = double.parse(lowerValue.toString()); 11 | priceRange[1] = double.parse(upperValue.toString()); 12 | update(["other"]); 13 | } 14 | 15 | // 数量 16 | int quantity = 1; 17 | void onQuantityChange(int val) { 18 | quantity = val; 19 | update(["other"]); 20 | } 21 | 22 | // radio 23 | bool radioValue = true; 24 | void onChangeRadioValue(bool val) { 25 | radioValue = val; 26 | update(["other"]); 27 | } 28 | 29 | _initData() { 30 | update(["other"]); 31 | } 32 | 33 | void onTap() {} 34 | 35 | // @override 36 | // void onInit() { 37 | // super.onInit(); 38 | // } 39 | 40 | @override 41 | void onReady() { 42 | super.onReady(); 43 | _initData(); 44 | } 45 | 46 | // @override 47 | // void onClose() { 48 | // super.onClose(); 49 | // } 50 | 51 | // @override 52 | // void dispose() { 53 | // super.dispose(); 54 | // } 55 | } 56 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // // This is a basic Flutter widget test. 2 | // // 3 | // // To perform an interaction with a widget in your test, use the WidgetTester 4 | // // utility that Flutter provides. For example, you can send tap and scroll 5 | // // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | // import 'package:flutter/material.dart'; 9 | // import 'package:flutter_test/flutter_test.dart'; 10 | 11 | // import 'package:flutter_woo_commerce_getx_ducafecat/main.dart'; 12 | 13 | // void main() { 14 | // testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // // Build our app and trigger a frame. 16 | // await tester.pumpWidget(const MyApp()); 17 | 18 | // // Verify that our counter starts at 0. 19 | // expect(find.text('0'), findsOneWidget); 20 | // expect(find.text('1'), findsNothing); 21 | 22 | // // Tap the '+' icon and trigger a frame. 23 | // await tester.tap(find.byIcon(Icons.add)); 24 | // await tester.pump(); 25 | 26 | // // Verify that our counter has incremented. 27 | // expect(find.text('0'), findsNothing); 28 | // expect(find.text('1'), findsOneWidget); 29 | // }); 30 | // } 31 | -------------------------------------------------------------------------------- /lib/common/components/slider_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SliderIndicatorWidget extends StatelessWidget { 4 | final int length; 5 | final int currentIndex; 6 | final Color color; 7 | final bool isCircle; 8 | final MainAxisAlignment alignment; 9 | 10 | const SliderIndicatorWidget({ 11 | Key? key, 12 | required this.length, 13 | required this.currentIndex, 14 | this.color = Colors.black, 15 | this.isCircle = false, 16 | this.alignment = MainAxisAlignment.center, 17 | }) : super(key: key); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Row( 22 | mainAxisAlignment: alignment, 23 | children: List.generate(length, (index) { 24 | return Container( 25 | margin: const EdgeInsets.symmetric(horizontal: 3), 26 | width: !isCircle 27 | ? currentIndex == index 28 | ? 15.0 29 | : 8 30 | : 6, 31 | height: !isCircle ? 4 : 6, 32 | decoration: BoxDecoration( 33 | borderRadius: const BorderRadius.all(Radius.circular(4)), 34 | color: currentIndex == index ? color : color.withOpacity(0.3), 35 | ), 36 | ); 37 | }), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/svgs/i-camera.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/p-gift.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/global.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import 'common/services/index.dart'; 6 | import 'common/utils/index.dart'; 7 | 8 | class Global { 9 | static Future init() async { 10 | WidgetsFlutterBinding.ensureInitialized(); 11 | await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); 12 | 13 | setSystemUi(); 14 | 15 | // 工具类 16 | await Storage().init(); 17 | Loading.init(); 18 | 19 | // 基础服务 20 | Get.put(ConfigService()); 21 | Get.put(WPHttpService()); 22 | 23 | // 业务服务 24 | Get.put(UserService()); 25 | } 26 | 27 | static void setSystemUi() { 28 | if (GetPlatform.isAndroid) { 29 | SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle( 30 | statusBarColor: Colors.transparent, 31 | statusBarBrightness: Brightness.light, 32 | statusBarIconBrightness: Brightness.dark, 33 | systemNavigationBarDividerColor: Colors.transparent, 34 | systemNavigationBarColor: Colors.white, 35 | systemNavigationBarIconBrightness: Brightness.dark, 36 | ); 37 | SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/pages/styles/carousel/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class CarouselController extends GetxController { 5 | CarouselController(); 6 | 7 | List imagesList = [ 8 | KeyValueModel( 9 | key: "01", 10 | value: 11 | "https://ducafecat.oss-cn-beijing.aliyuncs.com/flutter_woo_commerce_getx_ducafecat/banner01.png"), 12 | KeyValueModel( 13 | key: "01", 14 | value: 15 | "https://ducafecat.oss-cn-beijing.aliyuncs.com/flutter_woo_commerce_getx_ducafecat/banner02.png"), 16 | KeyValueModel( 17 | key: "01", 18 | value: 19 | "https://ducafecat.oss-cn-beijing.aliyuncs.com/flutter_woo_commerce_getx_ducafecat/banner03.png"), 20 | ]; 21 | 22 | int currentIndex = 0; 23 | 24 | void onPageChanged(int val, page) { 25 | currentIndex = val; 26 | update(["carousel_home", "carousel_prod"]); 27 | } 28 | 29 | _initData() { 30 | update(["carousel"]); 31 | } 32 | 33 | void onTap() {} 34 | 35 | // @override 36 | // void onInit() { 37 | // super.onInit(); 38 | // } 39 | 40 | @override 41 | void onReady() { 42 | super.onReady(); 43 | _initData(); 44 | } 45 | 46 | // @override 47 | // void onClose() { 48 | // super.onClose(); 49 | // } 50 | 51 | // @override 52 | // void dispose() { 53 | // super.dispose(); 54 | // } 55 | } 56 | -------------------------------------------------------------------------------- /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.CreateAndShow(L"flutter_woo_commerce_getx_ducafecat", 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 | -------------------------------------------------------------------------------- /assets/svgs/c-more.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /assets/svgs/p-currency.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_categories.dart: -------------------------------------------------------------------------------- 1 | /// id : 22 2 | /// name : "Bag" 3 | /// slug : "bag" 4 | /// description : "" 5 | /// parent : 0 6 | /// count : 3 7 | /// image : null 8 | /// review_count : 0 9 | /// permalink : "http://localhost/product-category/bag/" 10 | 11 | class WpProductCategories { 12 | WpProductCategories({ 13 | this.id, 14 | this.name, 15 | this.slug, 16 | this.description, 17 | this.parent, 18 | this.count, 19 | this.image, 20 | this.reviewCount, 21 | this.permalink, 22 | }); 23 | 24 | WpProductCategories.fromJson(dynamic json) { 25 | id = json['id']; 26 | name = json['name']; 27 | slug = json['slug']; 28 | description = json['description']; 29 | parent = json['parent']; 30 | count = json['count']; 31 | image = json['image']; 32 | reviewCount = json['review_count']; 33 | permalink = json['permalink']; 34 | } 35 | int? id; 36 | String? name; 37 | String? slug; 38 | String? description; 39 | int? parent; 40 | int? count; 41 | dynamic image; 42 | int? reviewCount; 43 | String? permalink; 44 | 45 | Map toJson() { 46 | final map = {}; 47 | map['id'] = id; 48 | map['name'] = name; 49 | map['slug'] = slug; 50 | map['description'] = description; 51 | map['parent'] = parent; 52 | map['count'] = count; 53 | map['image'] = image; 54 | map['review_count'] = reviewCount; 55 | map['permalink'] = permalink; 56 | return map; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /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 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /lib/common/services/user.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:get/get.dart'; 4 | 5 | import '../api/index.dart'; 6 | import '../models/index.dart'; 7 | import '../utils/index.dart'; 8 | import '../values/index.dart'; 9 | 10 | class UserService extends GetxService { 11 | static UserService get to => Get.find(); 12 | 13 | final _isLogin = false.obs; 14 | String token = ''; 15 | final _profile = WpUserProfileRes().obs; 16 | 17 | bool get hasToken => token.isNotEmpty; 18 | bool get isLogin => _isLogin.value; 19 | WpUserProfileRes get profile => _profile.value; 20 | 21 | Future getProfile() async { 22 | if (token.isEmpty) return; 23 | WpUserProfileRes result = await UserAPIs.profile(); 24 | _profile(result); 25 | _isLogin.value = true; 26 | Storage().setString(Constants.storageProfile, jsonEncode(result)); 27 | } 28 | 29 | Future logout() async { 30 | // if (_isLogin.value) await UserAPIs.logout(); 31 | await Storage().remove(Constants.storageToken); 32 | _profile(WpUserProfileRes()); 33 | _isLogin.value = false; 34 | token = ''; 35 | } 36 | 37 | @override 38 | void onInit() { 39 | super.onInit(); 40 | token = Storage().getString(Constants.storageToken); 41 | var profileOffline = Storage().getString(Constants.storageProfile); 42 | if (profileOffline.isNotEmpty) { 43 | _profile(WpUserProfileRes.fromJson(jsonDecode(profileOffline))); 44 | } 45 | } 46 | 47 | Future setToken(String value) async { 48 | await Storage().setString(Constants.storageToken, value); 49 | token = value; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/pages/styles/bottom_sheet/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:wechat_camera_picker/wechat_camera_picker.dart'; 5 | 6 | class BottomSheetController extends GetxController { 7 | BottomSheetController(); 8 | 9 | _initData() { 10 | update(["bottom_sheet"]); 11 | } 12 | 13 | // 拍照 14 | onTapTake(AssetEntity? result) { 15 | if (kDebugMode) { 16 | print(result); 17 | } 18 | } 19 | 20 | // 相册 21 | onTapAlbum(List? result) { 22 | if (kDebugMode) { 23 | print(result); 24 | } 25 | } 26 | 27 | // 性别 28 | List genders = [ 29 | KeyValueModel(key: "Lady", value: "Lady"), 30 | KeyValueModel(key: "Gentleman", value: "Gentleman"), 31 | KeyValueModel(key: "Secret", value: "Secret"), 32 | ]; 33 | KeyValueModel? genderValue = KeyValueModel(key: "Secret", value: "Secret"); 34 | onGenderSelected(KeyValueModel item) { 35 | genderValue = item; 36 | update(["bottom_sheet"]); 37 | } 38 | 39 | // 生日 40 | DateTime birthday = DateTime.now(); 41 | onBirthdayConfirm(DateTime val) { 42 | birthday = val; 43 | update(["bottom_sheet"]); 44 | } 45 | 46 | // @override 47 | // void onInit() { 48 | // super.onInit(); 49 | // } 50 | 51 | @override 52 | void onReady() { 53 | super.onReady(); 54 | _initData(); 55 | } 56 | 57 | // @override 58 | // void onClose() { 59 | // super.onClose(); 60 | // } 61 | 62 | // @override 63 | // void dispose() { 64 | // super.dispose(); 65 | // } 66 | } 67 | -------------------------------------------------------------------------------- /assets/svgs/i-trash.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/svgs/c-woman.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/components/quantity.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | import '../index.dart'; 4 | 5 | /// 数量编辑 6 | class QuantityWidget extends StatelessWidget { 7 | final Function(int quantity) onChange; 8 | final int quantity; 9 | final String? id; 10 | final double? size; 11 | final double? fontSize; 12 | final double? paddingHorizontal; 13 | final Color? color; 14 | 15 | QuantityWidget({ 16 | Key? key, 17 | this.id, 18 | required this.quantity, 19 | required this.onChange, 20 | this.size, 21 | this.fontSize, 22 | this.paddingHorizontal, 23 | Color? color, 24 | }) : color = color ?? AppColors.onSurfaceVariant, 25 | super(key: key); 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Row( 30 | children: [ 31 | // 减号 32 | ButtonWidget.icon( 33 | Icon( 34 | CupertinoIcons.minus, 35 | size: fontSize ?? 14, 36 | color: color, 37 | ), 38 | onTap: () => onChange(quantity - 1 < 0 ? 0 : quantity - 1), 39 | ), 40 | 41 | // 数量 42 | TextWidget.body2( 43 | "$quantity", 44 | color: color, 45 | ) 46 | .center() 47 | .tight(width: size ?? 24, height: size ?? 24) 48 | .decorated( 49 | borderRadius: const BorderRadius.all(Radius.circular(4)), 50 | border: Border.all(color: color!, width: 1), 51 | ) 52 | .paddingHorizontal(paddingHorizontal ?? AppSpace.iconTextSmail), 53 | 54 | // 加号 55 | ButtonWidget.icon( 56 | Icon( 57 | CupertinoIcons.plus, 58 | size: fontSize ?? 14, 59 | color: AppColors.highlight, 60 | ), 61 | onTap: () => onChange(quantity + 1), 62 | ), 63 | ], 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/common/utils/loading.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 3 | 4 | class Loading { 5 | static const int _milliseconds = 300; // 提示 延迟毫秒, 提示体验 秒关太快 6 | static const int _dismissMilliseconds = 2000; // dismiss 延迟毫秒 7 | 8 | Loading.init() { 9 | EasyLoading.instance 10 | ..displayDuration = const Duration(milliseconds: _dismissMilliseconds) 11 | ..indicatorType = EasyLoadingIndicatorType.ring 12 | ..loadingStyle = EasyLoadingStyle.custom 13 | ..indicatorSize = 35.0 14 | ..lineWidth = 2 15 | ..radius = 10.0 16 | ..progressColor = Colors.white 17 | ..backgroundColor = Colors.black.withOpacity(0.7) 18 | ..indicatorColor = Colors.white 19 | ..textColor = Colors.white 20 | ..maskColor = Colors.black.withOpacity(0.6) 21 | ..userInteractions = true 22 | ..dismissOnTap = false; 23 | } 24 | 25 | static void show([String? text]) { 26 | EasyLoading.instance.userInteractions = false; // 屏蔽交互操作 27 | EasyLoading.show(status: text ?? 'Loading...'); 28 | } 29 | 30 | static void error([String? text]) { 31 | Future.delayed( 32 | const Duration(milliseconds: _milliseconds), 33 | () => EasyLoading.showError(text ?? 'Error'), 34 | ); 35 | } 36 | 37 | static void success([String? text]) { 38 | Future.delayed( 39 | const Duration(milliseconds: _milliseconds), 40 | () => EasyLoading.showSuccess(text ?? 'Success'), 41 | ); 42 | } 43 | 44 | static void toast(String text) { 45 | EasyLoading.showToast(text); 46 | } 47 | 48 | static Future dismiss() async { 49 | await Future.delayed( 50 | const Duration(milliseconds: _dismissMilliseconds), 51 | () { 52 | EasyLoading.instance.userInteractions = true; // 恢复交互操作 53 | EasyLoading.dismiss(); 54 | }, 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /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 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /lib/pages/styles/components/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | import 'index.dart'; 7 | 8 | /// 业务组件 9 | class ComponentsPage extends GetView { 10 | const ComponentsPage({Key? key}) : super(key: key); 11 | 12 | Widget _buildView() { 13 | return [ 14 | // 商品项 15 | GoodsItemWidget( 16 | imgUrl: 17 | "https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/e12b8a142351704bf95cce1ec78936d6.jpg", 18 | // imgWidth: 120.w, 19 | imgHeight: 117.w, 20 | title: 21 | "Amazon Basics Kids Unicorns & Rainbows Patterned Throw Blanket with Stuffed Animal Unicorn", 22 | price: "99.99", 23 | ).tight(width: 120.w, height: 170.w).paddingBottom(AppSpace.listRow), 24 | 25 | // 商品项 26 | GoodsItemWidget( 27 | imgUrl: 28 | "https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/e12b8a142351704bf95cce1ec78936d6.jpg", 29 | // imgWidth: 132.w, 30 | imgHeight: 114.w, 31 | title: 32 | "Amazon Basics Kids Unicorns & Rainbows Patterned Throw Blanket with Stuffed Animal Unicorn", 33 | // price: "99.99", 34 | ).tight(width: 132.w, height: 155.w).paddingBottom(AppSpace.listRow), 35 | ].toColumn().center(); 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | return GetBuilder( 41 | init: ComponentsController(), 42 | id: "components", 43 | builder: (_) { 44 | return Scaffold( 45 | appBar: AppBar(title: const Text("components")), 46 | body: SafeArea( 47 | child: _buildView(), 48 | ), 49 | ); 50 | }, 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/common/components/goods_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../index.dart'; 4 | 5 | /// 商品展示项 6 | class GoodsItemWidget extends StatelessWidget { 7 | final Function()? onTap; 8 | final String? imgUrl; 9 | final double? imgWidth; 10 | final double? imgHeight; 11 | final String? title; 12 | final String? price; 13 | 14 | const GoodsItemWidget({ 15 | Key? key, 16 | this.onTap, 17 | this.imgUrl, 18 | this.imgWidth, 19 | this.imgHeight, 20 | this.title, 21 | this.price, 22 | }) : super(key: key); 23 | 24 | Widget _buildView(BoxConstraints constraints) { 25 | var ws = [ 26 | // 图片 27 | if (imgUrl != null) 28 | ImageWidget.url( 29 | imgUrl, 30 | fit: BoxFit.cover, 31 | width: imgWidth ?? constraints.minWidth, 32 | height: imgHeight, 33 | ), 34 | 35 | // 描述 36 | [ 37 | // 标题 38 | if (title != null) TextWidget.body2(title ?? ""), 39 | 40 | // 价格 41 | if (price != null) 42 | TextWidget.body2( 43 | price ?? "", 44 | weight: FontWeight.bold, 45 | ), 46 | ] 47 | .toColumn( 48 | mainAxisAlignment: MainAxisAlignment.spaceAround, 49 | crossAxisAlignment: CrossAxisAlignment.start, 50 | ) 51 | .padding(all: AppSpace.listItem) 52 | .expanded(), 53 | ]; 54 | 55 | return ws 56 | .toColumn( 57 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 58 | crossAxisAlignment: CrossAxisAlignment.start, 59 | ) 60 | // .backgroundColor(AppColors.onPrimary) 61 | .card(); 62 | } 63 | 64 | @override 65 | Widget build(BuildContext context) { 66 | return LayoutBuilder( 67 | builder: (BuildContext context, BoxConstraints constraints) { 68 | return _buildView(constraints); 69 | }, 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_images.dart: -------------------------------------------------------------------------------- 1 | /// id : 44 2 | /// src : "https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11.jpg" 3 | /// thumbnail : "https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11-450x450.jpg" 4 | /// srcset : "https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11.jpg 1438w, https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11-288x300.jpg 288w, https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11-982x1024.jpg 982w, https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11-768x801.jpg 768w, https://ducafecat.oss-cn-beijing.aliyuncs.com/wp-content/uploads/2022/02/90bb74497f090c48e1df1ec1ca31fb11-600x626.jpg 600w" 5 | /// sizes : "(max-width: 1438px) 100vw, 1438px" 6 | /// name : "713WmL0Bi0L._AC_SL1500_" 7 | /// alt : "" 8 | 9 | class WpProductionImages { 10 | WpProductionImages({ 11 | this.id, 12 | this.src, 13 | this.thumbnail, 14 | this.srcset, 15 | this.sizes, 16 | this.name, 17 | this.alt, 18 | }); 19 | 20 | WpProductionImages.fromJson(dynamic json) { 21 | id = json['id']; 22 | src = json['src']; 23 | thumbnail = json['thumbnail']; 24 | srcset = json['srcset']; 25 | sizes = json['sizes']; 26 | name = json['name']; 27 | alt = json['alt']; 28 | } 29 | int? id; 30 | String? src; 31 | String? thumbnail; 32 | String? srcset; 33 | String? sizes; 34 | String? name; 35 | String? alt; 36 | 37 | Map toJson() { 38 | final map = {}; 39 | map['id'] = id; 40 | map['src'] = src; 41 | map['thumbnail'] = thumbnail; 42 | map['srcset'] = srcset; 43 | map['sizes'] = sizes; 44 | map['name'] = name; 45 | map['alt'] = alt; 46 | return map; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:flutter_woo_commerce_getx_ducafecat/common/services/index.dart'; 5 | import 'package:get/get.dart'; 6 | import 'package:pull_to_refresh/pull_to_refresh.dart'; 7 | 8 | import 'common/i18n/index.dart'; 9 | import 'common/routers/index.dart'; 10 | import 'common/style/index.dart'; 11 | import 'global.dart'; 12 | 13 | Future main() async { 14 | await Global.init(); 15 | runApp(const MyApp()); 16 | } 17 | 18 | class MyApp extends StatelessWidget { 19 | const MyApp({Key? key}) : super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return ScreenUtilInit( 24 | designSize: const Size(414, 896), // 设计稿尺寸 25 | builder: () => RefreshConfiguration( 26 | headerBuilder: () => const ClassicHeader(), 27 | footerBuilder: () => const ClassicFooter(), 28 | hideFooterWhenNotFull: true, 29 | headerTriggerDistance: 80, 30 | maxOverScrollExtent: 100, 31 | footerTriggerDistance: 150, 32 | child: GetMaterialApp( 33 | title: 'WooCommerce', 34 | 35 | // 样式 36 | theme: ConfigService.to.isDarkModel ? AppTheme.dark : AppTheme.light, 37 | 38 | // 路由 39 | initialRoute: RouteNames.styleWidgets, 40 | getPages: RoutePages.list, 41 | navigatorObservers: [RoutePages.observer], 42 | 43 | // 多语言 44 | translations: Translation(), 45 | localizationsDelegates: Translation.localizationsDelegates, 46 | supportedLocales: Translation.supportedLocales, 47 | locale: ConfigService.to.locale, 48 | fallbackLocale: Translation.fallbackLocale, 49 | 50 | // 其它 51 | builder: EasyLoading.init(), 52 | debugShowCheckedModeBanner: false, 53 | ), 54 | ), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/common/utils/bottom_sheet.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; 5 | 6 | /// 底部弹出对话框 7 | class ActionBottomSheet { 8 | static Future show({ 9 | BuildContext? context, 10 | Widget? child, 11 | EdgeInsetsGeometry? contentPadding, 12 | }) async { 13 | return await showMaterialModalBottomSheet( 14 | context: context ?? Get.context!, 15 | expand: false, 16 | backgroundColor: Colors.transparent, 17 | builder: (context) => Material( 18 | child: SafeArea( 19 | top: false, 20 | child: child ?? Container(), 21 | ), 22 | ), 23 | ); 24 | } 25 | 26 | static Future barModal({ 27 | BuildContext? context, 28 | Widget? child, 29 | EdgeInsetsGeometry? contentPadding, 30 | }) async { 31 | return await showBarModalBottomSheet( 32 | context: context ?? Get.context!, 33 | expand: false, 34 | backgroundColor: Colors.transparent, 35 | builder: (context) => Material( 36 | child: SafeArea( 37 | bottom: false, 38 | child: child ?? Container(), 39 | ), 40 | ), 41 | ); 42 | } 43 | 44 | static Future showMaterialModal({ 45 | BuildContext? context, 46 | Widget? child, 47 | EdgeInsetsGeometry? contentPadding, 48 | EdgeInsets? safeAreaMinimum, 49 | }) async { 50 | return await showMaterialModalBottomSheet( 51 | context: context ?? Get.context!, 52 | backgroundColor: Colors.transparent, 53 | builder: (context) => SafeArea( 54 | minimum: safeAreaMinimum ?? EdgeInsets.all(AppSpace.card), 55 | child: AnimatedPadding( 56 | padding: MediaQuery.of(context).viewInsets, 57 | duration: const Duration(milliseconds: 150), 58 | child: child, 59 | ), 60 | ), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_prices.dart: -------------------------------------------------------------------------------- 1 | class WpProductPrices { 2 | WpProductPrices({ 3 | this.price, 4 | this.regularPrice, 5 | this.salePrice, 6 | this.priceRange, 7 | this.currencyCode, 8 | this.currencySymbol, 9 | this.currencyMinorUnit, 10 | this.currencyDecimalSeparator, 11 | this.currencyThousandSeparator, 12 | this.currencyPrefix, 13 | this.currencySuffix, 14 | }); 15 | 16 | WpProductPrices.fromJson(dynamic json) { 17 | price = json['price']; 18 | regularPrice = json['regular_price']; 19 | salePrice = json['sale_price']; 20 | priceRange = json['price_range']; 21 | currencyCode = json['currency_code']; 22 | currencySymbol = json['currency_symbol']; 23 | currencyMinorUnit = json['currency_minor_unit']; 24 | currencyDecimalSeparator = json['currency_decimal_separator']; 25 | currencyThousandSeparator = json['currency_thousand_separator']; 26 | currencyPrefix = json['currency_prefix']; 27 | currencySuffix = json['currency_suffix']; 28 | } 29 | String? price; 30 | String? regularPrice; 31 | String? salePrice; 32 | dynamic priceRange; 33 | String? currencyCode; 34 | String? currencySymbol; 35 | int? currencyMinorUnit; 36 | String? currencyDecimalSeparator; 37 | String? currencyThousandSeparator; 38 | String? currencyPrefix; 39 | String? currencySuffix; 40 | 41 | Map toJson() { 42 | final map = {}; 43 | map['price'] = price; 44 | map['regular_price'] = regularPrice; 45 | map['sale_price'] = salePrice; 46 | map['price_range'] = priceRange; 47 | map['currency_code'] = currencyCode; 48 | map['currency_symbol'] = currencySymbol; 49 | map['currency_minor_unit'] = currencyMinorUnit; 50 | map['currency_decimal_separator'] = currencyDecimalSeparator; 51 | map['currency_thousand_separator'] = currencyThousandSeparator; 52 | map['currency_prefix'] = currencyPrefix; 53 | map['currency_suffix'] = currencySuffix; 54 | return map; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /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 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /lib/common/services/config.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:get/get.dart'; 4 | import 'package:package_info/package_info.dart'; 5 | 6 | import '../i18n/index.dart'; 7 | import '../style/theme.dart'; 8 | import '../utils/index.dart'; 9 | import '../values/index.dart'; 10 | 11 | class ConfigService extends GetxService { 12 | static ConfigService get to => Get.find(); 13 | 14 | bool firstOpen = false; 15 | Locale locale = 16 | PlatformDispatcher.instance.locale; //const Locale('en', 'US'); 17 | PackageInfo? _platform; 18 | String get version => _platform?.version ?? '-'; 19 | 20 | final RxBool _isDarkModel = Get.isDarkMode.obs; 21 | bool get isDarkModel => _isDarkModel.value; 22 | 23 | @override 24 | void onInit() { 25 | super.onInit(); 26 | 27 | firstOpen = Storage().getBool(Constants.storageFirstOpen); 28 | initLocale(); 29 | } 30 | 31 | @override 32 | void onReady() { 33 | super.onReady(); 34 | getPlatform(); 35 | } 36 | 37 | Future getPlatform() async { 38 | _platform = await PackageInfo.fromPlatform(); 39 | } 40 | 41 | void initLocale() { 42 | var langCode = Storage().getString(Constants.storageLanguageCode); 43 | if (langCode.isEmpty) return; 44 | var index = Translation.supportedLocales.indexWhere((element) { 45 | return element.languageCode == langCode; 46 | }); 47 | if (index < 0) return; 48 | locale = Translation.supportedLocales[index]; 49 | } 50 | 51 | void onLocaleUpdate(Locale value) { 52 | locale = value; 53 | Get.updateLocale(value); 54 | Storage().setString(Constants.storageLanguageCode, value.languageCode); 55 | } 56 | 57 | void setAlreadyOpen() { 58 | Storage().setBool(Constants.storageFirstOpen, true); 59 | } 60 | 61 | Future switchThemeModel() async { 62 | _isDarkModel.value = !_isDarkModel.value; 63 | Get.changeTheme( 64 | _isDarkModel.value == true ? AppTheme.dark : AppTheme.light, 65 | ); 66 | await Future.delayed(const Duration(seconds: 1)); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/pages/styles/group_list/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | import 'index.dart'; 7 | 8 | class GroupListPage extends GetView { 9 | const GroupListPage({Key? key}) : super(key: key); 10 | 11 | Widget _buildView() { 12 | return SingleChildScrollView( 13 | child: _buildGroupList().paddingAll(AppSpace.card), 14 | ); 15 | } 16 | 17 | Widget _buildGroupList() { 18 | return [ 19 | // 尺寸 20 | GroupListWidget.sizes( 21 | itemList: controller.sizes, 22 | values: controller.sizeValues, 23 | size: 24.w, 24 | onTap: controller.onSizeCange, 25 | ).paddingBottom(AppSpace.listRow), 26 | 27 | // 颜色 28 | GroupListWidget.colors( 29 | itemList: controller.colors, 30 | values: controller.colorValues, 31 | size: 24.w, 32 | onTap: controller.onColorCange, 33 | ).paddingBottom(AppSpace.listRow), 34 | 35 | // 标签 36 | GroupListWidget.tags( 37 | itemList: controller.tags, 38 | values: controller.tagValues, 39 | onTap: controller.onTagCange, 40 | ).paddingBottom(AppSpace.listRow), 41 | 42 | // 星级 43 | GroupListWidget.stars( 44 | starNum: controller.starNum, 45 | value: controller.starValue, 46 | onTap: controller.onStarCange, 47 | ).paddingBottom(AppSpace.listRow), 48 | 49 | const Divider(), 50 | ].toColumn(); 51 | } 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return GetBuilder( 56 | init: GroupListController(), 57 | id: "group_list", 58 | builder: (_) { 59 | return Scaffold( 60 | appBar: AppBar(title: const Text("分组列表")), 61 | body: SafeArea( 62 | child: _buildView(), 63 | ), 64 | ); 65 | }, 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/common/routers/observers.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'index.dart'; 4 | 5 | class RouteObservers> extends RouteObserver { 6 | @override 7 | void didPush(Route route, Route? previousRoute) { 8 | super.didPush(route, previousRoute); 9 | var name = route.settings.name ?? ''; 10 | if (name.isNotEmpty) RoutePages.history.add(name); 11 | debugPrint('didPush'); 12 | debugPrint(RoutePages.history.toString()); 13 | } 14 | 15 | @override 16 | void didPop(Route route, Route? previousRoute) { 17 | super.didPop(route, previousRoute); 18 | RoutePages.history.remove(route.settings.name); 19 | debugPrint('didPop'); 20 | debugPrint(RoutePages.history.toString()); 21 | } 22 | 23 | @override 24 | void didReplace({Route? newRoute, Route? oldRoute}) { 25 | super.didReplace(newRoute: newRoute, oldRoute: oldRoute); 26 | if (newRoute != null) { 27 | var index = RoutePages.history.indexWhere((element) { 28 | return element == oldRoute?.settings.name; 29 | }); 30 | var name = newRoute.settings.name ?? ''; 31 | if (name.isNotEmpty) { 32 | if (index > 0) { 33 | RoutePages.history[index] = name; 34 | } else { 35 | RoutePages.history.add(name); 36 | } 37 | } 38 | } 39 | debugPrint('didReplace'); 40 | debugPrint(RoutePages.history.toString()); 41 | } 42 | 43 | @override 44 | void didRemove(Route route, Route? previousRoute) { 45 | super.didRemove(route, previousRoute); 46 | RoutePages.history.remove(route.settings.name); 47 | debugPrint('didRemove'); 48 | debugPrint(RoutePages.history.toString()); 49 | } 50 | 51 | @override 52 | void didStartUserGesture( 53 | Route route, Route? previousRoute) { 54 | super.didStartUserGesture(route, previousRoute); 55 | } 56 | 57 | @override 58 | void didStopUserGesture() { 59 | super.didStopUserGesture(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/common/style/text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | /// 字体样式 5 | class AppTextStyles { 6 | static TextStyle? get bodyLarge => Get.textTheme.bodyLarge; 7 | static TextStyle? get bodyMedium => Get.textTheme.bodyMedium; 8 | static TextStyle? get bodySmall => Get.textTheme.bodySmall; 9 | 10 | static TextStyle? get bodyText1 => Get.textTheme.bodyText1; 11 | static TextStyle? get bodyText2 => Get.textTheme.bodyText2; 12 | 13 | static TextStyle? get button => Get.textTheme.button; 14 | static TextStyle? get caption => Get.textTheme.caption; 15 | 16 | static TextStyle? get displayLarge => Get.textTheme.displayLarge; 17 | static TextStyle? get displayMedium => Get.textTheme.displayMedium; 18 | static TextStyle? get displaySmall => Get.textTheme.displaySmall; 19 | 20 | static TextStyle? get headline1 => Get.textTheme.headline1; 21 | static TextStyle? get headline2 => Get.textTheme.headline2; 22 | static TextStyle? get headline3 => Get.textTheme.headline3; 23 | static TextStyle? get headline4 => Get.textTheme.headline4; 24 | static TextStyle? get headline5 => Get.textTheme.headline5; 25 | static TextStyle? get headline6 => Get.textTheme.headline6; 26 | 27 | static TextStyle? get headlineLarge => Get.textTheme.headlineLarge; 28 | static TextStyle? get headlineMedium => Get.textTheme.headlineMedium; 29 | static TextStyle? get headlineSmall => Get.textTheme.headlineSmall; 30 | 31 | static TextStyle? get labelLarge => Get.textTheme.labelLarge; 32 | static TextStyle? get labelMedium => Get.textTheme.labelMedium; 33 | static TextStyle? get labelSmall => Get.textTheme.labelSmall; 34 | 35 | static TextStyle? get overline => Get.textTheme.overline; 36 | static TextStyle? get subtitle1 => Get.textTheme.subtitle1; 37 | static TextStyle? get subtitle2 => Get.textTheme.subtitle2; 38 | 39 | static TextStyle? get titleLarge => Get.textTheme.titleLarge; 40 | static TextStyle? get titleMedium => Get.textTheme.titleMedium; 41 | static TextStyle? get titleSmall => Get.textTheme.titleSmall; 42 | } 43 | -------------------------------------------------------------------------------- /assets/svgs/c-home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter Woo Commerce Getx Ducafecat 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_woo_commerce_getx_ducafecat 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 | UIViewControllerBasedStatusBarAppearance 45 | 46 | NSMicrophoneUsageDescription 47 | Requires access to the microphone to shoot video and voice to share with friends. 48 | NSPhotoLibraryUsageDescription 49 | Requires access to the photo library to read videos and photos to share with friends. 50 | 51 | 52 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_user_profile_res.dart: -------------------------------------------------------------------------------- 1 | /// id : 3 2 | /// username : "hans001" 3 | /// name : "hans001" 4 | /// first_name : "" 5 | /// last_name : "" 6 | /// email : "hans001@vip.qq.com" 7 | /// url : "" 8 | /// description : "" 9 | /// link : "http://localhost/author/hans001/" 10 | /// locale : "zh_CN" 11 | /// nickname : "hans001" 12 | /// slug : "hans001" 13 | /// registered_date : "2022-02-18T01:12:46+00:00" 14 | 15 | class WpUserProfileRes { 16 | WpUserProfileRes({ 17 | this.id, 18 | this.username, 19 | this.name, 20 | this.firstName, 21 | this.lastName, 22 | this.email, 23 | this.url, 24 | this.description, 25 | this.link, 26 | this.locale, 27 | this.nickname, 28 | this.slug, 29 | this.registeredDate, 30 | }); 31 | 32 | WpUserProfileRes.fromJson(dynamic json) { 33 | id = json['id']; 34 | username = json['username']; 35 | name = json['name']; 36 | firstName = json['first_name']; 37 | lastName = json['last_name']; 38 | email = json['email']; 39 | url = json['url']; 40 | description = json['description']; 41 | link = json['link']; 42 | locale = json['locale']; 43 | nickname = json['nickname']; 44 | slug = json['slug']; 45 | registeredDate = json['registered_date']; 46 | } 47 | int? id; 48 | String? username; 49 | String? name; 50 | String? firstName; 51 | String? lastName; 52 | String? email; 53 | String? url; 54 | String? description; 55 | String? link; 56 | String? locale; 57 | String? nickname; 58 | String? slug; 59 | String? registeredDate; 60 | 61 | Map toJson() { 62 | final map = {}; 63 | map['id'] = id; 64 | map['username'] = username; 65 | map['name'] = name; 66 | map['first_name'] = firstName; 67 | map['last_name'] = lastName; 68 | map['email'] = email; 69 | map['url'] = url; 70 | map['description'] = description; 71 | map['link'] = link; 72 | map['locale'] = locale; 73 | map['nickname'] = nickname; 74 | map['slug'] = slug; 75 | map['registered_date'] = registeredDate; 76 | return map; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/common/components/picker_datetime.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_picker/Picker.dart'; 3 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | /// Picker 日期选择 7 | class PickerDateTimeWidget extends StatelessWidget { 8 | final String? title; 9 | final DateTime? value; 10 | final DateTime? minValue; 11 | final DateTime? maxValue; 12 | final int type; 13 | final Function(DateTime value)? onConfirm; 14 | 15 | const PickerDateTimeWidget({ 16 | Key? key, 17 | this.onConfirm, 18 | this.title, 19 | this.value, 20 | this.minValue, 21 | this.maxValue, 22 | this.type = PickerDateTimeType.kYMD, 23 | }) : super(key: key); 24 | 25 | _buildView() { 26 | var format = 'yyyy-MM-dd'; 27 | var picker = ActionPicker.text( 28 | adapter: DateTimePickerAdapter( 29 | type: type, 30 | isNumberMonth: true, 31 | minValue: minValue, 32 | maxValue: maxValue, 33 | value: value, 34 | ), 35 | ); 36 | if (type == PickerDateTimeType.kYMDHM) format = 'yyyy-MM-dd HH:mm'; 37 | 38 | List ws = [ 39 | // 头部 40 | [ 41 | // 标题 42 | TextWidget.title3(title ?? "").expanded(), 43 | // 按钮 44 | ButtonWidget.text( 45 | LocaleKeys.commonBottomConfirm.tr, 46 | textColor: AppColors.primary, 47 | onTap: () { 48 | picker.doConfirm(Get.context!); 49 | if (onConfirm != null) { 50 | onConfirm!(Convert.toDateTime(picker.adapter.text, format)); 51 | } 52 | }, 53 | ), 54 | ].toRow(), 55 | 56 | // 日期选取 57 | picker.makePicker(), 58 | ]; 59 | 60 | return ws 61 | .toColumn( 62 | crossAxisAlignment: CrossAxisAlignment.stretch, 63 | mainAxisSize: MainAxisSize.min, 64 | ) 65 | .paddingAll(AppSpace.card) 66 | .backgroundColor(AppColors.background); 67 | } 68 | 69 | @override 70 | Widget build(BuildContext context) { 71 | return _buildView(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/pages/styles/carousel/view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_woo_commerce_getx_ducafecat/common/index.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import 'index.dart'; 6 | 7 | class CarouselPage extends GetView { 8 | const CarouselPage({Key? key}) : super(key: key); 9 | 10 | Widget _buildView() { 11 | return [ 12 | // 首页滚动图 13 | GetBuilder( 14 | init: controller, 15 | id: "carousel_home", 16 | builder: (_controller) { 17 | return CarouselWidget( 18 | items: _controller.imagesList, 19 | currentIndex: _controller.currentIndex, 20 | onPageChanged: _controller.onPageChanged, 21 | height: 200, 22 | ); 23 | }) 24 | .tight(height: 200) 25 | .backgroundColor(Colors.black26) 26 | .paddingBottom(AppSpace.listRow), 27 | 28 | // 产品页滚动图 29 | GetBuilder( 30 | init: controller, 31 | id: "carousel_prod", 32 | builder: (_controller) { 33 | return CarouselWidget( 34 | items: _controller.imagesList, 35 | currentIndex: _controller.currentIndex, 36 | onPageChanged: _controller.onPageChanged, 37 | height: 300, 38 | indicatorCircle: false, 39 | ); 40 | }) 41 | .tight(height: 300) 42 | .backgroundColor(Colors.black26) 43 | .paddingBottom(AppSpace.listRow), 44 | ].toColumn().paddingAll(AppSpace.page); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return GetBuilder( 50 | init: CarouselController(), 51 | id: "carousel", 52 | builder: (_) { 53 | return Scaffold( 54 | appBar: AppBar(title: const Text("滚动图")), 55 | body: SafeArea( 56 | child: _buildView(), 57 | ), 58 | ); 59 | }, 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/common/widgets/icon.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | 4 | import '../style/index.dart'; 5 | 6 | /// 图标组件 7 | class IconWidget extends StatelessWidget { 8 | final IconData? iconData; 9 | final Widget? icon; 10 | final double? size; 11 | final double? width; 12 | final double? height; 13 | final Color? color; 14 | 15 | const IconWidget({ 16 | Key? key, 17 | this.icon, 18 | this.size, 19 | this.width, 20 | this.height, 21 | this.color, 22 | this.iconData, 23 | }) : super(key: key); 24 | 25 | IconWidget.icon( 26 | this.iconData, { 27 | Key? key, 28 | this.size = 24, 29 | this.width, 30 | this.height, 31 | this.color, 32 | }) : icon = Icon( 33 | iconData, 34 | size: size, 35 | color: color, 36 | ), 37 | super(key: key) { 38 | return; 39 | } 40 | 41 | IconWidget.image( 42 | String assetName, { 43 | Key? key, 44 | this.size = 24, 45 | this.width, 46 | this.height, 47 | this.color, 48 | this.iconData, 49 | }) : icon = Image.asset( 50 | assetName, 51 | width: width ?? size, 52 | height: height ?? size, 53 | color: color, 54 | fit: BoxFit.contain, 55 | ), 56 | super(key: key) { 57 | return; 58 | } 59 | 60 | IconWidget.svg( 61 | String assetName, { 62 | Key? key, 63 | this.size = 24, 64 | this.width, 65 | this.height, 66 | this.color, 67 | this.iconData, 68 | }) : icon = SvgPicture.asset( 69 | assetName, 70 | width: width ?? size, 71 | height: height ?? size, 72 | color: color, 73 | fit: BoxFit.contain, 74 | ), 75 | super(key: key) { 76 | return; 77 | } 78 | 79 | @override 80 | Widget build(BuildContext context) { 81 | if (icon != null) { 82 | return icon!; 83 | } 84 | if (iconData != null) { 85 | return Icon( 86 | iconData, 87 | size: size, 88 | color: color ?? AppColors.onPrimaryContainer, 89 | ); 90 | } 91 | return Container(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/common/components/picker_single.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../index.dart'; 5 | 6 | /// Picker 单选列表 7 | class PickerSingleWidget extends StatelessWidget { 8 | final Function(KeyValueModel item)? onSelected; 9 | final String? title; 10 | final KeyValueModel? value; 11 | final List? items; 12 | 13 | const PickerSingleWidget({ 14 | Key? key, 15 | this.onSelected, 16 | this.title, 17 | this.value, 18 | this.items, 19 | }) : super(key: key); 20 | 21 | _buildView() { 22 | List ws = [ 23 | // 标题 24 | if (title != null) TextWidget.title3(title!), 25 | 26 | // 选项列表 27 | if (items != null) 28 | for (int i = 0; i < items!.length; i++) 29 | ListTileWidget( 30 | title: TextWidget.body1(items![i].key), 31 | trailing: [ 32 | CheckBoxWidget.single(items![i].value == value!.value, (value) { 33 | if (onSelected != null) { 34 | onSelected!(items![i]); 35 | } 36 | Get.back(); 37 | }) 38 | ], 39 | ).paddingBottom(AppSpace.listItem), 40 | ]; 41 | 42 | return ws 43 | .toColumn( 44 | crossAxisAlignment: CrossAxisAlignment.stretch, 45 | mainAxisSize: MainAxisSize.min, 46 | ) 47 | .paddingAll(AppSpace.card) 48 | .decorated( 49 | color: AppColors.background, 50 | borderRadius: BorderRadius.all(Radius.circular(AppRadius.card)), 51 | ); 52 | // Container( 53 | // padding: EdgeInsets.all(20.w), 54 | // decoration: BoxDecoration( 55 | // color: Colors.white, 56 | // borderRadius: BorderRadius.all( 57 | // Radius.circular(AppTheme.radius.w), 58 | // ), 59 | // ), 60 | // child: Column( 61 | // crossAxisAlignment: CrossAxisAlignment.stretch, 62 | // mainAxisSize: MainAxisSize.min, 63 | // children: ws, 64 | // ), 65 | // ); 66 | } 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | return _buildView(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /assets/svgs/files.txt: -------------------------------------------------------------------------------- 1 | static const cBagSvg = 'assets/svgs/c-bag.svg'; 2 | static const cBikeSvg = 'assets/svgs/c-bike.svg'; 3 | static const cElectricSvg = 'assets/svgs/c-electric.svg'; 4 | static const cHomeSvg = 'assets/svgs/c-home.svg'; 5 | static const cKidsSvg = 'assets/svgs/c-kids.svg'; 6 | static const cManSvg = 'assets/svgs/c-man.svg'; 7 | static const cMoreSvg = 'assets/svgs/c-more.svg'; 8 | static const cWomanSvg = 'assets/svgs/c-woman.svg'; 9 | static const facebookSvg = 'assets/svgs/facebook.svg'; 10 | static const googleSvg = 'assets/svgs/google.svg'; 11 | static const iAddFriendSvg = 'assets/svgs/i-add-friend.svg'; 12 | static const iAddSvg = 'assets/svgs/i-add.svg'; 13 | static const iArrowBackSvg = 'assets/svgs/i-arrow-back.svg'; 14 | static const iArrowBottomSvg = 'assets/svgs/i-arrow-bottom.svg'; 15 | static const iArrowDownSvg = 'assets/svgs/i-arrow-down.svg'; 16 | static const iArrowLeftUpSvg = 'assets/svgs/i-arrow-left-up.svg'; 17 | static const iArrowRightSvg = 'assets/svgs/i-arrow-right.svg'; 18 | static const iCameraSvg = 'assets/svgs/i-camera.svg'; 19 | static const iCloseSvg = 'assets/svgs/i-close.svg'; 20 | static const iCouponSvg = 'assets/svgs/i-coupon.svg'; 21 | static const iIndicatorsSvg = 'assets/svgs/i-indicators.svg'; 22 | static const iLikeSvg = 'assets/svgs/i-like.svg'; 23 | static const iNotificationsSvg = 'assets/svgs/i-notifications.svg'; 24 | static const iSearchSvg = 'assets/svgs/i-search.svg'; 25 | static const iStarSvg = 'assets/svgs/i-star.svg'; 26 | static const iSubtractSvg = 'assets/svgs/i-subtract.svg'; 27 | static const iTrashSvg = 'assets/svgs/i-trash.svg'; 28 | static const navCartSvg = 'assets/svgs/nav-cart.svg'; 29 | static const navHomeSvg = 'assets/svgs/nav-home.svg'; 30 | static const navMessageSvg = 'assets/svgs/nav-message.svg'; 31 | static const navProfileSvg = 'assets/svgs/nav-profile.svg'; 32 | static const pCurrencySvg = 'assets/svgs/p-currency.svg'; 33 | static const pDeliverySvg = 'assets/svgs/p-delivery.svg'; 34 | static const pGiftSvg = 'assets/svgs/p-gift.svg'; 35 | static const pHomeSvg = 'assets/svgs/p-home.svg'; 36 | static const pNotificationsSvg = 'assets/svgs/p-notifications.svg'; 37 | static const pTranslateSvg = 'assets/svgs/p-translate.svg'; 38 | -------------------------------------------------------------------------------- /assets/svgs/c-man.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.flutter_woo_commerce_getx_ducafecat" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /lib/common/models/wp/wp_product_reviews.dart: -------------------------------------------------------------------------------- 1 | import '../index.dart'; 2 | 3 | class WpProductReviews { 4 | WpProductReviews({ 5 | this.id, 6 | this.dateCreated, 7 | this.formattedDateCreated, 8 | this.dateCreatedGmt, 9 | this.productId, 10 | this.productName, 11 | this.productPermalink, 12 | this.productImage, 13 | this.reviewer, 14 | this.review, 15 | this.rating, 16 | this.verified, 17 | this.reviewerAvatarUrls, 18 | }); 19 | 20 | WpProductReviews.fromJson(dynamic json) { 21 | id = json['id']; 22 | dateCreated = json['date_created']; 23 | formattedDateCreated = json['formatted_date_created']; 24 | dateCreatedGmt = json['date_created_gmt']; 25 | productId = json['product_id']; 26 | productName = json['product_name']; 27 | productPermalink = json['product_permalink']; 28 | productImage = json['product_image'] != null 29 | ? WpProductionImages.fromJson(json['productImage']) 30 | : null; 31 | reviewer = json['reviewer']; 32 | review = json['review']; 33 | rating = json['rating']; 34 | verified = json['verified']; 35 | reviewerAvatarUrls = json['reviewer_avatar_urls']; 36 | } 37 | int? id; 38 | String? dateCreated; 39 | String? formattedDateCreated; 40 | String? dateCreatedGmt; 41 | int? productId; 42 | String? productName; 43 | String? productPermalink; 44 | WpProductionImages? productImage; 45 | String? reviewer; 46 | String? review; 47 | int? rating; 48 | bool? verified; 49 | Map? reviewerAvatarUrls; 50 | 51 | Map toJson() { 52 | final map = {}; 53 | map['id'] = id; 54 | map['date_created'] = dateCreated; 55 | map['formatted_date_created'] = formattedDateCreated; 56 | map['date_created_gmt'] = dateCreatedGmt; 57 | map['product_id'] = productId; 58 | map['product_name'] = productName; 59 | map['product_permalink'] = productPermalink; 60 | if (productImage != null) { 61 | map['product_image'] = productImage?.toJson(); 62 | } 63 | map['reviewer'] = reviewer; 64 | map['review'] = review; 65 | map['rating'] = rating; 66 | map['verified'] = verified; 67 | map['reviewer_avatar_urls'] = reviewerAvatarUrls; 68 | return map; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /assets/svgs/i-coupon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/values/svgs.dart: -------------------------------------------------------------------------------- 1 | class AssetsSvgs { 2 | static const cBagSvg = 'assets/svgs/c-bag.svg'; 3 | static const cBikeSvg = 'assets/svgs/c-bike.svg'; 4 | static const cElectricSvg = 'assets/svgs/c-electric.svg'; 5 | static const cHomeSvg = 'assets/svgs/c-home.svg'; 6 | static const cKidsSvg = 'assets/svgs/c-kids.svg'; 7 | static const cManSvg = 'assets/svgs/c-man.svg'; 8 | static const cMoreSvg = 'assets/svgs/c-more.svg'; 9 | static const cWomanSvg = 'assets/svgs/c-woman.svg'; 10 | static const facebookSvg = 'assets/svgs/facebook.svg'; 11 | static const googleSvg = 'assets/svgs/google.svg'; 12 | static const iAddFriendSvg = 'assets/svgs/i-add-friend.svg'; 13 | static const iAddSvg = 'assets/svgs/i-add.svg'; 14 | static const iArrowBackSvg = 'assets/svgs/i-arrow-back.svg'; 15 | static const iArrowBottomSvg = 'assets/svgs/i-arrow-bottom.svg'; 16 | static const iArrowDownSvg = 'assets/svgs/i-arrow-down.svg'; 17 | static const iArrowLeftUpSvg = 'assets/svgs/i-arrow-left-up.svg'; 18 | static const iArrowRightSvg = 'assets/svgs/i-arrow-right.svg'; 19 | static const iCameraSvg = 'assets/svgs/i-camera.svg'; 20 | static const iCloseSvg = 'assets/svgs/i-close.svg'; 21 | static const iCouponSvg = 'assets/svgs/i-coupon.svg'; 22 | static const iIndicatorsSvg = 'assets/svgs/i-indicators.svg'; 23 | static const iLikeSvg = 'assets/svgs/i-like.svg'; 24 | static const iNotificationsSvg = 'assets/svgs/i-notifications.svg'; 25 | static const iSearchSvg = 'assets/svgs/i-search.svg'; 26 | static const iStarSvg = 'assets/svgs/i-star.svg'; 27 | static const iSubtractSvg = 'assets/svgs/i-subtract.svg'; 28 | static const iTrashSvg = 'assets/svgs/i-trash.svg'; 29 | static const navCartSvg = 'assets/svgs/nav-cart.svg'; 30 | static const navHomeSvg = 'assets/svgs/nav-home.svg'; 31 | static const navMessageSvg = 'assets/svgs/nav-message.svg'; 32 | static const navProfileSvg = 'assets/svgs/nav-profile.svg'; 33 | static const pCurrencySvg = 'assets/svgs/p-currency.svg'; 34 | static const pDeliverySvg = 'assets/svgs/p-delivery.svg'; 35 | static const pGiftSvg = 'assets/svgs/p-gift.svg'; 36 | static const pHomeSvg = 'assets/svgs/p-home.svg'; 37 | static const pNotificationsSvg = 'assets/svgs/p-notifications.svg'; 38 | static const pTranslateSvg = 'assets/svgs/p-translate.svg'; 39 | } 40 | -------------------------------------------------------------------------------- /lib/common/routers/pages.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import '../../pages/index.dart'; 5 | import 'index.dart'; 6 | 7 | class RoutePages { 8 | static final RouteObserver observer = RouteObservers(); 9 | static List history = []; 10 | 11 | static List list = [ 12 | // 样式 13 | GetPage( 14 | name: RouteNames.styleWidgets, 15 | page: () => const WidgetsPage(), 16 | ), 17 | GetPage( 18 | name: RouteNames.styleButtons, 19 | page: () => const ButtonsPage(), 20 | ), 21 | GetPage( 22 | name: RouteNames.styleInputs, 23 | page: () => const InputsPage(), 24 | ), 25 | GetPage( 26 | name: RouteNames.styleTextForm, 27 | page: () => const TextFormPage(), 28 | ), 29 | GetPage( 30 | name: RouteNames.styleGroupList, 31 | page: () => const GroupListPage(), 32 | ), 33 | GetPage( 34 | name: RouteNames.styleOther, 35 | page: () => const OtherPage(), 36 | ), 37 | GetPage( 38 | name: RouteNames.styleComponents, 39 | page: () => const ComponentsPage(), 40 | ), 41 | GetPage( 42 | name: RouteNames.styleBottomSheet, 43 | page: () => const BottomSheetPage(), 44 | ), 45 | GetPage( 46 | name: RouteNames.styleCarousel, 47 | page: () => const CarouselPage(), 48 | ), 49 | 50 | // 无需登录 51 | GetPage( 52 | name: RouteNames.splash, 53 | page: () => const SplashPage(), 54 | ), 55 | GetPage( 56 | name: RouteNames.welcome, 57 | page: () => const WelcomePage(), 58 | ), 59 | GetPage( 60 | name: RouteNames.main, 61 | page: () => const MainPage(), 62 | transitionDuration: Duration.zero, 63 | ), 64 | GetPage( 65 | name: RouteNames.login, 66 | page: () => const LoginPage(), 67 | ), 68 | GetPage( 69 | name: RouteNames.register, 70 | page: () => const RegisterPage(), 71 | ), 72 | GetPage( 73 | name: RouteNames.registerPin, 74 | page: () => const RegisterPinPage(), 75 | ), 76 | GetPage( 77 | name: RouteNames.forgot, 78 | page: () => const ForgotPage(), 79 | ), 80 | GetPage( 81 | name: RouteNames.userAgreement, 82 | page: () => const UserAgreementPage(), 83 | ), 84 | ]; 85 | } 86 | -------------------------------------------------------------------------------- /lib/common/style/lib_color_schemes.g.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const lightColorScheme = ColorScheme( 4 | brightness: Brightness.light, 5 | primary: Color(0xFF2A55CB), 6 | onPrimary: Color(0xFFFFFFFF), 7 | primaryContainer: Color(0xFFDBE1FF), 8 | onPrimaryContainer: Color(0xFF001552), 9 | secondary: Color(0xFF595D71), 10 | onSecondary: Color(0xFFFFFFFF), 11 | secondaryContainer: Color(0xFFDEE1F9), 12 | onSecondaryContainer: Color(0xFF161B2C), 13 | tertiary: Color(0xFF74546F), 14 | onTertiary: Color(0xFFFFFFFF), 15 | tertiaryContainer: Color(0xFFFFD7F7), 16 | onTertiaryContainer: Color(0xFF2B1229), 17 | error: Color(0xFFBA1B1B), 18 | errorContainer: Color(0xFFFFDAD4), 19 | onError: Color(0xFFFFFFFF), 20 | onErrorContainer: Color(0xFF410001), 21 | background: Color(0xFFFEFBFF), 22 | onBackground: Color(0xFF1B1B1F), 23 | surface: Color(0xFFFEFBFF), 24 | onSurface: Color(0xFF1B1B1F), 25 | surfaceVariant: Color(0xFFE2E2ED), 26 | onSurfaceVariant: Color(0xFF45464E), 27 | outline: Color(0xFF75767F), 28 | onInverseSurface: Color(0xFFF3F0F5), 29 | inverseSurface: Color(0xFF303033), 30 | inversePrimary: Color(0xFFB4C4FF), 31 | shadow: Color(0xFF000000), 32 | ); 33 | 34 | const darkColorScheme = ColorScheme( 35 | brightness: Brightness.dark, 36 | primary: Color(0xFFB4C4FF), 37 | onPrimary: Color(0xFF002781), 38 | primaryContainer: Color(0xFF003AB2), 39 | onPrimaryContainer: Color(0xFFDBE1FF), 40 | secondary: Color(0xFFC1C5DC), 41 | onSecondary: Color(0xFF2B3042), 42 | secondaryContainer: Color(0xFF424659), 43 | onSecondaryContainer: Color(0xFFDEE1F9), 44 | tertiary: Color(0xFFE3BADA), 45 | onTertiary: Color(0xFF42273F), 46 | tertiaryContainer: Color(0xFF5B3D57), 47 | onTertiaryContainer: Color(0xFFFFD7F7), 48 | error: Color(0xFFFFB4A9), 49 | errorContainer: Color(0xFF930006), 50 | onError: Color(0xFF680003), 51 | onErrorContainer: Color(0xFFFFDAD4), 52 | background: Color(0xFF1B1B1F), 53 | onBackground: Color(0xFFE4E2E6), 54 | surface: Color(0xFF1B1B1F), 55 | onSurface: Color(0xFFE4E2E6), 56 | surfaceVariant: Color(0xFF45464E), 57 | onSurfaceVariant: Color(0xFFC6C6D0), 58 | outline: Color(0xFF8F909A), 59 | onInverseSurface: Color(0xFF1B1B1F), 60 | inverseSurface: Color(0xFFE4E2E6), 61 | inversePrimary: Color(0xFF2A55CB), 62 | shadow: Color(0xFF000000), 63 | ); 64 | -------------------------------------------------------------------------------- /assets/svgs/nav-message.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svgs/p-translate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/common/widgets/list_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_woo_commerce_getx_ducafecat/common/style/index.dart'; 3 | 4 | import '../extension/index.dart'; 5 | 6 | /// 列表行 ListTile 替代版本 7 | class ListTileWidget extends StatelessWidget { 8 | // 标题/子标题/描述 9 | final Widget? title; 10 | final Widget? subtitle; 11 | final Widget? description; 12 | // 左侧图标 13 | final Widget? leading; 14 | final double? leadingSpace; 15 | // 右侧图标 16 | final List? trailing; 17 | 18 | final EdgeInsetsGeometry? padding; 19 | final CrossAxisAlignment? crossAxisAlignment; 20 | final GestureTapCallback? onTap; 21 | final GestureLongPressCallback? onLongPress; 22 | 23 | ListTileWidget({ 24 | Key? key, 25 | this.title, 26 | this.subtitle, 27 | this.description, 28 | this.leading, 29 | this.leadingSpace, 30 | this.trailing, 31 | EdgeInsetsGeometry? padding, 32 | this.crossAxisAlignment, 33 | this.onTap, 34 | this.onLongPress, 35 | }) : padding = padding ?? AppSpace.edgeInput, 36 | super(key: key); 37 | 38 | _buildView() { 39 | List ws = []; 40 | 41 | // 头部图标 42 | if (leading != null) { 43 | ws.add( 44 | leading!.paddingRight( 45 | leadingSpace ?? AppSpace.iconTextSmail, 46 | ), 47 | ); 48 | } 49 | 50 | // 标题/子标题/描述 51 | ws.add( 52 | [ 53 | if (title != null) title!, 54 | if (subtitle != null) subtitle!, 55 | if (description != null) description!, 56 | ] 57 | .toColumn( 58 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 59 | crossAxisAlignment: CrossAxisAlignment.start, 60 | ) 61 | .expanded(), 62 | ); 63 | 64 | // 右侧图标 65 | if (trailing != null) { 66 | ws.add( 67 | trailing!.toColumn( 68 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 69 | ), 70 | ); 71 | } 72 | 73 | return ws 74 | .toRow( 75 | crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.center, 76 | ) 77 | // .backgroundColor(AppColors.background) 78 | .padding(value: padding) 79 | .onTap(onTap) 80 | .onLongPress(onLongPress); 81 | } 82 | 83 | @override 84 | Widget build(BuildContext context) { 85 | return _buildView(); 86 | } 87 | } 88 | --------------------------------------------------------------------------------