├── lib ├── modules │ ├── me │ │ ├── me.dart │ │ └── cards │ │ │ ├── bank_card_box.dart │ │ │ └── cards_screen.dart │ ├── modules.dart │ ├── splash │ │ ├── splash.dart │ │ ├── splash_binding.dart │ │ ├── splash_controller.dart │ │ └── splash_screen.dart │ ├── home │ │ ├── home.dart │ │ ├── tabs │ │ │ ├── tabs.dart │ │ │ ├── discover_tab.dart │ │ │ ├── resource_tab.dart │ │ │ └── main_tab.dart │ │ ├── home_binding.dart │ │ ├── home_controller.dart │ │ └── home_screen.dart │ └── auth │ │ ├── auth.dart │ │ ├── auth_binding.dart │ │ ├── auth_screen.dart │ │ ├── login_screen.dart │ │ └── auth_controller.dart ├── routes │ ├── routes.dart │ ├── app_routes.dart │ └── app_pages.dart ├── theme │ └── theme.dart ├── lang │ ├── lang.dart │ ├── en_US.dart │ ├── pt_BR.dart │ └── translation_service.dart ├── shared │ ├── services │ │ ├── services.dart │ │ └── storage_service.dart │ ├── constants │ │ ├── r.dart │ │ ├── constants.dart │ │ ├── storage.dart │ │ ├── common.dart │ │ └── colors.dart │ ├── shared.dart │ ├── utils │ │ ├── utils.dart │ │ ├── regex.dart │ │ ├── navigator_helper.dart │ │ ├── focus.dart │ │ ├── common_widget.dart │ │ └── size_config.dart │ └── widgets │ │ ├── widgets.dart │ │ ├── msg │ │ ├── msg_arrow_painter.dart │ │ ├── msg_box.dart │ │ ├── send_msg_box.dart │ │ └── receive_msg_box.dart │ │ ├── app_check_box.dart │ │ ├── gradient_button.dart │ │ ├── focused_menu │ │ ├── focused_menu_holder.dart │ │ └── focused_menu_details.dart │ │ ├── input_field.dart │ │ ├── icon_title_item.dart │ │ ├── gradient_background.dart │ │ └── border_button.dart ├── api │ ├── api_constants.dart │ ├── api.dart │ ├── base_provider.dart │ ├── interceptors │ │ ├── auth_interceptor.dart │ │ ├── request_interceptor.dart │ │ └── response_interceptor.dart │ ├── api_provider.dart │ └── api_repository.dart ├── models │ ├── models.dart │ ├── response │ │ ├── error_response.dart │ │ ├── login_response.dart │ │ ├── register_response.dart │ │ └── users_response.dart │ ├── request │ │ ├── login_request.dart │ │ └── register_request.dart │ └── bank_card.dart ├── di.dart ├── app_binding.dart └── main.dart ├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── CMakeLists.txt └── my_application.h ├── .fvm └── fvm_config.json ├── .fvmrc ├── 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 │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── RunnerTests │ └── RunnerTests.swift ├── .gitignore ├── Podfile └── Podfile.lock ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── manifest.json └── index.html ├── macos ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.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 │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── RunnerTests │ └── RunnerTests.swift └── Podfile ├── assets ├── screenshot │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ ├── 8.jpg │ ├── 9.jpg │ ├── qq.jpg │ ├── chat.gif │ ├── chat.mp4 │ ├── weixin.png │ └── wechatpay.jpg ├── images │ ├── card_visa.png │ ├── card_master.png │ └── icon_success.png └── svgs │ ├── icon_home.svg │ ├── icon_discover.svg │ ├── icon_discover_activited.svg │ ├── icon_home_activited.svg │ ├── icon_inbox.svg │ ├── icon_sign_out.svg │ ├── icon_inbox_activited.svg │ ├── icon_me.svg │ ├── icon_resource.svg │ └── icon_me_activited.svg ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── runner.exe.manifest │ ├── utils.h │ ├── flutter_window.h │ ├── main.cpp │ ├── CMakeLists.txt │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ └── win32_window.h ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── .gitignore ├── 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_getx_boilerplate │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── settings.gradle ├── .vscode └── settings.json ├── .metadata ├── .gitignore ├── LICENSE ├── test └── widget_test.dart ├── analysis_options.yaml ├── pubspec.yaml ├── README.zh-cn.md └── README.ko-kr.md /lib/modules/me/me.dart: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /lib/routes/routes.dart: -------------------------------------------------------------------------------- 1 | export 'app_pages.dart'; 2 | -------------------------------------------------------------------------------- /lib/theme/theme.dart: -------------------------------------------------------------------------------- 1 | export 'theme_data.dart'; 2 | -------------------------------------------------------------------------------- /lib/lang/lang.dart: -------------------------------------------------------------------------------- 1 | export 'translation_service.dart'; 2 | -------------------------------------------------------------------------------- /lib/modules/modules.dart: -------------------------------------------------------------------------------- 1 | export 'splash/splash.dart'; 2 | -------------------------------------------------------------------------------- /.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "3.24.3" 3 | } -------------------------------------------------------------------------------- /.fvmrc: -------------------------------------------------------------------------------- 1 | { 2 | "flutter": "3.24.3", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /lib/shared/services/services.dart: -------------------------------------------------------------------------------- 1 | export 'storage_service.dart'; 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/shared/constants/r.dart: -------------------------------------------------------------------------------- 1 | class R { 2 | static final String assetsTODO = ''; 3 | } 4 | -------------------------------------------------------------------------------- /lib/api/api_constants.dart: -------------------------------------------------------------------------------- 1 | class ApiConstants { 2 | static const baseUrl = 'https://reqres.in'; 3 | } 4 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/web/favicon.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /assets/screenshot/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/1.jpg -------------------------------------------------------------------------------- /assets/screenshot/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/2.jpg -------------------------------------------------------------------------------- /assets/screenshot/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/3.jpg -------------------------------------------------------------------------------- /assets/screenshot/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/4.jpg -------------------------------------------------------------------------------- /assets/screenshot/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/5.jpg -------------------------------------------------------------------------------- /assets/screenshot/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/6.jpg -------------------------------------------------------------------------------- /assets/screenshot/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/7.jpg -------------------------------------------------------------------------------- /assets/screenshot/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/8.jpg -------------------------------------------------------------------------------- /assets/screenshot/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/9.jpg -------------------------------------------------------------------------------- /assets/screenshot/qq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/qq.jpg -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /assets/images/card_visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/images/card_visa.png -------------------------------------------------------------------------------- /assets/screenshot/chat.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/chat.gif -------------------------------------------------------------------------------- /assets/screenshot/chat.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/chat.mp4 -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /assets/images/card_master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/images/card_master.png -------------------------------------------------------------------------------- /assets/screenshot/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/weixin.png -------------------------------------------------------------------------------- /lib/modules/splash/splash.dart: -------------------------------------------------------------------------------- 1 | export 'splash_binding.dart'; 2 | export 'splash_controller.dart'; 3 | export 'splash_screen.dart'; 4 | -------------------------------------------------------------------------------- /lib/shared/constants/constants.dart: -------------------------------------------------------------------------------- 1 | export 'colors.dart'; 2 | export 'common.dart'; 3 | export 'r.dart'; 4 | export 'storage.dart'; 5 | -------------------------------------------------------------------------------- /assets/images/icon_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/images/icon_success.png -------------------------------------------------------------------------------- /assets/screenshot/wechatpay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/assets/screenshot/wechatpay.jpg -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /lib/modules/home/home.dart: -------------------------------------------------------------------------------- 1 | export 'tabs/tabs.dart'; 2 | export 'home_binding.dart'; 3 | export 'home_controller.dart'; 4 | export 'home_screen.dart'; 5 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /lib/shared/constants/storage.dart: -------------------------------------------------------------------------------- 1 | class StorageConstants { 2 | static final String token = 'token'; 3 | static final String userInfo = 'userInfo'; 4 | } 5 | -------------------------------------------------------------------------------- /lib/shared/shared.dart: -------------------------------------------------------------------------------- 1 | export 'constants/constants.dart'; 2 | export 'services/services.dart'; 3 | export 'utils/utils.dart'; 4 | export 'widgets/widgets.dart'; 5 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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/shared/utils/utils.dart: -------------------------------------------------------------------------------- 1 | export 'common_widget.dart'; 2 | export 'focus.dart'; 3 | export 'navigator_helper.dart'; 4 | export 'regex.dart'; 5 | export 'size_config.dart'; 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/modules/auth/auth.dart: -------------------------------------------------------------------------------- 1 | export 'auth_binding.dart'; 2 | export 'auth_controller.dart'; 3 | export 'auth_screen.dart'; 4 | export 'login_screen.dart'; 5 | export 'register_screen.dart'; 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dart.flutterSdkPath": ".fvm/versions/3.24.3", 3 | "search.exclude": { 4 | "**/.fvm": true 5 | }, 6 | "files.watcherExclude": { 7 | "**/.fvm": true 8 | } 9 | } -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /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/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinZhang19870314/flutter_getx_boilerplate/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/KevinZhang19870314/flutter_getx_boilerplate/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/shared/utils/regex.dart: -------------------------------------------------------------------------------- 1 | class Regex { 2 | static bool isEmail(String email) { 3 | RegExp regExp = new RegExp(r'\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*'); 4 | return regExp.hasMatch(email); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_getx_boilerplate/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_getx_boilerplate 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /lib/modules/home/tabs/tabs.dart: -------------------------------------------------------------------------------- 1 | export 'discover_tab.dart'; 2 | export 'inbox_tab.dart'; 3 | export 'main_tab.dart'; 4 | export 'me_tab.dart'; 5 | export 'resource_tab.dart'; 6 | 7 | enum MainTabs { home, discover, resource, inbox, me } 8 | -------------------------------------------------------------------------------- /lib/models/models.dart: -------------------------------------------------------------------------------- 1 | export 'request/login_request.dart'; 2 | export 'request/register_request.dart'; 3 | 4 | export 'response/error_response.dart'; 5 | export 'response/login_response.dart'; 6 | export 'response/register_response.dart'; 7 | -------------------------------------------------------------------------------- /lib/di.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import 'shared/services/services.dart'; 4 | 5 | class DenpendencyInjection { 6 | static Future init() async { 7 | await Get.putAsync(() => StorageService().init()); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /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/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip 6 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /lib/api/api.dart: -------------------------------------------------------------------------------- 1 | export 'api_constants.dart'; 2 | export 'api_provider.dart'; 3 | export 'api_repository.dart'; 4 | export 'interceptors/auth_interceptor.dart'; 5 | export 'interceptors/request_interceptor.dart'; 6 | export 'interceptors/response_interceptor.dart'; 7 | -------------------------------------------------------------------------------- /lib/shared/constants/common.dart: -------------------------------------------------------------------------------- 1 | class CommonConstants { 2 | static const String test = 'test'; 3 | static const num testNum = 1; 4 | static const double largeText = 40.0; 5 | static const double normalText = 22.0; 6 | static const double smallText = 16.0; 7 | } 8 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/modules/splash/splash_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'splash_controller.dart'; 3 | 4 | class SplashBinding extends Bindings { 5 | @override 6 | void dependencies() { 7 | Get.put(SplashController()); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/modules/home/tabs/discover_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DiscoverTab extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Container( 7 | child: Text('discover'), 8 | ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/modules/home/tabs/resource_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ResourceTab extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Container( 7 | child: Text('resource'), 8 | ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/shared/services/storage_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | 4 | class StorageService extends GetxService { 5 | Future init() async { 6 | return await SharedPreferences.getInstance(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/shared/widgets/widgets.dart: -------------------------------------------------------------------------------- 1 | export 'app_check_box.dart'; 2 | export 'border_button.dart'; 3 | export 'gradient_background.dart'; 4 | export 'gradient_button.dart'; 5 | export 'icon_title_item.dart'; 6 | export 'input_field.dart'; 7 | export 'msg/send_msg_box.dart'; 8 | export 'msg/receive_msg_box.dart'; 9 | -------------------------------------------------------------------------------- /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/shared/utils/navigator_helper.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class NavigatorHelper { 4 | static void popLastScreens({ 5 | required int popCount, 6 | }) { 7 | int count = 0; 8 | while (count < popCount) { 9 | Get.back(); 10 | count++; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/modules/auth/auth_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import 'auth_controller.dart'; 4 | 5 | class AuthBinding implements Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => AuthController(apiRepository: Get.find())); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/modules/home/home_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import 'home_controller.dart'; 4 | 5 | class HomeBinding implements Bindings { 6 | @override 7 | void dependencies() { 8 | Get.lazyPut( 9 | () => HomeController(apiRepository: Get.find())); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/routes/app_routes.dart: -------------------------------------------------------------------------------- 1 | part of 'app_pages.dart'; 2 | 3 | abstract class Routes { 4 | static const SPLASH = '/'; 5 | static const AUTH = '/auth'; 6 | static const LOGIN = '/login'; 7 | static const REGISTER = '/register'; 8 | static const HOME = '/home'; 9 | static const CARDS = '/cards'; 10 | } 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/to/reference-keystore 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/shared/utils/focus.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | class AppFocus { 4 | static void unfocus(BuildContext context) { 5 | FocusScopeNode currentFocus = FocusScope.of(context); 6 | 7 | if (!currentFocus.hasPrimaryFocus) { 8 | currentFocus.unfocus(); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.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 | -------------------------------------------------------------------------------- /lib/app_binding.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_getx_boilerplate/api/api.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class AppBinding extends Bindings { 5 | @override 6 | void dependencies() async { 7 | Get.put(ApiProvider(), permanent: true); 8 | Get.put(ApiRepository(apiProvider: Get.find()), permanent: true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.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: 4d7946a68d26794349189cf21b3f68cc6fe61dcb 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/lang/en_US.dart: -------------------------------------------------------------------------------- 1 | const Map en_US = { 2 | 'covid': 'Corona Virus', 3 | 'total_confirmed': 'Total Confirmed', 4 | 'total_deaths': 'Total Deaths', 5 | 'fetch_country': 'Fetch by country', 6 | 'corona_by_country': 'Corona by country', 7 | 'total_infecteds': 'Total Infecteds', 8 | 'details': 'Details', 9 | 'total_recovered': 'Total Recovered', 10 | }; 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/lang/pt_BR.dart: -------------------------------------------------------------------------------- 1 | const Map pt_BR = { 2 | 'covid': 'Corona Vírus', 3 | 'total_confirmed': 'Total confirmado', 4 | 'total_deaths': 'Total de mortes', 5 | 'fetch_country': 'Listar por país', 6 | 'corona_by_country': 'Corona por país', 7 | 'total_infecteds': 'Total de infectados', 8 | 'details': 'Detalhes', 9 | 'total_recovered': 'Total de recuperados' 10 | }; 11 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = "../build" 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(":app") 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /lib/api/base_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | import 'api.dart'; 4 | 5 | class BaseProvider extends GetConnect { 6 | @override 7 | void onInit() { 8 | httpClient.baseUrl = ApiConstants.baseUrl; 9 | httpClient.addAuthenticator(authInterceptor); 10 | httpClient.addRequestModifier(requestInterceptor); 11 | httpClient.addResponseModifier(responseInterceptor); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 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 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/api/interceptors/auth_interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:get/get_connect/http/src/request/request.dart'; 4 | 5 | FutureOr authInterceptor(request) async { 6 | // final token = StorageService.box.pull(StorageItems.accessToken); 7 | 8 | // request.headers['X-Requested-With'] = 'XMLHttpRequest'; 9 | // request.headers['Authorization'] = 'Bearer $token'; 10 | 11 | return request; 12 | } 13 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @main 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 | -------------------------------------------------------------------------------- /lib/lang/translation_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | import 'en_US.dart'; 5 | import 'pt_BR.dart'; 6 | 7 | class TranslationService extends Translations { 8 | static Locale? get locale => Get.deviceLocale; 9 | static final fallbackLocale = Locale('en', 'US'); 10 | @override 11 | Map> get keys => { 12 | 'en_US': en_US, 13 | 'pt_BR': pt_BR, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /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() 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 | -------------------------------------------------------------------------------- /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/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/api/api_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_getx_boilerplate/api/base_provider.dart'; 2 | import 'package:flutter_getx_boilerplate/models/models.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | class ApiProvider extends BaseProvider { 6 | Future login(String path, LoginRequest data) { 7 | return post(path, data.toJson()); 8 | } 9 | 10 | Future register(String path, RegisterRequest data) { 11 | return post(path, data.toJson()); 12 | } 13 | 14 | Future getUsers(String path) { 15 | return get(path); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/models/response/error_response.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class ErrorResponse { 4 | ErrorResponse({ 5 | required this.error, 6 | }); 7 | 8 | String error; 9 | 10 | factory ErrorResponse.fromRawJson(String str) => 11 | ErrorResponse.fromJson(json.decode(str)); 12 | 13 | String toRawJson() => json.encode(toJson()); 14 | 15 | factory ErrorResponse.fromJson(Map json) => ErrorResponse( 16 | error: json["error"], 17 | ); 18 | 19 | Map toJson() => { 20 | "error": error, 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /lib/models/response/login_response.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class LoginResponse { 4 | LoginResponse({ 5 | required this.token, 6 | }); 7 | 8 | String token; 9 | 10 | factory LoginResponse.fromRawJson(String str) => 11 | LoginResponse.fromJson(json.decode(str)); 12 | 13 | String toRawJson() => json.encode(toJson()); 14 | 15 | factory LoginResponse.fromJson(Map json) => LoginResponse( 16 | token: json["token"], 17 | ); 18 | 19 | Map toJson() => { 20 | "token": token, 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /lib/shared/widgets/msg/msg_arrow_painter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MsgArrowPainter extends CustomPainter { 4 | final Color bgColor; 5 | 6 | MsgArrowPainter(this.bgColor); 7 | 8 | @override 9 | void paint(Canvas canvas, Size size) { 10 | var paint = Paint()..color = bgColor; 11 | 12 | var path = Path(); 13 | path.lineTo(-5, 0); 14 | path.lineTo(0, 10); 15 | path.lineTo(5, 0); 16 | canvas.drawPath(path, paint); 17 | } 18 | 19 | @override 20 | bool shouldRepaint(CustomPainter oldDelegate) { 21 | return false; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import path_provider_foundation 9 | import shared_preferences_foundation 10 | import sqflite 11 | 12 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 14 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 15 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 16 | } 17 | -------------------------------------------------------------------------------- /lib/shared/widgets/msg/msg_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | abstract class MsgBox extends StatelessWidget { 4 | final AnimationController animationController; 5 | 6 | const MsgBox({Key? key, required this.animationController}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return SizeTransition( 11 | sizeFactor: CurvedAnimation( 12 | parent: animationController, 13 | curve: Curves.easeOut, 14 | ), 15 | axisAlignment: 0.0, 16 | child: buildWidgets(context), 17 | ); 18 | } 19 | 20 | Widget buildWidgets(BuildContext context); 21 | } 22 | -------------------------------------------------------------------------------- /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/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/models/request/login_request.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class LoginRequest { 4 | LoginRequest({ 5 | required this.email, 6 | required this.password, 7 | }); 8 | 9 | String email; 10 | String password; 11 | 12 | factory LoginRequest.fromRawJson(String str) => 13 | LoginRequest.fromJson(json.decode(str)); 14 | 15 | String toRawJson() => json.encode(toJson()); 16 | 17 | factory LoginRequest.fromJson(Map json) => LoginRequest( 18 | email: json["email"], 19 | password: json["password"], 20 | ); 21 | 22 | Map toJson() => { 23 | "email": email, 24 | "password": password, 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /lib/models/response/register_response.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class RegisterResponse { 4 | RegisterResponse({ 5 | required this.id, 6 | required this.token, 7 | }); 8 | 9 | int id; 10 | String token; 11 | 12 | factory RegisterResponse.fromRawJson(String str) => 13 | RegisterResponse.fromJson(json.decode(str)); 14 | 15 | String toRawJson() => json.encode(toJson()); 16 | 17 | factory RegisterResponse.fromJson(Map json) => 18 | RegisterResponse( 19 | id: json["id"], 20 | token: json["token"], 21 | ); 22 | 23 | Map toJson() => { 24 | "id": id, 25 | "token": token, 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /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_getx_boilerplate 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterGetxBoilerplate 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /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/models/request/register_request.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class RegisterRequest { 4 | RegisterRequest({ 5 | required this.email, 6 | required this.password, 7 | }); 8 | 9 | String email; 10 | String password; 11 | 12 | factory RegisterRequest.fromRawJson(String str) => 13 | RegisterRequest.fromJson(json.decode(str)); 14 | 15 | String toRawJson() => json.encode(toJson()); 16 | 17 | factory RegisterRequest.fromJson(Map json) => 18 | RegisterRequest( 19 | email: json["email"], 20 | password: json["password"], 21 | ); 22 | 23 | Map toJson() => { 24 | "email": email, 25 | "password": password, 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /lib/api/interceptors/request_interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 5 | import 'package:get/get_connect/http/src/request/request.dart'; 6 | 7 | FutureOr requestInterceptor(request) async { 8 | // final token = StorageService.box.pull(StorageItems.accessToken); 9 | 10 | // request.headers['X-Requested-With'] = 'XMLHttpRequest'; 11 | // request.headers['Authorization'] = 'Bearer $token'; 12 | 13 | EasyLoading.show(status: 'loading...'); 14 | requestlLogger(request); 15 | return request; 16 | } 17 | 18 | void requestlLogger(Request request) { 19 | debugPrint('Url: ${request.method} ${request.url}\n'); 20 | } 21 | -------------------------------------------------------------------------------- /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/modules/splash/splash_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_getx_boilerplate/routes/routes.dart'; 2 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | 6 | class SplashController extends GetxController { 7 | @override 8 | void onReady() async { 9 | super.onReady(); 10 | 11 | await Future.delayed(Duration(milliseconds: 2000)); 12 | var storage = Get.find(); 13 | try { 14 | if (storage.getString(StorageConstants.token) != null) { 15 | Get.toNamed(Routes.HOME); 16 | } else { 17 | Get.toNamed(Routes.AUTH); 18 | } 19 | } catch (e) { 20 | Get.toNamed(Routes.AUTH); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/modules/splash/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 3 | 4 | class SplashScreen extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | SizeConfig().init(context); 8 | return Container( 9 | color: Colors.white, 10 | child: Column( 11 | mainAxisAlignment: MainAxisAlignment.center, 12 | children: [ 13 | Icon( 14 | Icons.hourglass_bottom, 15 | color: ColorConstants.darkGray, 16 | size: 30.0, 17 | ), 18 | Text( 19 | 'loading...', 20 | style: TextStyle(fontSize: 30.0), 21 | ), 22 | ], 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.1.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.8.22" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/shared/constants/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ColorConstants { 4 | static Color lightScaffoldBackgroundColor = hexToColor('#F9F9F9'); 5 | static Color darkScaffoldBackgroundColor = hexToColor('#2F2E2E'); 6 | static Color secondaryAppColor = hexToColor('#22DDA6'); 7 | static Color secondaryDarkAppColor = Colors.white; 8 | static Color tipColor = hexToColor('#B6B6B6'); 9 | static Color lightGray = Color(0xFFF6F6F6); 10 | static Color darkGray = Color(0xFF9F9F9F); 11 | static Color black = Color(0xFF000000); 12 | static Color white = Color(0xFFFFFFFF); 13 | } 14 | 15 | Color hexToColor(String hex) { 16 | assert(RegExp(r'^#([0-9a-fA-F]{6})|([0-9a-fA-F]{8})$').hasMatch(hex), 17 | 'hex color must be #rrggbb or #rrggbbaa'); 18 | 19 | return Color( 20 | int.parse(hex.substring(1), radix: 16) + 21 | (hex.length == 7 ? 0xff000000 : 0x00000000), 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /.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 | 48 | # FVM Version Cache 49 | .fvm/ -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/api/api_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter_getx_boilerplate/models/models.dart'; 4 | import 'package:flutter_getx_boilerplate/models/response/users_response.dart'; 5 | 6 | import 'api.dart'; 7 | 8 | class ApiRepository { 9 | ApiRepository({required this.apiProvider}); 10 | 11 | final ApiProvider apiProvider; 12 | 13 | Future login(LoginRequest data) async { 14 | final res = await apiProvider.login('/api/login', data); 15 | if (res.statusCode == 200) { 16 | return LoginResponse.fromJson(res.body); 17 | } 18 | } 19 | 20 | Future register(RegisterRequest data) async { 21 | final res = await apiProvider.register('/api/register', data); 22 | if (res.statusCode == 200) { 23 | return RegisterResponse.fromJson(res.body); 24 | } 25 | } 26 | 27 | Future getUsers() async { 28 | final res = await apiProvider.getUsers('/api/users?page=1&per_page=12'); 29 | if (res.statusCode == 200) { 30 | return UsersResponse.fromJson(res.body); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_getx_boilerplate", 3 | "short_name": "flutter_getx_boilerplate", 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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Kevin Zhang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/routes/app_pages.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_getx_boilerplate/modules/auth/auth.dart'; 2 | import 'package:flutter_getx_boilerplate/modules/home/home.dart'; 3 | import 'package:flutter_getx_boilerplate/modules/me/cards/cards_screen.dart'; 4 | import 'package:flutter_getx_boilerplate/modules/modules.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | part 'app_routes.dart'; 8 | 9 | class AppPages { 10 | static const INITIAL = Routes.SPLASH; 11 | 12 | static final routes = [ 13 | GetPage( 14 | name: Routes.SPLASH, 15 | page: () => SplashScreen(), 16 | binding: SplashBinding(), 17 | ), 18 | GetPage( 19 | name: Routes.AUTH, 20 | page: () => AuthScreen(), 21 | binding: AuthBinding(), 22 | children: [ 23 | GetPage(name: Routes.REGISTER, page: () => RegisterScreen()), 24 | GetPage(name: Routes.LOGIN, page: () => LoginScreen()), 25 | ], 26 | ), 27 | GetPage( 28 | name: Routes.HOME, 29 | page: () => HomeScreen(), 30 | binding: HomeBinding(), 31 | children: [ 32 | GetPage(name: Routes.CARDS, page: () => CardsScreen()), 33 | ]), 34 | ]; 35 | } 36 | -------------------------------------------------------------------------------- /lib/modules/me/cards/bank_card_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 3 | 4 | class BankCardBox extends StatelessWidget { 5 | const BankCardBox({ 6 | Key? key, 7 | required this.cardType, 8 | required this.cardNum, 9 | }) : super(key: key); 10 | 11 | final String? cardType; 12 | final String? cardNum; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Stack( 17 | children: [ 18 | cardType == 'VISA' 19 | ? Image.asset('assets/images/card_visa.png') 20 | : Image.asset('assets/images/card_master.png'), 21 | Positioned( 22 | width: SizeConfig().screenWidth, 23 | bottom: SizeConfig().screenWidth * 0.1, 24 | child: Text( 25 | '•••• •••• •••• $cardNum', 26 | style: TextStyle( 27 | color: Colors.white, 28 | fontSize: 24, 29 | fontFamily: 'Rubik', 30 | fontWeight: FontWeight.w600), 31 | textAlign: TextAlign.center, 32 | ), 33 | ), 34 | ], 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/api/interceptors/response_interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 5 | import 'package:flutter_getx_boilerplate/models/models.dart'; 6 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 7 | import 'package:get/get.dart'; 8 | import 'package:get/get_connect/http/src/request/request.dart'; 9 | 10 | FutureOr responseInterceptor( 11 | Request request, Response response) async { 12 | EasyLoading.dismiss(); 13 | responseLogger(response); 14 | if (response.statusCode != 200) { 15 | handleErrorStatus(response); 16 | return; 17 | } 18 | 19 | return response; 20 | } 21 | 22 | void handleErrorStatus(Response response) { 23 | switch (response.statusCode) { 24 | case 400: 25 | final message = ErrorResponse.fromJson(response.body); 26 | CommonWidget.toast(message.error); 27 | break; 28 | default: 29 | } 30 | 31 | return; 32 | } 33 | 34 | void responseLogger(Response response) { 35 | debugPrint('Status Code: ${response.statusCode}\n'); 36 | debugPrint('Data: ${response.bodyString?.toString() ?? ''}'); 37 | } 38 | -------------------------------------------------------------------------------- /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 in the flutter_test package. 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_getx_boilerplate/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(App()); 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 | -------------------------------------------------------------------------------- /assets/svgs/icon_home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 编组 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/svgs/icon_discover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 发现 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | flutter_getx_boilerplate 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"flutter_getx_boilerplate", 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 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /lib/shared/utils/common_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fluttertoast/fluttertoast.dart'; 3 | 4 | class CommonWidget { 5 | static AppBar appBar( 6 | BuildContext context, String title, IconData? backIcon, Color color, 7 | {void Function()? callback}) { 8 | return AppBar( 9 | leading: backIcon == null 10 | ? null 11 | : IconButton( 12 | icon: Icon(backIcon, color: color), 13 | onPressed: () { 14 | if (callback != null) { 15 | callback(); 16 | } else { 17 | Navigator.pop(context); 18 | } 19 | }, 20 | ), 21 | centerTitle: true, 22 | title: Text( 23 | title, 24 | style: TextStyle(color: color, fontFamily: 'Rubik'), 25 | ), 26 | backgroundColor: Colors.transparent, 27 | elevation: 0.0, 28 | ); 29 | } 30 | 31 | static SizedBox rowHeight({double height = 30}) { 32 | return SizedBox(height: height); 33 | } 34 | 35 | static SizedBox rowWidth({double width = 30}) { 36 | return SizedBox(width: width); 37 | } 38 | 39 | static void toast(String error) async { 40 | await Fluttertoast.showToast( 41 | msg: error, 42 | toastLength: Toast.LENGTH_SHORT, 43 | gravity: ToastGravity.BOTTOM, 44 | timeInSecForIosWeb: 3, 45 | backgroundColor: Colors.white, 46 | textColor: Colors.black, 47 | fontSize: 16.0); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 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 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id "dev.flutter.flutter-gradle-plugin" 6 | } 7 | 8 | android { 9 | namespace = "com.example.flutter_getx_boilerplate" 10 | compileSdk = flutter.compileSdkVersion 11 | ndkVersion = flutter.ndkVersion 12 | 13 | compileOptions { 14 | sourceCompatibility = JavaVersion.VERSION_1_8 15 | targetCompatibility = JavaVersion.VERSION_1_8 16 | } 17 | 18 | kotlinOptions { 19 | jvmTarget = JavaVersion.VERSION_1_8 20 | } 21 | 22 | defaultConfig { 23 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 24 | applicationId = "com.example.flutter_getx_boilerplate" 25 | // You can update the following values to match your application needs. 26 | // For more information, see: https://flutter.dev/to/review-gradle-config. 27 | minSdk = flutter.minSdkVersion 28 | targetSdk = flutter.targetSdkVersion 29 | versionCode = flutter.versionCode 30 | versionName = flutter.versionName 31 | } 32 | 33 | buildTypes { 34 | release { 35 | // TODO: Add your own signing config for the release build. 36 | // Signing with the debug keys for now, so `flutter run --release` works. 37 | signingConfig = signingConfigs.debug 38 | } 39 | } 40 | } 41 | 42 | flutter { 43 | source = "../.." 44 | } 45 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /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/shared/widgets/app_check_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../shared.dart'; 4 | 5 | class AppCheckbox extends StatefulWidget { 6 | final String? label; 7 | final bool? checked; 8 | final Function(bool?)? onChecked; 9 | 10 | AppCheckbox({this.label, this.checked, this.onChecked}); 11 | 12 | @override 13 | _AppCheckboxState createState() => _AppCheckboxState(); 14 | } 15 | 16 | class _AppCheckboxState extends State { 17 | bool? _checked = false; 18 | 19 | void _onChecked(bool? checked) { 20 | print(checked); 21 | setState(() { 22 | this._checked = checked; 23 | }); 24 | 25 | if (widget.onChecked != null) { 26 | widget.onChecked!(checked); 27 | } 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return SafeArea( 33 | child: Row( 34 | crossAxisAlignment: CrossAxisAlignment.start, 35 | children: [ 36 | SizedBox( 37 | width: 24.0, 38 | height: 24.0, 39 | child: Checkbox( 40 | value: _checked, 41 | materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, 42 | onChanged: _onChecked), 43 | ), 44 | CommonWidget.rowWidth(width: 10.0), 45 | Flexible( 46 | child: Text( 47 | widget.label!, 48 | textAlign: TextAlign.left, 49 | style: TextStyle( 50 | fontSize: 13.0, 51 | color: Colors.white, 52 | ), 53 | ), 54 | ), 55 | ], 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /assets/svgs/icon_discover_activited.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 发现 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - fluttertoast (0.0.2): 4 | - Flutter 5 | - Toast 6 | - path_provider_foundation (0.0.1): 7 | - Flutter 8 | - FlutterMacOS 9 | - shared_preferences_foundation (0.0.1): 10 | - Flutter 11 | - FlutterMacOS 12 | - sqflite (0.0.3): 13 | - Flutter 14 | - FlutterMacOS 15 | - Toast (4.1.1) 16 | 17 | DEPENDENCIES: 18 | - Flutter (from `Flutter`) 19 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) 20 | - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) 21 | - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) 22 | - sqflite (from `.symlinks/plugins/sqflite/darwin`) 23 | 24 | SPEC REPOS: 25 | trunk: 26 | - Toast 27 | 28 | EXTERNAL SOURCES: 29 | Flutter: 30 | :path: Flutter 31 | fluttertoast: 32 | :path: ".symlinks/plugins/fluttertoast/ios" 33 | path_provider_foundation: 34 | :path: ".symlinks/plugins/path_provider_foundation/darwin" 35 | shared_preferences_foundation: 36 | :path: ".symlinks/plugins/shared_preferences_foundation/darwin" 37 | sqflite: 38 | :path: ".symlinks/plugins/sqflite/darwin" 39 | 40 | SPEC CHECKSUMS: 41 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 42 | fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c 43 | path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 44 | shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 45 | sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec 46 | Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e 47 | 48 | PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 49 | 50 | COCOAPODS: 1.15.2 51 | -------------------------------------------------------------------------------- /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/icon_home_activited.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_home 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /assets/svgs/icon_inbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_inbox 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/models/bank_card.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class BankCard { 4 | String? cardNumber; 5 | String? cardNumberM; 6 | String? cardBrand; 7 | BankCard({ 8 | this.cardNumber, 9 | this.cardNumberM, 10 | this.cardBrand, 11 | }); 12 | 13 | BankCard copyWith({ 14 | String? cardNumber, 15 | String? cardNumberM, 16 | String? cardBrand, 17 | }) { 18 | return BankCard( 19 | cardNumber: cardNumber ?? this.cardNumber, 20 | cardNumberM: cardNumberM ?? this.cardNumberM, 21 | cardBrand: cardBrand ?? this.cardBrand, 22 | ); 23 | } 24 | 25 | Map toMap() { 26 | return { 27 | 'cardNumber': cardNumber, 28 | 'cardNumberM': cardNumberM, 29 | 'cardBrand': cardBrand, 30 | }; 31 | } 32 | 33 | factory BankCard.fromMap(Map map) { 34 | return BankCard( 35 | cardNumber: map['cardNumber'], 36 | cardNumberM: map['cardNumberM'], 37 | cardBrand: map['cardBrand'], 38 | ); 39 | } 40 | 41 | String toJson() => json.encode(toMap()); 42 | 43 | BankCard.fromJson(Map json) { 44 | cardNumber = json['cardNumber']; 45 | cardNumberM = json['cardNumberM']; 46 | cardBrand = json['cardBrand']; 47 | } 48 | 49 | @override 50 | String toString() => 51 | 'BankCard(cardNumber: $cardNumber, cardNumberM: $cardNumberM, cardBrand: $cardBrand)'; 52 | 53 | @override 54 | bool operator ==(Object other) { 55 | if (identical(this, other)) return true; 56 | 57 | return other is BankCard && 58 | other.cardNumber == cardNumber && 59 | other.cardNumberM == cardNumberM && 60 | other.cardBrand == cardBrand; 61 | } 62 | 63 | @override 64 | int get hashCode => 65 | cardNumber.hashCode ^ cardNumberM.hashCode ^ cardBrand.hashCode; 66 | } 67 | -------------------------------------------------------------------------------- /assets/svgs/icon_sign_out.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | sign_out 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 3 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | import 'app_binding.dart'; 7 | import 'di.dart'; 8 | import 'lang/lang.dart'; 9 | import 'routes/routes.dart'; 10 | import 'theme/theme.dart'; 11 | 12 | void main() async { 13 | WidgetsFlutterBinding.ensureInitialized(); 14 | await DenpendencyInjection.init(); 15 | 16 | runApp(App()); 17 | configLoading(); 18 | } 19 | 20 | class App extends StatelessWidget { 21 | @override 22 | Widget build(BuildContext context) { 23 | return GetMaterialApp( 24 | debugShowCheckedModeBanner: false, 25 | enableLog: true, 26 | initialRoute: Routes.SPLASH, 27 | defaultTransition: Transition.fade, 28 | getPages: AppPages.routes, 29 | initialBinding: AppBinding(), 30 | smartManagement: SmartManagement.keepFactory, 31 | title: 'Flutter GetX Boilerplate', 32 | theme: ThemeConfig.lightTheme, 33 | locale: TranslationService.locale, 34 | fallbackLocale: TranslationService.fallbackLocale, 35 | translations: TranslationService(), 36 | builder: EasyLoading.init(), 37 | ); 38 | } 39 | } 40 | 41 | void configLoading() { 42 | EasyLoading.instance 43 | ..indicatorType = EasyLoadingIndicatorType.threeBounce 44 | ..loadingStyle = EasyLoadingStyle.custom 45 | // ..indicatorSize = 45.0 46 | ..radius = 10.0 47 | // ..progressColor = Colors.yellow 48 | ..backgroundColor = ColorConstants.lightGray 49 | ..indicatorColor = hexToColor('#64DEE0') 50 | ..textColor = hexToColor('#64DEE0') 51 | // ..maskColor = Colors.red 52 | ..userInteractions = false 53 | ..dismissOnTap = false 54 | ..animationStyle = EasyLoadingAnimationStyle.scale; 55 | } 56 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter Getx Boilerplate 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_getx_boilerplate 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /lib/shared/widgets/gradient_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../shared.dart'; 4 | 5 | class GradientButton extends StatelessWidget { 6 | final String text; 7 | final Widget? child; 8 | final Gradient? gradient; 9 | final double width; 10 | final double height; 11 | final Function? onPressed; 12 | 13 | const GradientButton({ 14 | Key? key, 15 | this.text = "", 16 | this.child, 17 | this.gradient, 18 | this.width = double.infinity, 19 | this.height = 50.0, 20 | this.onPressed, 21 | }) : super(key: key); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Container( 26 | width: width, 27 | height: 64.0, 28 | decoration: BoxDecoration( 29 | gradient: gradient ?? 30 | LinearGradient( 31 | colors: [ 32 | hexToColor('#405FA3'), 33 | hexToColor('#1ED69D'), 34 | ], 35 | ), 36 | borderRadius: BorderRadius.circular(22.0), 37 | boxShadow: [ 38 | BoxShadow( 39 | color: hexToColor('#E5F5FF'), 40 | offset: Offset(0.0, 1.5), 41 | blurRadius: 1.5, 42 | ), 43 | ], 44 | ), 45 | child: Material( 46 | color: Colors.transparent, 47 | child: InkWell( 48 | onTap: onPressed as void Function()?, 49 | child: Center( 50 | child: text != "" 51 | ? Text( 52 | text, 53 | style: TextStyle( 54 | color: Colors.white, 55 | fontSize: CommonConstants.normalText, 56 | fontWeight: FontWeight.bold, 57 | ), 58 | ) 59 | : child, 60 | ), 61 | ), 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/modules/home/tabs/main_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/models/response/users_response.dart'; 3 | import 'package:flutter_getx_boilerplate/modules/home/home.dart'; 4 | import 'package:flutter_getx_boilerplate/shared/constants/colors.dart'; 5 | 6 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 7 | import 'package:get/get.dart'; 8 | import 'package:cached_network_image/cached_network_image.dart'; 9 | 10 | class MainTab extends GetView { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | body: Obx( 15 | () => RefreshIndicator( 16 | child: _buildGridView(), 17 | onRefresh: () => controller.loadUsers(), 18 | ), 19 | ), 20 | ); 21 | } 22 | 23 | Widget _buildGridView() { 24 | return MasonryGridView.count( 25 | crossAxisCount: 4, 26 | itemCount: data!.length, 27 | itemBuilder: (BuildContext context, int index) => new Container( 28 | color: ColorConstants.lightGray, 29 | child: Column( 30 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 31 | children: [ 32 | Text('${data![index].lastName} ${data![index].firstName}'), 33 | CachedNetworkImage( 34 | fit: BoxFit.fill, 35 | imageUrl: data![index].avatar ?? 36 | 'https://reqres.in/img/faces/1-image.jpg', 37 | placeholder: (context, url) => Image( 38 | image: AssetImage('assets/images/icon_success.png'), 39 | ), 40 | errorWidget: (context, url, error) => Icon(Icons.error), 41 | ), 42 | Text('${data![index].email}'), 43 | ], 44 | ), 45 | ), 46 | ); 47 | } 48 | 49 | List? get data { 50 | return controller.users.value == null ? [] : controller.users.value!.data; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/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 | unsigned int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length == 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /lib/shared/widgets/focused_menu/focused_menu_holder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'focused_menu_details.dart'; 4 | 5 | /// Reference: https://retroportalstudio.medium.com/focused-pop-up-menu-in-flutter-15766d0ab414 6 | class FocusedMenuHolder extends StatefulWidget { 7 | final Widget child, menuContent; 8 | 9 | const FocusedMenuHolder({ 10 | Key? key, 11 | required this.child, 12 | required this.menuContent, 13 | }); 14 | 15 | @override 16 | _FocusedMenuHolderState createState() => _FocusedMenuHolderState(); 17 | } 18 | 19 | class _FocusedMenuHolderState extends State { 20 | GlobalKey containerKey = GlobalKey(); 21 | Offset childOffset = Offset(0, 0); 22 | late Size childSize; 23 | 24 | getOffset() { 25 | dynamic renderBox = containerKey.currentContext!.findRenderObject(); 26 | Size size = renderBox!.size; 27 | Offset offset = renderBox.localToGlobal(Offset.zero); 28 | setState(() { 29 | this.childOffset = Offset(offset.dx, offset.dy); 30 | childSize = size; 31 | }); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return GestureDetector( 37 | key: containerKey, 38 | onTap: () async { 39 | getOffset(); 40 | await Navigator.push( 41 | context, 42 | PageRouteBuilder( 43 | transitionDuration: Duration(milliseconds: 100), 44 | pageBuilder: (context, animation, secondaryAnimation) { 45 | animation = Tween(begin: 0.0, end: 1.0).animate(animation); 46 | return FadeTransition( 47 | opacity: animation, 48 | child: FocusedMenuDetails( 49 | menuContent: widget.menuContent, 50 | child: widget.child, 51 | childOffset: childOffset, 52 | childSize: childSize, 53 | ), 54 | ); 55 | }, 56 | fullscreenDialog: true, 57 | opaque: false, 58 | ), 59 | ); 60 | }, 61 | child: widget.child, 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /assets/svgs/icon_inbox_activited.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 编组 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lib/shared/widgets/input_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class InputField extends StatelessWidget { 4 | final TextEditingController controller; 5 | final TextInputType keyboardType; 6 | final String labelText; 7 | final String placeholder; 8 | final Color color; 9 | final double fontSize; 10 | final bool password; 11 | final String? Function(String?)? validator; 12 | 13 | InputField({ 14 | required this.controller, 15 | this.keyboardType = TextInputType.text, 16 | this.labelText = '', 17 | this.placeholder = '', 18 | this.color = Colors.white, 19 | this.fontSize = 22.0, 20 | this.password = false, 21 | this.validator, 22 | }); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return TextFormField( 27 | decoration: InputDecoration( 28 | fillColor: Colors.transparent, 29 | contentPadding: EdgeInsets.symmetric(vertical: 10.0), 30 | focusedBorder: UnderlineInputBorder( 31 | borderSide: BorderSide( 32 | color: this.color, 33 | ), 34 | ), 35 | enabledBorder: UnderlineInputBorder( 36 | borderSide: BorderSide( 37 | color: this.color, 38 | ), 39 | ), 40 | floatingLabelBehavior: FloatingLabelBehavior.always, 41 | labelText: this.labelText, 42 | labelStyle: TextStyle( 43 | fontSize: fontSize - 2, 44 | color: color, 45 | height: 0.2, 46 | fontWeight: FontWeight.normal, 47 | ), 48 | hintText: this.placeholder, 49 | hintStyle: TextStyle( 50 | fontSize: fontSize, 51 | color: color, 52 | fontWeight: FontWeight.normal, 53 | ), 54 | filled: true, 55 | isDense: true, 56 | ), 57 | controller: this.controller, 58 | style: TextStyle( 59 | color: color, 60 | fontSize: fontSize, 61 | fontWeight: FontWeight.normal, 62 | ), 63 | keyboardType: this.keyboardType, 64 | obscureText: this.password, 65 | autocorrect: false, 66 | validator: this.validator, 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /assets/svgs/icon_me.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_me 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /lib/shared/widgets/msg/send_msg_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'msg_arrow_painter.dart'; 5 | import 'msg_box.dart'; 6 | 7 | class SendMsgBox extends MsgBox { 8 | final String message; 9 | final AnimationController animationController; 10 | const SendMsgBox( 11 | {Key? key, required this.message, required this.animationController}) 12 | : super(key: key, animationController: animationController); 13 | 14 | @override 15 | Widget buildWidgets(BuildContext context) { 16 | final messageTextGroup = Flexible( 17 | child: Row( 18 | mainAxisAlignment: MainAxisAlignment.end, 19 | crossAxisAlignment: CrossAxisAlignment.start, 20 | children: [ 21 | Flexible( 22 | child: Container( 23 | padding: EdgeInsets.all(14), 24 | decoration: BoxDecoration( 25 | color: Color(0XFF98E165), 26 | borderRadius: BorderRadius.only( 27 | topLeft: Radius.circular(18), 28 | bottomLeft: Radius.circular(18), 29 | bottomRight: Radius.circular(18), 30 | ), 31 | ), 32 | child: Text( 33 | message, 34 | style: TextStyle(color: Colors.black, fontSize: 14), 35 | ), 36 | ), 37 | ), 38 | CustomPaint(painter: MsgArrowPainter(Color(0XFF98E165))), 39 | SizedBox(width: 10), 40 | CachedNetworkImage( 41 | width: 46, 42 | height: 46, 43 | fit: BoxFit.fill, 44 | imageUrl: 'https://reqres.in/img/faces/1-image.jpg', 45 | placeholder: (context, url) => Image( 46 | image: AssetImage('assets/images/icon_success.png'), 47 | ), 48 | errorWidget: (context, url, error) => Icon(Icons.error), 49 | ), 50 | ], 51 | ), 52 | ); 53 | 54 | return Padding( 55 | padding: EdgeInsets.only(right: 10.0, left: 50, top: 15, bottom: 5), 56 | child: Row( 57 | mainAxisAlignment: MainAxisAlignment.end, 58 | children: [ 59 | SizedBox(height: 30), 60 | messageTextGroup, 61 | ], 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /assets/svgs/icon_resource.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | icon_pay 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/modules/auth/auth_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/modules/auth/auth.dart'; 3 | import 'package:flutter_getx_boilerplate/routes/routes.dart'; 4 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | class AuthScreen extends GetView { 8 | @override 9 | Widget build(BuildContext context) { 10 | return WillPopScope( 11 | onWillPop: () async => false, 12 | child: Scaffold( 13 | body: Center( 14 | child: _buildItems(context), 15 | ), 16 | ), 17 | ); 18 | } 19 | 20 | Widget _buildItems(BuildContext context) { 21 | return ListView( 22 | shrinkWrap: true, 23 | padding: EdgeInsets.symmetric(horizontal: 30.0), 24 | children: [ 25 | Icon( 26 | Icons.home, 27 | size: SizeConfig().screenWidth * 0.26, 28 | color: Colors.blueGrey, 29 | ), 30 | SizedBox(height: 20.0), 31 | Text( 32 | 'Welcome', 33 | textAlign: TextAlign.center, 34 | style: TextStyle( 35 | fontSize: CommonConstants.largeText, 36 | fontWeight: FontWeight.bold, 37 | color: Theme.of(context).textTheme.headlineLarge!.color, 38 | ), 39 | ), 40 | SizedBox(height: 10.0), 41 | Text( 42 | 'Let\'s start now!', 43 | textAlign: TextAlign.center, 44 | style: TextStyle( 45 | fontSize: CommonConstants.normalText, 46 | color: Theme.of(context).textTheme.headlineMedium!.color, 47 | ), 48 | ), 49 | SizedBox(height: 50.0), 50 | GradientButton( 51 | text: 'Sign In', 52 | onPressed: () { 53 | Get.toNamed(Routes.AUTH + Routes.LOGIN, arguments: controller); 54 | }, 55 | ), 56 | SizedBox(height: 20.0), 57 | BorderButton( 58 | text: 'Sign Up', 59 | onPressed: () { 60 | Get.toNamed(Routes.AUTH + Routes.REGISTER, arguments: controller); 61 | }, 62 | ), 63 | SizedBox(height: 62.0), 64 | Text( 65 | 'This is a demo only used for test.', 66 | textAlign: TextAlign.center, 67 | style: TextStyle( 68 | fontSize: CommonConstants.smallText, 69 | color: ColorConstants.tipColor, 70 | ), 71 | ), 72 | ], 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/shared/widgets/msg/receive_msg_box.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import 'msg_arrow_painter.dart'; 7 | import 'msg_box.dart'; 8 | 9 | class ReceiveMsgBox extends MsgBox { 10 | final String message; 11 | final AnimationController animationController; 12 | const ReceiveMsgBox( 13 | {Key? key, required this.message, required this.animationController}) 14 | : super(key: key, animationController: animationController); 15 | 16 | @override 17 | Widget buildWidgets(BuildContext context) { 18 | final messageTextGroup = Flexible( 19 | child: Row( 20 | mainAxisAlignment: MainAxisAlignment.start, 21 | crossAxisAlignment: CrossAxisAlignment.start, 22 | children: [ 23 | CachedNetworkImage( 24 | width: 46, 25 | height: 46, 26 | fit: BoxFit.fill, 27 | imageUrl: 'https://reqres.in/img/faces/2-image.jpg', 28 | placeholder: (context, url) => Image( 29 | image: AssetImage('assets/images/icon_success.png'), 30 | ), 31 | errorWidget: (context, url, error) => Icon(Icons.error), 32 | ), 33 | SizedBox(width: 10), 34 | Transform( 35 | alignment: Alignment.center, 36 | transform: Matrix4.rotationY(math.pi), 37 | child: CustomPaint(painter: MsgArrowPainter(Colors.white)), 38 | ), 39 | Flexible( 40 | child: Container( 41 | padding: EdgeInsets.all(14), 42 | decoration: BoxDecoration( 43 | color: Colors.white, 44 | borderRadius: BorderRadius.only( 45 | topRight: Radius.circular(18), 46 | bottomLeft: Radius.circular(18), 47 | bottomRight: Radius.circular(18), 48 | ), 49 | ), 50 | child: Text( 51 | message, 52 | style: TextStyle(color: Colors.black, fontSize: 14), 53 | ), 54 | ), 55 | ), 56 | ], 57 | ), 58 | ); 59 | 60 | return Padding( 61 | padding: EdgeInsets.only(right: 50.0, left: 10, top: 10, bottom: 5), 62 | child: Row( 63 | mainAxisAlignment: MainAxisAlignment.end, 64 | children: [ 65 | SizedBox(height: 30), 66 | messageTextGroup, 67 | ], 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/shared/widgets/icon_title_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/shared/constants/constants.dart'; 3 | import 'package:flutter_svg/svg.dart'; 4 | 5 | class IconTitleItem extends StatelessWidget { 6 | const IconTitleItem({ 7 | Key? key, 8 | required this.onTap, 9 | required this.title, 10 | required this.icon, 11 | this.backgroundColor = Colors.transparent, 12 | this.paddingTop = 8, 13 | this.padingBottom = 8, 14 | this.paddingLeft = 16, 15 | this.paddingRight = 32, 16 | this.marginTop = 0, 17 | this.marginBottom = 0, 18 | this.marginLeft = 0, 19 | this.marginRight = 0, 20 | this.drawablePadding = 10, 21 | }) : super(key: key); 22 | 23 | final Function() onTap; 24 | final String icon; 25 | final String title; 26 | final Color backgroundColor; 27 | 28 | final double paddingLeft, paddingTop, paddingRight, padingBottom; 29 | final double marginLeft, marginTop, marginRight, marginBottom; 30 | final double drawablePadding; 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Container( 35 | margin: 36 | EdgeInsets.fromLTRB(marginLeft, marginTop, marginRight, marginBottom), 37 | child: Material( 38 | borderRadius: BorderRadius.circular(11), 39 | color: backgroundColor, 40 | child: InkWell( 41 | onTap: onTap, 42 | customBorder: 43 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(11)), 44 | child: Padding( 45 | padding: EdgeInsets.fromLTRB( 46 | paddingLeft, paddingTop, paddingRight, padingBottom), 47 | child: Row( 48 | children: [ 49 | SvgPicture.asset( 50 | icon, 51 | width: 25, 52 | height: 25, 53 | color: ColorConstants.secondaryAppColor, 54 | ), 55 | SizedBox( 56 | width: drawablePadding, 57 | ), 58 | Expanded( 59 | child: Text( 60 | title, 61 | style: 62 | TextStyle(color: ColorConstants.darkGray, fontSize: 16), 63 | )), 64 | Icon( 65 | Icons.chevron_right, 66 | color: ColorConstants.darkGray, 67 | ), 68 | ], 69 | ), 70 | ), 71 | ), 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/shared/utils/size_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SizeConfig { 4 | SizeConfig._(); 5 | static SizeConfig _instance = SizeConfig._(); 6 | factory SizeConfig() => _instance; 7 | 8 | late MediaQueryData _mediaQueryData; 9 | late double screenWidth; 10 | late double screenHeight; 11 | late double blockSizeHorizontal; 12 | late double blockSizeVertical; 13 | late double _safeAreaHorizontal; 14 | late double _safeAreaVertical; 15 | late double safeBlockHorizontal; 16 | late double safeBlockVertical; 17 | double? profileDrawerWidth; 18 | late double refHeight; 19 | late double refWidth; 20 | 21 | void init(BuildContext context) { 22 | _mediaQueryData = MediaQuery.of(context); 23 | screenWidth = _mediaQueryData.size.width; 24 | screenHeight = _mediaQueryData.size.height; 25 | refHeight = 1450; 26 | refWidth = 670; 27 | 28 | if (screenHeight < 1200) { 29 | blockSizeHorizontal = screenWidth / 100; 30 | blockSizeVertical = screenHeight / 100; 31 | 32 | _safeAreaHorizontal = 33 | _mediaQueryData.padding.left + _mediaQueryData.padding.right; 34 | _safeAreaVertical = 35 | _mediaQueryData.padding.top + _mediaQueryData.padding.bottom; 36 | safeBlockHorizontal = (screenWidth - _safeAreaHorizontal) / 100; 37 | safeBlockVertical = (screenHeight - _safeAreaVertical) / 100; 38 | } else { 39 | blockSizeHorizontal = screenWidth / 120; 40 | blockSizeVertical = screenHeight / 120; 41 | 42 | _safeAreaHorizontal = 43 | _mediaQueryData.padding.left + _mediaQueryData.padding.right; 44 | _safeAreaVertical = 45 | _mediaQueryData.padding.top + _mediaQueryData.padding.bottom; 46 | safeBlockHorizontal = (screenWidth - _safeAreaHorizontal) / 120; 47 | safeBlockVertical = (screenHeight - _safeAreaVertical) / 120; 48 | } 49 | } 50 | 51 | double getWidthRatio(double val) { 52 | double res = (val / refWidth) * 100; 53 | double temp = res * blockSizeHorizontal; 54 | 55 | return temp; 56 | } 57 | 58 | double getHeightRatio(double val) { 59 | double res = (val / refHeight) * 100; 60 | double temp = res * blockSizeVertical; 61 | return temp; 62 | } 63 | 64 | double getFontRatio(double val) { 65 | double res = (val / refWidth) * 100; 66 | double temp = 0.0; 67 | if (screenWidth < screenHeight) { 68 | temp = res * safeBlockHorizontal; 69 | } else { 70 | temp = res * safeBlockVertical; 71 | } 72 | 73 | return temp; 74 | } 75 | } 76 | 77 | extension SizeUtils on num { 78 | double get toWidth => SizeConfig().getWidthRatio(this.toDouble()); 79 | double get toHeight => SizeConfig().getHeightRatio(this.toDouble()); 80 | double get toFont => SizeConfig().getFontRatio(this.toDouble()); 81 | } 82 | -------------------------------------------------------------------------------- /lib/shared/widgets/gradient_background.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 3 | import 'package:wave/config.dart'; 4 | import 'package:wave/wave.dart'; 5 | 6 | class GradientBackground extends StatelessWidget { 7 | /// 是否需要水波浪 8 | final bool needWave; 9 | final Widget? child; 10 | final bool needTopSafeArea; 11 | final bool needTopRadius; 12 | 13 | GradientBackground({ 14 | Key? key, 15 | this.needWave = true, 16 | this.needTopSafeArea = true, 17 | this.needTopRadius = false, 18 | this.child, 19 | }) : super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return needTopSafeArea 24 | ? Container( 25 | color: Theme.of(context).colorScheme.primary, 26 | child: SafeArea( 27 | child: _buildBackground(context), 28 | ), 29 | ) 30 | : _buildBackground(context); 31 | } 32 | 33 | Widget _buildBackground(BuildContext context) { 34 | return Stack( 35 | children: [ 36 | Container( 37 | decoration: BoxDecoration( 38 | borderRadius: needTopRadius 39 | ? BorderRadius.only( 40 | topLeft: Radius.circular(25.0), 41 | topRight: Radius.circular(25.0), 42 | ) 43 | : null, 44 | gradient: LinearGradient( 45 | begin: Alignment.topLeft, 46 | end: Alignment.bottomRight, 47 | stops: [0.1, 0.9], 48 | colors: [ 49 | hexToColor('#405FA3'), 50 | hexToColor('#1ED69D'), 51 | ], 52 | ), 53 | ), 54 | child: child, 55 | ), 56 | if (needWave) 57 | Positioned( 58 | bottom: 0, 59 | left: 0, 60 | child: WaveWidget( 61 | config: CustomConfig( 62 | gradients: [ 63 | [hexToColor('#2BA99F'), hexToColor('#22CC9E')], 64 | [hexToColor('#2BA99F'), hexToColor('#3BCDAD')], 65 | [hexToColor('#3CC8AE'), hexToColor('#22C69E')], 66 | [hexToColor('#55D5B1'), hexToColor('#54D9B1')] 67 | ], 68 | durations: [35000, 19440, 10800, 6000], 69 | heightPercentages: [0.20, 0.23, 0.25, 0.30], 70 | blur: MaskFilter.blur(BlurStyle.solid, 1), 71 | gradientBegin: Alignment.bottomLeft, 72 | gradientEnd: Alignment.topRight, 73 | ), 74 | waveAmplitude: 20, 75 | size: Size( 76 | MediaQuery.of(context).size.width, 77 | 60.0, 78 | ), 79 | ), 80 | ), 81 | ], 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/modules/auth/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import 'auth_controller.dart'; 6 | 7 | class LoginScreen extends StatelessWidget { 8 | final AuthController controller = Get.arguments; 9 | @override 10 | Widget build(BuildContext context) { 11 | return Stack( 12 | children: [ 13 | GradientBackground(), 14 | Scaffold( 15 | backgroundColor: Colors.transparent, 16 | appBar: CommonWidget.appBar( 17 | context, 18 | 'Sign In', 19 | Icons.arrow_back, 20 | Colors.white, 21 | ), 22 | body: Container( 23 | alignment: Alignment.center, 24 | padding: EdgeInsets.symmetric(horizontal: 35.0), 25 | child: _buildForms(context), 26 | ), 27 | ), 28 | ], 29 | ); 30 | } 31 | 32 | Widget _buildForms(BuildContext context) { 33 | return Form( 34 | key: controller.loginFormKey, 35 | child: SingleChildScrollView( 36 | child: Column( 37 | crossAxisAlignment: CrossAxisAlignment.stretch, 38 | children: [ 39 | InputField( 40 | controller: controller.loginEmailController, 41 | keyboardType: TextInputType.text, 42 | labelText: 'Email address', 43 | placeholder: 'Enter Email Address', 44 | validator: (value) { 45 | if (!Regex.isEmail(value!)) { 46 | return 'Email format error.'; 47 | } 48 | 49 | if (value.isEmpty) { 50 | return 'Email is required.'; 51 | } 52 | return null; 53 | }, 54 | ), 55 | CommonWidget.rowHeight(), 56 | InputField( 57 | controller: controller.loginPasswordController, 58 | keyboardType: TextInputType.emailAddress, 59 | labelText: 'Password', 60 | placeholder: 'Enter Password', 61 | password: true, 62 | validator: (value) { 63 | if (value!.isEmpty) { 64 | return 'Password is required.'; 65 | } 66 | 67 | if (value.length < 6 || value.length > 15) { 68 | return 'Password should be 6~15 characters'; 69 | } 70 | 71 | return null; 72 | }, 73 | ), 74 | CommonWidget.rowHeight(height: 80), 75 | BorderButton( 76 | text: 'Sign In', 77 | backgroundColor: Colors.white, 78 | onPressed: () { 79 | controller.login(context); 80 | }, 81 | ), 82 | ], 83 | ), 84 | ), 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/modules/auth/auth_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/api/api.dart'; 3 | import 'package:flutter_getx_boilerplate/models/models.dart'; 4 | import 'package:flutter_getx_boilerplate/routes/app_pages.dart'; 5 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 6 | import 'package:get/get.dart'; 7 | import 'package:shared_preferences/shared_preferences.dart'; 8 | 9 | class AuthController extends GetxController { 10 | final ApiRepository apiRepository; 11 | AuthController({required this.apiRepository}); 12 | 13 | final GlobalKey registerFormKey = GlobalKey(); 14 | final registerEmailController = TextEditingController(); 15 | final registerPasswordController = TextEditingController(); 16 | final registerConfirmPasswordController = TextEditingController(); 17 | bool registerTermsChecked = false; 18 | 19 | final GlobalKey loginFormKey = GlobalKey(); 20 | final loginEmailController = TextEditingController(); 21 | final loginPasswordController = TextEditingController(); 22 | 23 | @override 24 | void onInit() { 25 | super.onInit(); 26 | } 27 | 28 | @override 29 | void onReady() { 30 | super.onReady(); 31 | } 32 | 33 | void register(BuildContext context) async { 34 | AppFocus.unfocus(context); 35 | if (registerFormKey.currentState!.validate()) { 36 | if (!registerTermsChecked) { 37 | CommonWidget.toast('Please check the terms first.'); 38 | return; 39 | } 40 | 41 | final res = await apiRepository.register( 42 | RegisterRequest( 43 | email: registerEmailController.text, 44 | password: registerPasswordController.text, 45 | ), 46 | ); 47 | 48 | final prefs = Get.find(); 49 | if (res!.token.isNotEmpty) { 50 | prefs.setString(StorageConstants.token, res.token); 51 | print('Go to Home screen>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'); 52 | } 53 | } 54 | } 55 | 56 | void login(BuildContext context) async { 57 | AppFocus.unfocus(context); 58 | if (loginFormKey.currentState!.validate()) { 59 | final res = await apiRepository.login( 60 | LoginRequest( 61 | email: loginEmailController.text, 62 | password: loginPasswordController.text, 63 | ), 64 | ); 65 | 66 | final prefs = Get.find(); 67 | if (res!.token.isNotEmpty) { 68 | prefs.setString(StorageConstants.token, res.token); 69 | Get.toNamed(Routes.HOME); 70 | } 71 | } 72 | } 73 | 74 | @override 75 | void onClose() { 76 | super.onClose(); 77 | 78 | registerEmailController.dispose(); 79 | registerPasswordController.dispose(); 80 | registerConfirmPasswordController.dispose(); 81 | 82 | loginEmailController.dispose(); 83 | loginPasswordController.dispose(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/models/response/users_response.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final usersResponse = usersResponseFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | class UsersResponse { 8 | UsersResponse({ 9 | required this.page, 10 | required this.perPage, 11 | required this.total, 12 | required this.totalPages, 13 | this.data, 14 | this.support, 15 | }); 16 | 17 | int page; 18 | int perPage; 19 | int total; 20 | int totalPages; 21 | List? data; 22 | Support? support; 23 | 24 | factory UsersResponse.fromRawJson(String str) => 25 | UsersResponse.fromJson(json.decode(str)); 26 | 27 | String toRawJson() => json.encode(toJson()); 28 | 29 | factory UsersResponse.fromJson(Map json) => UsersResponse( 30 | page: json["page"], 31 | perPage: json["per_page"], 32 | total: json["total"], 33 | totalPages: json["total_pages"], 34 | data: List.from(json["data"].map((x) => Datum.fromJson(x))), 35 | support: Support.fromJson(json["support"]), 36 | ); 37 | 38 | Map toJson() => { 39 | "page": page, 40 | "per_page": perPage, 41 | "total": total, 42 | "total_pages": totalPages, 43 | "data": List.from(data!.map((x) => x.toJson())), 44 | "support": support!.toJson(), 45 | }; 46 | } 47 | 48 | class Datum { 49 | Datum({ 50 | required this.id, 51 | this.email, 52 | this.firstName, 53 | this.lastName, 54 | this.avatar, 55 | }); 56 | 57 | int id; 58 | String? email; 59 | String? firstName; 60 | String? lastName; 61 | String? avatar; 62 | 63 | factory Datum.fromRawJson(String str) => Datum.fromJson(json.decode(str)); 64 | 65 | String toRawJson() => json.encode(toJson()); 66 | 67 | factory Datum.fromJson(Map json) => Datum( 68 | id: json["id"], 69 | email: json["email"], 70 | firstName: json["first_name"], 71 | lastName: json["last_name"], 72 | avatar: json["avatar"], 73 | ); 74 | 75 | Map toJson() => { 76 | "id": id, 77 | "email": email, 78 | "first_name": firstName, 79 | "last_name": lastName, 80 | "avatar": avatar, 81 | }; 82 | } 83 | 84 | class Support { 85 | Support({ 86 | this.url, 87 | this.text, 88 | }); 89 | 90 | String? url; 91 | String? text; 92 | 93 | factory Support.fromRawJson(String str) => Support.fromJson(json.decode(str)); 94 | 95 | String toRawJson() => json.encode(toJson()); 96 | 97 | factory Support.fromJson(Map json) => Support( 98 | url: json["url"], 99 | text: json["text"], 100 | ); 101 | 102 | Map toJson() => { 103 | "url": url, 104 | "text": text, 105 | }; 106 | } 107 | -------------------------------------------------------------------------------- /lib/modules/home/home_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter_getx_boilerplate/api/api.dart'; 4 | import 'package:flutter_getx_boilerplate/models/response/users_response.dart'; 5 | import 'package:flutter_getx_boilerplate/modules/home/home.dart'; 6 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 7 | import 'package:get/get.dart'; 8 | import 'package:shared_preferences/shared_preferences.dart'; 9 | 10 | class HomeController extends GetxController { 11 | final ApiRepository apiRepository; 12 | HomeController({required this.apiRepository}); 13 | 14 | var currentTab = MainTabs.home.obs; 15 | var users = Rxn(); 16 | var user = Rxn(); 17 | 18 | late MainTab mainTab; 19 | late DiscoverTab discoverTab; 20 | late ResourceTab resourceTab; 21 | late InboxTab inboxTab; 22 | late MeTab meTab; 23 | 24 | @override 25 | void onInit() async { 26 | super.onInit(); 27 | 28 | mainTab = MainTab(); 29 | loadUsers(); 30 | 31 | discoverTab = DiscoverTab(); 32 | resourceTab = ResourceTab(); 33 | inboxTab = InboxTab(); 34 | meTab = MeTab(); 35 | } 36 | 37 | Future loadUsers() async { 38 | var _users = await apiRepository.getUsers(); 39 | if (_users!.data!.length > 0) { 40 | users.value = _users; 41 | users.refresh(); 42 | _saveUserInfo(_users); 43 | } 44 | } 45 | 46 | void signout() { 47 | var prefs = Get.find(); 48 | prefs.clear(); 49 | 50 | // Get.back(); 51 | NavigatorHelper.popLastScreens(popCount: 2); 52 | } 53 | 54 | void _saveUserInfo(UsersResponse users) { 55 | var random = new Random(); 56 | var index = random.nextInt(users.data!.length); 57 | user.value = users.data![index]; 58 | var prefs = Get.find(); 59 | prefs.setString(StorageConstants.userInfo, users.data![index].toRawJson()); 60 | 61 | // var userInfo = prefs.getString(StorageConstants.userInfo); 62 | // var userInfoObj = Datum.fromRawJson(xx!); 63 | // print(userInfoObj); 64 | } 65 | 66 | void switchTab(index) { 67 | var tab = _getCurrentTab(index); 68 | currentTab.value = tab; 69 | } 70 | 71 | int getCurrentIndex(MainTabs tab) { 72 | switch (tab) { 73 | case MainTabs.home: 74 | return 0; 75 | case MainTabs.discover: 76 | return 1; 77 | case MainTabs.resource: 78 | return 2; 79 | case MainTabs.inbox: 80 | return 3; 81 | case MainTabs.me: 82 | return 4; 83 | default: 84 | return 0; 85 | } 86 | } 87 | 88 | MainTabs _getCurrentTab(int index) { 89 | switch (index) { 90 | case 0: 91 | return MainTabs.home; 92 | case 1: 93 | return MainTabs.discover; 94 | case 2: 95 | return MainTabs.resource; 96 | case 3: 97 | return MainTabs.inbox; 98 | case 4: 99 | return MainTabs.me; 100 | default: 101 | return MainTabs.home; 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /lib/modules/home/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/modules/home/home.dart'; 3 | import 'package:flutter_getx_boilerplate/modules/home/tabs/tabs.dart'; 4 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 5 | 6 | import 'package:flutter_svg/flutter_svg.dart'; 7 | import 'package:get/get.dart'; 8 | 9 | class HomeScreen extends GetView { 10 | @override 11 | Widget build(BuildContext context) { 12 | return WillPopScope( 13 | onWillPop: () async => false, 14 | child: Obx(() => _buildWidget()), 15 | ); 16 | } 17 | 18 | Widget _buildWidget() { 19 | return Scaffold( 20 | body: Center( 21 | child: _buildContent(controller.currentTab.value), 22 | ), 23 | bottomNavigationBar: BottomNavigationBar( 24 | items: [ 25 | _buildNavigationBarItem( 26 | "Home", 27 | MainTabs.home == controller.currentTab.value 28 | ? "icon_home_activited.svg" 29 | : "icon_home.svg", 30 | ), 31 | _buildNavigationBarItem( 32 | "Discover", 33 | MainTabs.discover == controller.currentTab.value 34 | ? "icon_discover_activited.svg" 35 | : "icon_discover.svg", 36 | ), 37 | _buildNavigationBarItem( 38 | "Resource", 39 | "icon_resource.svg", 40 | ), 41 | _buildNavigationBarItem( 42 | "Inbox", 43 | MainTabs.inbox == controller.currentTab.value 44 | ? "icon_inbox_activited.svg" 45 | : "icon_inbox.svg", 46 | ), 47 | _buildNavigationBarItem( 48 | "Me", 49 | MainTabs.me == controller.currentTab.value 50 | ? "icon_me_activited.svg" 51 | : "icon_me.svg", 52 | ) 53 | ], 54 | type: BottomNavigationBarType.fixed, 55 | unselectedItemColor: ColorConstants.black, 56 | currentIndex: controller.getCurrentIndex(controller.currentTab.value), 57 | selectedItemColor: ColorConstants.black, 58 | selectedLabelStyle: TextStyle( 59 | fontSize: 14, 60 | fontWeight: FontWeight.bold, 61 | ), 62 | onTap: (index) => controller.switchTab(index), 63 | ), 64 | ); 65 | } 66 | 67 | Widget _buildContent(MainTabs tab) { 68 | switch (tab) { 69 | case MainTabs.home: 70 | return controller.mainTab; 71 | case MainTabs.discover: 72 | return controller.discoverTab; 73 | case MainTabs.resource: 74 | return controller.resourceTab; 75 | case MainTabs.inbox: 76 | return controller.inboxTab; 77 | case MainTabs.me: 78 | return controller.meTab; 79 | default: 80 | return controller.mainTab; 81 | } 82 | } 83 | 84 | BottomNavigationBarItem _buildNavigationBarItem(String label, String svg) { 85 | return BottomNavigationBarItem( 86 | icon: SvgPicture.asset('assets/svgs/$svg'), 87 | label: label, 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /assets/svgs/icon_me_activited.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | me 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "flutter_getx_boilerplate" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "flutter_getx_boilerplate" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "flutter_getx_boilerplate.exe" "\0" 98 | VALUE "ProductName", "flutter_getx_boilerplate" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_getx_boilerplate 2 | description: "A new Flutter project." 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: ^3.5.3 23 | 24 | dependencies: 25 | flutter: 26 | sdk: flutter 27 | 28 | cupertino_icons: 1.0.8 29 | get: 4.6.6 30 | shared_preferences: 2.3.2 31 | wave: 0.2.2 32 | fluttertoast: 8.2.8 33 | flutter_easyloading: 3.0.5 34 | flutter_svg: 2.0.10+1 35 | flutter_staggered_grid_view: 0.7.0 36 | cached_network_image: 3.4.1 37 | 38 | dev_dependencies: 39 | flutter_test: 40 | sdk: flutter 41 | 42 | # The "flutter_lints" package below contains a set of recommended lints to 43 | # encourage good coding practices. The lint set provided by the package is 44 | # activated in the `analysis_options.yaml` file located at the root of your 45 | # package. See that file for information about deactivating specific lint 46 | # rules and activating additional ones. 47 | flutter_lints: ^4.0.0 48 | 49 | # For information on the generic Dart part of this file, see the 50 | # following page: https://dart.dev/tools/pub/pubspec 51 | 52 | # The following section is specific to Flutter. 53 | flutter: 54 | 55 | # The following line ensures that the Material Icons font is 56 | # included with your application, so that you can use the icons in 57 | # the material Icons class. 58 | uses-material-design: true 59 | 60 | # To add assets to your application, add an assets section, like this: 61 | assets: 62 | - assets/images/ 63 | - assets/svgs/ 64 | 65 | # An image asset can refer to one or more resolution-specific "variants", see 66 | # https://flutter.dev/to/resolution-aware-images 67 | 68 | # For details regarding adding assets from package dependencies, see 69 | # https://flutter.dev/to/asset-from-package 70 | 71 | # To add custom fonts to your application, add a fonts section here, 72 | # in this "flutter" section. Each entry in this list should have a 73 | # "family" key with the font family name, and a "fonts" key with a 74 | # list giving the asset and other descriptors for the font. For 75 | # example: 76 | # fonts: 77 | # - family: Schyler 78 | # fonts: 79 | # - asset: fonts/Schyler-Regular.ttf 80 | # - asset: fonts/Schyler-Italic.ttf 81 | # style: italic 82 | # - family: Trajan Pro 83 | # fonts: 84 | # - asset: fonts/TrajanPro.ttf 85 | # - asset: fonts/TrajanPro_Bold.ttf 86 | # weight: 700 87 | # 88 | # For details regarding fonts from package dependencies, 89 | # see https://flutter.dev/to/font-from-package 90 | -------------------------------------------------------------------------------- /README.zh-cn.md: -------------------------------------------------------------------------------- 1 | # flutter_getx_boilerplate 2 | 3 | ## master branch: Fluter 3.0.5 version 4 | 5 | ## Flutter-2.x branch: Flutter 2.x version 6 | 7 | **语言: [English](README.md), 中文 (这个文件).**, [韩文](README.ko-kr.md) 8 | 9 | ## 介绍 10 | 11 | 在我学习Flutter期间,我一直使用的是flutter_bloc状态管理框架,无意间看到GetX状态管理框架,通过ReadMe发现GetX框架非常容易入门,于是想一边学习一边写一个GetX的Starter项目,不仅可以帮助自己学习,也可以帮助他人快速搭建框架。搭建这个框架之前我搜索了很多类似的框架,发现都比较简单,没有一个涵盖项目该有的通用的东西,于是萌发了自己写一个的想法。下面让我逐一介绍。 12 | 13 | ## 技术 & 项目介绍 14 | 15 | [Flutter - GetX状态管理](https://juejin.cn/post/6950514701969129486) 16 | 17 | 使用Flutter 2.x搭建的一套包含预定义的文件夹结构、样式主题、API访问、状态管理、路由 & 依赖等的框架。项目结构清晰,可以很方便的作为Flutter的模板项目来使用。使用技术包括但不限于[Flutter](https://flutter.cn/)、[Dart](https://dart.dev/)、[GetX](https://pub.dev/packages/get)等。 18 | 19 |

20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

30 | 31 | ## 安装 & 使用 32 | 33 | **Step 1:** 34 | 35 | Fork本项目到自己的仓库: 36 | 37 | ``` 38 | git clone https://github.com/KevinZhang19870314/flutter_getx_boilerplate.git 39 | ``` 40 | 41 | **Step 2:** 42 | 43 | 用VS Code打开项目文件夹,执行以下命令安装依赖包: 44 | 45 | ``` 46 | flutter pub get 47 | ``` 48 | 49 | **Step 3:** 50 | 51 | 打开lib文件夹下的main.dart文件,F5 或者 Ctrl + F5运行项目,然后就可以开始开发调试了。 52 | 53 | ## 文件夹结构 54 | 55 | 下面是项目文件夹结构(只介绍lib下面的文件夹) 56 | 57 | ``` 58 | lib/ 59 | |- api - 全局Restful api请求,包括请求拦截器等 60 | |- interceptors - 拦截器,包括auth、request、response拦截 61 | |- api.dart - Restful api导出文件 62 | |- lang - 国际化,包含翻译文件,翻译服务文件等 63 | |- lang.dart - 语言导出文件 64 | |- models - 各种结构化实体类,分为request和response两种类型的实体 65 | |- models.dart - 实体类导出文件 66 | |- modules - 业务模块文件夹 67 | |- auth - 登录&注册模块 68 | |- home - 首页模块 69 | |- splash - splash模块 70 | |- modules.dart - 模块导出文件 71 | |- routes - 路由模块 72 | |- app_pages.dart - 路由页面配置 73 | |- app_routes.dart - 路由名称 74 | |- routes.dart - 路由导出文件 75 | |- Shared - 全局共享文件夹,包括静态变量、全局services、utils、全局Widget等 76 | |- shared.dart - 全局共享导出文件 77 | |- theme - 主题文件夹 78 | |- app_bindings.dart - 在app运行之前启动的服务等,如Restful api 79 | |- di.dart - 全局依赖注入对象,如SharedPreferences等 80 | |- main.dart - 导出类,用作外面调用api请求主入口 81 | ``` 82 | 83 | ## 其他 84 | 85 | 在编写过程中,因为涉及到Restful api的调用,这里我使用了[REQ|RES](https://reqres.in/)提供的免费测试api。 86 | 87 | 测试使用的用户如下: 88 | 89 | 邮箱: "eve.holt@reqres.in", 90 | 密码: "pistol" 91 | 92 | 感兴趣的朋友扫码进QQ 群:610930944,我们一起讨论Flutter的未来。 93 | 94 | 95 | 96 | 打赏开发者 97 | 98 | -------------------------------------------------------------------------------- /lib/shared/widgets/focused_menu/focused_menu_details.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | import '../../shared.dart'; 6 | 7 | class FocusedMenuDetails extends StatefulWidget { 8 | final Offset childOffset; 9 | final Size childSize; 10 | final Widget menuContent; 11 | final Widget child; 12 | 13 | const FocusedMenuDetails({ 14 | Key? key, 15 | required this.menuContent, 16 | required this.childOffset, 17 | required this.childSize, 18 | required this.child, 19 | }) : super(key: key); 20 | 21 | @override 22 | _FocusedMenuDetailsState createState() => _FocusedMenuDetailsState(); 23 | } 24 | 25 | class _FocusedMenuDetailsState extends State 26 | with SingleTickerProviderStateMixin { 27 | late Animation _pushUpAndDownAnimation; 28 | late AnimationController _controller; 29 | 30 | @override 31 | void initState() { 32 | super.initState(); 33 | _controller = AnimationController( 34 | duration: const Duration(milliseconds: 200), 35 | reverseDuration: const Duration(milliseconds: 200), 36 | vsync: this, 37 | )..forward(); 38 | 39 | _pushUpAndDownAnimation = Tween( 40 | begin: const Offset(0, 1), 41 | end: Offset.zero, 42 | ).animate( 43 | CurvedAnimation( 44 | parent: _controller, 45 | curve: Curves.easeIn, 46 | ), 47 | ); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | backgroundColor: Colors.transparent, 54 | body: Container( 55 | child: Stack( 56 | fit: StackFit.expand, 57 | children: [ 58 | GestureDetector( 59 | onTap: () { 60 | _controller.reverse(); 61 | 62 | Navigator.pop(context); 63 | }, 64 | child: BackdropFilter( 65 | filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4), 66 | child: Container( 67 | color: Colors.black.withOpacity(0.3), 68 | ), 69 | ), 70 | ), 71 | Positioned( 72 | bottom: 20.0, 73 | left: 15.0, 74 | child: SlideTransition( 75 | position: _pushUpAndDownAnimation, 76 | child: _buildActions(), 77 | ), 78 | ), 79 | Positioned( 80 | top: widget.childOffset.dy, 81 | left: widget.childOffset.dx, 82 | child: AbsorbPointer( 83 | absorbing: true, 84 | child: Container( 85 | decoration: BoxDecoration( 86 | color: Colors.white, 87 | borderRadius: BorderRadius.all(Radius.circular(8.0)), 88 | ), 89 | width: widget.childSize.width, 90 | height: widget.childSize.height, 91 | child: widget.child, 92 | ), 93 | ), 94 | ), 95 | ], 96 | ), 97 | ), 98 | ); 99 | } 100 | 101 | Widget _buildActions() { 102 | final sw = SizeConfig().screenWidth; 103 | final sh = SizeConfig().screenHeight; 104 | return Container( 105 | width: sw - 30.0, 106 | height: sh * .2, 107 | decoration: BoxDecoration( 108 | color: Colors.transparent, 109 | borderRadius: const BorderRadius.all(Radius.circular(5.0)), 110 | boxShadow: [ 111 | BoxShadow( 112 | color: Colors.grey.withAlpha(100), 113 | blurRadius: 10, 114 | spreadRadius: 1, 115 | ) 116 | ], 117 | ), 118 | child: ClipRRect( 119 | borderRadius: const BorderRadius.all(Radius.circular(5.0)), 120 | child: widget.menuContent, 121 | ), 122 | ); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /lib/shared/widgets/border_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../shared.dart'; 4 | 5 | class BorderButton extends StatelessWidget { 6 | final _GradientPainter _painter; 7 | final String _text; 8 | final Widget? _child; 9 | final VoidCallback? _callback; 10 | final double _radius; 11 | final Color backgroundColor; 12 | 13 | BorderButton({ 14 | double strokeWidth = 1, 15 | double radius = 22, 16 | Gradient? gradient, 17 | String text = "", 18 | Widget? child, 19 | VoidCallback? onPressed, 20 | this.backgroundColor = Colors.transparent, 21 | }) : this._painter = _GradientPainter( 22 | strokeWidth: strokeWidth, 23 | radius: radius, 24 | gradient: gradient ?? 25 | LinearGradient( 26 | colors: [ 27 | hexToColor('#405FA3'), 28 | hexToColor('#1ED69D'), 29 | ], 30 | ), 31 | ), 32 | this._child = child, 33 | this._callback = onPressed, 34 | this._radius = radius, 35 | this._text = text; 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return CustomPaint( 40 | painter: _painter, 41 | child: GestureDetector( 42 | behavior: HitTestBehavior.translucent, 43 | onTap: _callback, 44 | child: InkWell( 45 | borderRadius: BorderRadius.circular(_radius), 46 | onTap: _callback, 47 | child: Container( 48 | decoration: BoxDecoration( 49 | color: this.backgroundColor, 50 | borderRadius: BorderRadius.circular(this._radius)), 51 | constraints: BoxConstraints(minWidth: 88, minHeight: 64), 52 | child: Row( 53 | mainAxisSize: MainAxisSize.min, 54 | mainAxisAlignment: MainAxisAlignment.center, 55 | children: [ 56 | if (_text != "") 57 | Text( 58 | _text, 59 | style: TextStyle( 60 | fontSize: 18, 61 | fontWeight: FontWeight.bold, 62 | color: hexToColor('#2F9AA0'), 63 | ), 64 | ) 65 | else 66 | _child!, 67 | ], 68 | ), 69 | ), 70 | ), 71 | ), 72 | ); 73 | } 74 | } 75 | 76 | class _GradientPainter extends CustomPainter { 77 | final Paint _paint = Paint(); 78 | final double radius; 79 | final double strokeWidth; 80 | final Gradient gradient; 81 | 82 | _GradientPainter({ 83 | required double strokeWidth, 84 | required double radius, 85 | required Gradient gradient, 86 | }) : this.strokeWidth = strokeWidth, 87 | this.radius = radius, 88 | this.gradient = gradient; 89 | 90 | @override 91 | void paint(Canvas canvas, Size size) { 92 | // create outer rectangle equals size 93 | Rect outerRect = Offset.zero & size; 94 | var outerRRect = 95 | RRect.fromRectAndRadius(outerRect, Radius.circular(radius)); 96 | 97 | // create inner rectangle smaller by strokeWidth 98 | Rect innerRect = Rect.fromLTWH(strokeWidth, strokeWidth, 99 | size.width - strokeWidth * 2, size.height - strokeWidth * 2); 100 | var innerRRect = RRect.fromRectAndRadius( 101 | innerRect, Radius.circular(radius - strokeWidth)); 102 | 103 | // apply gradient shader 104 | _paint.shader = gradient.createShader(outerRect); 105 | 106 | // create difference between outer and inner paths and draw it 107 | Path path1 = Path()..addRRect(outerRRect); 108 | Path path2 = Path()..addRRect(innerRRect); 109 | var path = Path.combine(PathOperation.difference, path1, path2); 110 | canvas.drawPath(path, _paint); 111 | } 112 | 113 | @override 114 | bool shouldRepaint(CustomPainter oldDelegate) => oldDelegate != this; 115 | } 116 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | -------------------------------------------------------------------------------- /lib/modules/me/cards/cards_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_boilerplate/models/bank_card.dart'; 3 | import 'package:flutter_getx_boilerplate/shared/shared.dart'; 4 | import 'package:flutter_getx_boilerplate/shared/widgets/focused_menu/focused_menu_holder.dart'; 5 | 6 | import 'bank_card_box.dart'; 7 | 8 | class CardsScreen extends StatefulWidget { 9 | @override 10 | _CardsScreenState createState() => _CardsScreenState(); 11 | } 12 | 13 | class _CardsScreenState extends State { 14 | List cards = []; 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | cards.add( 20 | BankCard(cardBrand: 'VISA', cardNumber: '1234', cardNumberM: '1234'), 21 | ); 22 | cards.add( 23 | BankCard(cardBrand: 'VISA', cardNumber: '1111', cardNumberM: '1111'), 24 | ); 25 | cards.add( 26 | BankCard( 27 | cardBrand: 'MasterCard', cardNumber: '2222', cardNumberM: '2222'), 28 | ); 29 | cards.add( 30 | BankCard(cardBrand: 'VISA', cardNumber: '7777', cardNumberM: '7777'), 31 | ); 32 | cards.add( 33 | BankCard( 34 | cardBrand: 'MasterCard', cardNumber: '8888', cardNumberM: '8888'), 35 | ); 36 | cards.add( 37 | BankCard(cardBrand: 'VISA', cardNumber: '8765', cardNumberM: '8765'), 38 | ); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return Scaffold( 44 | appBar: CommonWidget.appBar( 45 | context, 46 | 'Cards', 47 | Icons.arrow_back, 48 | Colors.black, 49 | ), 50 | body: Container( 51 | margin: EdgeInsets.all(8.0), 52 | height: SizeConfig().screenHeight * .7, 53 | child: ListView.builder( 54 | shrinkWrap: true, 55 | itemBuilder: (context, index) { 56 | BankCard card = cards[index]; 57 | return FocusedMenuHolder( 58 | child: BankCardBox( 59 | cardType: card.cardBrand, 60 | cardNum: card.cardNumber, 61 | ), 62 | menuContent: _buildMenuItems(card), 63 | ); 64 | }, 65 | itemCount: cards.length, 66 | ), 67 | ), 68 | ); 69 | } 70 | 71 | Widget _buildMenuItems(BankCard card) { 72 | return Container( 73 | padding: EdgeInsets.symmetric(horizontal: 10.0), 74 | color: Colors.transparent, 75 | child: Column( 76 | mainAxisAlignment: MainAxisAlignment.center, 77 | crossAxisAlignment: CrossAxisAlignment.stretch, 78 | children: [ 79 | _buildMenuButton('Unbind card', hexToColor('#007AFF'), onTap: () { 80 | print('Unbind card'); 81 | Navigator.of(context).pop(); 82 | }), 83 | CommonWidget.rowHeight(height: 10.0), 84 | _buildMenuButton('Cancel', Colors.grey, onTap: () { 85 | Navigator.of(context).pop(); 86 | }), 87 | ], 88 | ), 89 | ); 90 | } 91 | 92 | Widget _buildMenuButton(String text, Color color, {required Function onTap}) { 93 | return SizedBox( 94 | width: double.infinity, 95 | height: 60.0, 96 | child: TextButton( 97 | onPressed: () { 98 | onTap(); 99 | }, 100 | style: TextButton.styleFrom( 101 | backgroundColor: Colors.white, 102 | padding: EdgeInsets.all(10.0), 103 | shape: RoundedRectangleBorder( 104 | borderRadius: BorderRadius.circular(13.0), 105 | side: BorderSide(color: Colors.transparent), 106 | ), 107 | ), 108 | child: Text( 109 | text, 110 | style: TextStyle( 111 | color: color, 112 | fontSize: 20.0, 113 | fontWeight: FontWeight.w400, 114 | ), 115 | ), 116 | ), 117 | ); 118 | } 119 | 120 | @override 121 | void dispose() { 122 | super.dispose(); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /README.ko-kr.md: -------------------------------------------------------------------------------- 1 | # flutter_getx_boilerplate 2 | 3 | ## master branch: Fluter 3.0.5 version 4 | 5 | ## Flutter-2.x branch: Flutter 2.x version 6 | 7 | **언어들: [영어](README.md), [중국어](README.zh-cn.md).** , 한국어(this file) 8 | 9 | ## 소개 10 | 11 | 내가 플러터를 공부하면서, 나는 bloc를 이용해서 상태관리를 하였다. 우연히 GetX를 통해서 상태 관리하는 것을 발견했다. 리드미를 통해서 나는 GetX가 얼마나 배우기 쉬운지 찾았다. 그래서 나는 GetX 스타터 프로젝트를 쓰고자 하였다. 이 스타터 프로젝트는 나에게 도움이 될 뿐만 아니라, 다른 사람들이 보일러플레이트를 빨리 구축할 수 있도록 도와준다. 이 보일러플레이트를 구축하기 전에 나는 비슷한 프로젝트들을 많이 찾았고, 그것들은 상대적으로 너무 간단하다는 것을 알게 되었다. 그들은 또한 프로젝트가 공통으로 가져야 할 기능들조차 가지지 않았다. 그래서 나는 보일러플레이트를 하나하나 혼자서 쓰기로 마음먹었다. 아래에 그것들을 하나씩 소개하겠다. 12 | 13 | ## Technology & Project Introduction 14 | 15 | 플러터 2.x 을 사용해서 폴더구조, 스타일 테마, API 접근, 상태관리, 라우팅 & 종속성, 기타 등을 구축하였다. 이 프로젝트 구조는 간단하고 플러터 템플릿 프로젝트로 사용될 수 있다. 사용되는 기술은 [Flutter](https://flutter.cn/), [Dart](https://dart.dev/), [GetX](https://pub.dev/packages/get) 등 이지만 이 기술들에만 국한되지 않는다. 16 | 17 |

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

28 | 29 | ## 설치 및 사용법 30 | 31 | **Step 1:** 32 | 33 | 당신의 로컬로 이 프로젝트를 클론 받으세요.: 34 | 35 | ``` 36 | git clone https://github.com/KevinZhang19870314/flutter_getx_boilerplate.git 37 | ``` 38 | 39 | **Step 2:** 40 | 41 | 폴더구조를 vscode 를 통해서 열고 다음과 같은 명령어를 실행시켜서 종속 패키지들을 설치해주세요. 42 | 43 | ``` 44 | flutter pub get 45 | ``` 46 | 47 | **Step 3:** 48 | 49 | lib 폴더 안에 있는 main.dart파일을 열고 프로젝트를 실행시키기 위해서 F5 혹은 Ctrl + F5 를 클릭해주세요. 그러면 디버깅 모드를 시작할 수 있습니다. 50 | 51 | ## 폴더 구조 52 | 53 | 하기는 프로젝트에 사용된 폴더구조입니다(lib 폴더 안에 있는 구조만 설명합니다) 54 | 영어가 더 자연스러우므로 번역하지 않았습니다. 55 | 56 | ``` 57 | lib/ 58 | |- api - Global Restful api requests, including interceptors, etc. 59 | |- interceptors - Interceptors, including auth, request, and response interceptors. 60 | |- api.dart - Restful api export file. 61 | |- lang - Internationalization, including translation files, translation service files, etc. 62 | |- lang.dart - Language export file. 63 | |- models - Various structured entity classes, divided into request and response entities. 64 | |- models.dart - Entity class export file. 65 | |- modules - Business module folder. 66 | |- auth - Login & Registration Module. 67 | |- home - Home module. 68 | |- splash - Splash module. 69 | |- modules.dart - Module export file. 70 | |- routes - Routing module. 71 | |- app_pages.dart - Routing page configuration. 72 | |- app_routes.dart - Route names. 73 | |- routes.dart - Route export file. 74 | |- Shared - Global shared folders, including static variables, global services, utils, global Widgets, etc. 75 | |- shared.dart - Global shared export file. 76 | |- theme - Theme folder. 77 | |- app_bindings.dart - Services started before the app runs, such as Restful api. 78 | |- di.dart - Global dependency injection objects, such as SharedPreferences, etc. 79 | |- main.dart - Main entry. 80 | ``` 81 | 82 | ## Other 83 | 84 | 보일러 플레이트에 사용되는 몇가지 Restful api 들이 있기 때문에 이것을 제공합니다. 사용되는 유저는 하기와 같습니다. 85 | [REQ|RES](https://reqres.in/). 86 | 87 | 이 User 를 이용해서 테스트하세요.: 88 | 89 | email: "eve.holt@reqres.in", 90 | password: "pistol" 91 | --------------------------------------------------------------------------------