├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── xinwei │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── gzx_dropdown_menu_test_page.dart │ ├── main.dart │ └── test_page.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── lib ├── gzx_dropdown_menu.dart └── src │ ├── gzx_dropdown_header.dart │ ├── gzx_dropdown_menu.dart │ └── gzx_dropdown_menu_controller.dart ├── preview_images ├── 1.png ├── 淘宝.gif └── 美团.gif ├── pubspec.lock ├── pubspec.yaml └── test └── gzx_dropdown_menu_test.dart /.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 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | build/ 29 | # Remove the following pattern if you wish to check in your lock file 30 | pubspec.lock 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/ServiceDefinitions.json 65 | **/ios/Runner/GeneratedPluginRegistrant.* 66 | 67 | # Exceptions to above rules. 68 | !**/ios/**/default.mode1v3 69 | !**/ios/**/default.mode2v3 70 | !**/ios/**/default.pbxuser 71 | !**/ios/**/default.perspectivev3 72 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 73 | -------------------------------------------------------------------------------- /.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: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [3.1.0] - [2021-04-07] 2 | ### ✨ New Features 3 | * Add iconDropDownData to customize icon when menu is show 4 | ### 🐛 Bug Fixes 5 | * Fixed the drop down menu not showing fully when the width of the drop down menu is smaller than the width of the screen 6 | 7 | ## [3.0.0+3] - [2021-04-07] 8 | * Formatting code to increase the score 9 | 10 | ## [3.0.0+2] - [2021-04-07] 11 | * Using trailing commas and Format code 12 | 13 | ## [3.0.0+1] - [2021-04-06] 14 | * Fixed Dart Analysis 3 issues 15 | * Add DartDoc comments, remove useless code, and change variable names 16 | * README add to-do list 17 | 18 | ## [3.0.0] - [2021-04-02] 19 | * Migrate to null safety. 20 | 21 | ## [2.1.0] - [2020-06-03] 22 | ### ✨ New Features 23 | * GZXDropDownMenu add dropdownMenuChanging and dropdownMenuChanged callback 24 | * GZXDropDownHeaderItem add style (see https://github.com/GanZhiXiong/gzx_dropdown_menu/issues/27) 25 | ### ⚡️ Improvements 26 | * Add removeListener and removeStatusListener when the animation is recreated 27 | * Reduced calls to setstate 28 | ### 🐛 Bug Fixes 29 | * Fixed Dropdown menu hide mask no animation 30 | 31 | ## [2.0.0+2] - [2020-05-11] 32 | * Update Readme 33 | 34 | ## [2.0.0+1] - [2020-05-11] 35 | * Update Readme 36 | 37 | ## [2.0.0] - [2020-05-10] 38 | ### ✨ New Features 39 | * Mask color animation display 40 | * Support for changing mask colors 41 | ### ⚡️ Improvements 42 | * Modify the drop-down header to not scroll 43 | * Hide dropdown menu add animation 44 | ### 🐛 Bug Fixes 45 | * Fix-issues-16 46 | * Fix repeatedly click current header,can't hide 47 | 48 | ## [1.0.3] - [2019-08-06] 49 | * When the drop-down menu appears, click on the margin to collapse the menu, but the icon of header remains unchanged (https://github.com/GanZhiXiong/gzx_dropdown_menu/issues/2#issue-469594783) 50 | * Slide the interface to the right and write the input field and the keypad will pop up causing the list to report an error (https://github.com/GanZhiXiong/gzx_dropdown_menu/issues/1#issue-467276935) 51 | 52 | ## [1.0.2] - [2019-06-06] 53 | * update readme 54 | 55 | ## [1.0.1] - [2019-06-06] 56 | * refactor code 57 | 58 | ## [1.0.0] - [2019-06-03] 59 | * Custom dropdown header 60 | * Custom dropdown header item 61 | * Custom dropdown menu 62 | * Custom dropdown menu show animation time 63 | * Control dropdown menu show or hide -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 GanZhiXiong 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gzx_dropdown_menu 2 | 3 | [![Pub Package](https://img.shields.io/pub/v/gzx_dropdown_menu.svg)](https://pub.dev/packages/gzx_dropdown_menu) 4 | [![GitHub Stars](https://img.shields.io/github/stars/ganzhixiong/gzx_dropdown_menu.svg)](https://github.com/ganzhixiong/gzx_dropdown_menu/stargazers) 5 | [![GitHub Forks](https://img.shields.io/github/forks/ganzhixiong/gzx_dropdown_menu.svg)](https://github.com/ganzhixiong/gzx_dropdown_menu/network) 6 | [![GitHub Issues](https://img.shields.io/github/issues/ganzhixiong/gzx_dropdown_menu.svg)](https://github.com/ganzhixiong/gzx_dropdown_menu/issues) 7 | [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ganzhixiong/gzx_dropdown_menu/master/LICENSE) 8 | 9 | 这是一个Flutter自定义功能强大的轻量级**下拉筛选菜单**Package,它支持iOS和Android。 10 | 11 | *** 12 | - 🙀开源不易,麻烦给个Star⭐️吧!我会根据大家的关注度和个人时间持续更新代码! 13 | - 🙀如你想接收更新消息,你可以Watch下,有问题请提到Issues。 14 | *** 15 | 16 | # 导航 17 | - [功能介绍](#功能介绍) 18 | - [待办事项](#待办事项) 19 | - [Gif效果图](#Gif效果图) 20 | - [如何使用](#如何使用) 21 | - [相关Repository](#相关Repository) 22 | - [相关文章](#相关文章) 23 | - [捐助开发者](#捐助开发者) 24 | 25 | # 功能介绍 26 | A custom is strong dropdown menu for Flutter. Easy to use and powerful for customization, it's up to you what you want to display in the dropdown menu! 27 | 28 | * Custom dropdown header 29 | * Custom dropdown header item 30 | * Custom dropdown menu 31 | * Custom dropdown menu animation 32 | * Control dropdown menu show or hide 33 | 34 | **[查看版本更新记录](https://pub.flutter-io.cn/packages/gzx_dropdown_menu#-changelog-tab-)** 35 | 36 | # 待办事项 37 | - [ ] 由于GZXDropDownMenu只能在Stack内使用,扩展性还不够强 38 | - [ ] 支持CustomScrollView和NestedScrollView 39 | - [ ] .......... 40 | 41 | # Gif效果图 42 | 效果图展示了仿美团和淘宝的下拉筛选菜单。 43 | - 美团的代码就在这个仓库的example目录下 44 | - 淘宝的代码在[Flutter 淘宝](https://github.com/GanZhiXiong/GZXTaoBaoAppFlutter) 45 | 46 | 50 | 51 | 52 | 53 | [//]: # ( 54 | ) 55 | 56 | # 如何使用 57 | 目前已发布到Pub,你可以在Pub官网查看最新的版本和更新说明![去Pub官网查看](https://pub.flutter-io.cn/packages/gzx_dropdown_menu) 58 | ## 1、添加gzx_dropdown_menu package 59 | 打开pubspec.yaml文件 60 | 添加如下代码 61 | ``` dart 62 | gzx_dropdown_menu: ^3.1.0 63 | ``` 64 | 添加后打开Terminal,执行flutter packages get 65 | 66 | ## 2、使用 67 | - **强烈建议你先clone下本仓库** 68 | - 然后运行下看下效果 69 | - 打开本仓库example项目下的gzx_dropdown_menu_test_page.dart文件自己看。 70 | 71 | 没空编辑文字了,而且说这么多还不如你直接运行下看下效果,然后看下代码,就知道如何使用了。 72 | 73 | **~~算了~~🤪🤪🤪🙄还是简单说下吧!!!** 74 | 你只需要将GZXDropDownHeader和GZXDropDownMenu嵌套到你的代码中即可 75 | ### GZXDropDownHeader 76 | **这里要注意了,这些参数不是必须要要写的,我写出来只是让你知道强大的自定义功能,实际上就前面三个参数是必填的** 77 | ``` dart 78 | // 下拉菜单头部 79 | GZXDropDownHeader( 80 | // 下拉的头部项,目前每一项,只能自定义显示的文字、图标、图标大小修改 81 | items: [ 82 | GZXDropDownHeaderItem(_dropDownHeaderItemStrings[0]), 83 | GZXDropDownHeaderItem( 84 | _dropDownHeaderItemStrings[1], 85 | iconData: Icons.keyboard_arrow_down, 86 | iconDropDownData: Icons.keyboard_arrow_up, 87 | ), 88 | GZXDropDownHeaderItem( 89 | _dropDownHeaderItemStrings[2], 90 | style: TextStyle(color: Colors.green), 91 | iconData: Icons.arrow_upward, 92 | iconDropDownData: Icons.arrow_downward, 93 | ), 94 | GZXDropDownHeaderItem( 95 | _dropDownHeaderItemStrings[3], 96 | iconData: Icons.filter_frames, 97 | iconSize: 18, 98 | ), 99 | ], 100 | // GZXDropDownHeader对应第一父级Stack的key 101 | stackKey: _stackKey, 102 | // controller用于控制menu的显示或隐藏 103 | controller: _dropdownMenuController, 104 | // 当点击头部项的事件,在这里可以进行页面跳转或openEndDrawer 105 | onItemTap: (index) { 106 | if (index == 3) { 107 | _dropdownMenuController.hide(); 108 | _scaffoldKey.currentState!.openEndDrawer(); 109 | } 110 | }, 111 | // 头部的高度 112 | height: 40, 113 | // 头部背景颜色 114 | color: Colors.red, 115 | // 头部边框宽度 116 | borderWidth: 1, 117 | // 头部边框颜色 118 | borderColor: Color(0xFFeeede6), 119 | // 分割线高度 120 | dividerHeight: 20, 121 | // 分割线颜色 122 | dividerColor: Color(0xFFeeede6), 123 | // 文字样式 124 | style: TextStyle(color: Color(0xFF666666), fontSize: 14), 125 | // 下拉时文字样式 126 | dropDownStyle: TextStyle( 127 | fontSize: 14, 128 | color: Theme.of(context).primaryColor, 129 | ), 130 | // 图标大小 131 | iconSize: 20, 132 | // 图标颜色 133 | iconColor: Color(0xFFafada7), 134 | // 下拉时图标颜色 135 | iconDropDownColor: Theme.of(context).primaryColor, 136 | ), 137 | ``` 138 | ### GZXDropDownMenu 139 | ``` dart 140 | // 下拉菜单,注意GZXDropDownMenu目前只能在Stack内,后续有时间会改进,以及支持CustomScrollView和NestedScrollView 141 | GZXDropDownMenu( 142 | // controller用于控制menu的显示或隐藏 143 | controller: _dropdownMenuController, 144 | // 下拉菜单显示或隐藏动画时长 145 | animationMilliseconds: 300, 146 | // 下拉后遮罩颜色 147 | //maskColor: Theme.of(context).primaryColor.withOpacity(0.5), 148 | //maskColor: Colors.red.withOpacity(0.5), 149 | dropdownMenuChanging: (isShow, index) { 150 | setState(() { 151 | _dropdownMenuChange = '(正在${isShow ? '显示' : '隐藏'}$index)'; 152 | print(_dropdownMenuChange); 153 | }); 154 | }, 155 | dropdownMenuChanged: (isShow, index) { 156 | setState(() { 157 | _dropdownMenuChange = '(已经${isShow ? '显示' : '隐藏'}$index)'; 158 | print(_dropdownMenuChange); 159 | }); 160 | }, 161 | // 下拉菜单,高度自定义,你想显示什么就显示什么,完全由你决定,你只需要在选择后调用_dropdownMenuController.hide();即可 162 | menus: [ 163 | GZXDropdownMenuBuilder( 164 | dropDownHeight: 40 * 8.0, 165 | dropDownWidget: _buildAddressWidget((selectValue) { 166 | _dropDownHeaderItemStrings[0] = selectValue; 167 | _dropdownMenuController.hide(); 168 | setState(() {}); 169 | })), 170 | GZXDropdownMenuBuilder( 171 | dropDownHeight: 40 * 8.0, 172 | dropDownWidget: _buildConditionListWidget(_brandSortConditions, (value) { 173 | _selectBrandSortCondition = value; 174 | _dropDownHeaderItemStrings[1] = 175 | _selectBrandSortCondition.name == '全部' ? '品牌' : _selectBrandSortCondition.name; 176 | _dropdownMenuController.hide(); 177 | setState(() {}); 178 | })), 179 | GZXDropdownMenuBuilder( 180 | dropDownHeight: 40.0 * _distanceSortConditions.length, 181 | dropDownWidget: _buildConditionListWidget(_distanceSortConditions, (value) { 182 | _selectDistanceSortCondition = value; 183 | _dropDownHeaderItemStrings[2] = _selectDistanceSortCondition.name; 184 | _dropdownMenuController.hide(); 185 | setState(() {}); 186 | })), 187 | ], 188 | ), 189 | ``` 190 | 191 | # 相关Repository 192 | * [Flutter 淘宝App](https://github.com/GanZhiXiong/GZXTaoBaoAppFlutter) 193 | 194 | # 相关文章 195 | * [作者CSDN](https://blog.csdn.net/oHaiKuoTianKong1682) 196 | 197 | # 捐助开发者 198 | ![](https://github.com/GanZhiXiong/GZXTaoBaoAppFlutter/blob/master/preview_images/thanks.png) 199 | -------------------------------------------------------------------------------- /example/.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 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | # Remove the following pattern if you wish to check in your lock file 30 | pubspec.lock 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Flutter.podspec 61 | **/ios/Flutter/Generated.xcconfig 62 | **/ios/Flutter/app.flx 63 | **/ios/Flutter/app.zip 64 | **/ios/Flutter/flutter_assets/ 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /example/.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: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter application. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.xinwei.example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/xinwei/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xinwei.example 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/xcode 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=xcode 4 | 5 | ### Xcode ### 6 | # Xcode 7 | # 8 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 9 | 10 | ## User settings 11 | xcuserdata/ 12 | 13 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 14 | *.xcscmblueprint 15 | *.xccheckout 16 | 17 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 18 | build/ 19 | DerivedData/ 20 | *.moved-aside 21 | *.pbxuser 22 | !default.pbxuser 23 | *.mode1v3 24 | !default.mode1v3 25 | *.mode2v3 26 | !default.mode2v3 27 | *.perspectivev3 28 | !default.perspectivev3 29 | 30 | ## Gcc Patch 31 | /*.gcno 32 | 33 | ### Xcode Patch ### 34 | *.xcodeproj/* 35 | !*.xcodeproj/project.pbxproj 36 | !*.xcodeproj/xcshareddata/ 37 | !*.xcworkspace/contents.xcworkspacedata 38 | **/xcshareddata/WorkspaceSettings.xcsettings 39 | 40 | # End of https://www.toptal.com/developers/gitignore/api/xcode 41 | -------------------------------------------------------------------------------- /example/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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 36 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 37 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 38 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 39 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 40 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 41 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 9740EEB11CF90186004384FC /* Flutter */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 63 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 64 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 65 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 66 | ); 67 | name = Flutter; 68 | sourceTree = ""; 69 | }; 70 | 97C146E51CF9000F007C117D = { 71 | isa = PBXGroup; 72 | children = ( 73 | 9740EEB11CF90186004384FC /* Flutter */, 74 | 97C146F01CF9000F007C117D /* Runner */, 75 | 97C146EF1CF9000F007C117D /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | 97C146EF1CF9000F007C117D /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 97C146EE1CF9000F007C117D /* Runner.app */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | 97C146F01CF9000F007C117D /* Runner */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 91 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 92 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 93 | 97C147021CF9000F007C117D /* Info.plist */, 94 | 97C146F11CF9000F007C117D /* Supporting Files */, 95 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 96 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 97 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 98 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 99 | ); 100 | path = Runner; 101 | sourceTree = ""; 102 | }; 103 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXNativeTarget section */ 113 | 97C146ED1CF9000F007C117D /* Runner */ = { 114 | isa = PBXNativeTarget; 115 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 116 | buildPhases = ( 117 | 9740EEB61CF901F6004384FC /* Run Script */, 118 | 97C146EA1CF9000F007C117D /* Sources */, 119 | 97C146EB1CF9000F007C117D /* Frameworks */, 120 | 97C146EC1CF9000F007C117D /* Resources */, 121 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 122 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 123 | ); 124 | buildRules = ( 125 | ); 126 | dependencies = ( 127 | ); 128 | name = Runner; 129 | productName = Runner; 130 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 131 | productType = "com.apple.product-type.application"; 132 | }; 133 | /* End PBXNativeTarget section */ 134 | 135 | /* Begin PBXProject section */ 136 | 97C146E61CF9000F007C117D /* Project object */ = { 137 | isa = PBXProject; 138 | attributes = { 139 | LastUpgradeCheck = 0910; 140 | ORGANIZATIONNAME = "The Chromium Authors"; 141 | TargetAttributes = { 142 | 97C146ED1CF9000F007C117D = { 143 | CreatedOnToolsVersion = 7.3.1; 144 | DevelopmentTeam = H6GCWZCE8G; 145 | LastSwiftMigration = 0910; 146 | }; 147 | }; 148 | }; 149 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 150 | compatibilityVersion = "Xcode 3.2"; 151 | developmentRegion = English; 152 | hasScannedForEncodings = 0; 153 | knownRegions = ( 154 | English, 155 | en, 156 | Base, 157 | ); 158 | mainGroup = 97C146E51CF9000F007C117D; 159 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 160 | projectDirPath = ""; 161 | projectRoot = ""; 162 | targets = ( 163 | 97C146ED1CF9000F007C117D /* Runner */, 164 | ); 165 | }; 166 | /* End PBXProject section */ 167 | 168 | /* Begin PBXResourcesBuildPhase section */ 169 | 97C146EC1CF9000F007C117D /* Resources */ = { 170 | isa = PBXResourcesBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 174 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 175 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 176 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 177 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | }; 181 | /* End PBXResourcesBuildPhase section */ 182 | 183 | /* Begin PBXShellScriptBuildPhase section */ 184 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 185 | isa = PBXShellScriptBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | ); 189 | inputPaths = ( 190 | ); 191 | name = "Thin Binary"; 192 | outputPaths = ( 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | shellPath = /bin/sh; 196 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 197 | }; 198 | 9740EEB61CF901F6004384FC /* Run Script */ = { 199 | isa = PBXShellScriptBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | ); 203 | inputPaths = ( 204 | ); 205 | name = "Run Script"; 206 | outputPaths = ( 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | shellPath = /bin/sh; 210 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 211 | }; 212 | /* End PBXShellScriptBuildPhase section */ 213 | 214 | /* Begin PBXSourcesBuildPhase section */ 215 | 97C146EA1CF9000F007C117D /* Sources */ = { 216 | isa = PBXSourcesBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 220 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXSourcesBuildPhase section */ 225 | 226 | /* Begin PBXVariantGroup section */ 227 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 228 | isa = PBXVariantGroup; 229 | children = ( 230 | 97C146FB1CF9000F007C117D /* Base */, 231 | ); 232 | name = Main.storyboard; 233 | sourceTree = ""; 234 | }; 235 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | 97C147001CF9000F007C117D /* Base */, 239 | ); 240 | name = LaunchScreen.storyboard; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXVariantGroup section */ 244 | 245 | /* Begin XCBuildConfiguration section */ 246 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_ANALYZER_NONNULL = YES; 251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 252 | CLANG_CXX_LIBRARY = "libc++"; 253 | CLANG_ENABLE_MODULES = YES; 254 | CLANG_ENABLE_OBJC_ARC = YES; 255 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 256 | CLANG_WARN_BOOL_CONVERSION = YES; 257 | CLANG_WARN_COMMA = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INFINITE_RECURSION = YES; 263 | CLANG_WARN_INT_CONVERSION = YES; 264 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 265 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 266 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 267 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 268 | CLANG_WARN_STRICT_PROTOTYPES = YES; 269 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 270 | CLANG_WARN_UNREACHABLE_CODE = YES; 271 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 272 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 273 | COPY_PHASE_STRIP = NO; 274 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 275 | ENABLE_NS_ASSERTIONS = NO; 276 | ENABLE_STRICT_OBJC_MSGSEND = YES; 277 | GCC_C_LANGUAGE_STANDARD = gnu99; 278 | GCC_NO_COMMON_BLOCKS = YES; 279 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 280 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 281 | GCC_WARN_UNDECLARED_SELECTOR = YES; 282 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 283 | GCC_WARN_UNUSED_FUNCTION = YES; 284 | GCC_WARN_UNUSED_VARIABLE = YES; 285 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 286 | MTL_ENABLE_DEBUG_INFO = NO; 287 | SDKROOT = iphoneos; 288 | TARGETED_DEVICE_FAMILY = "1,2"; 289 | VALIDATE_PRODUCT = YES; 290 | }; 291 | name = Profile; 292 | }; 293 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 294 | isa = XCBuildConfiguration; 295 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 299 | DEVELOPMENT_TEAM = H6GCWZCE8G; 300 | ENABLE_BITCODE = NO; 301 | FRAMEWORK_SEARCH_PATHS = ( 302 | "$(inherited)", 303 | "$(PROJECT_DIR)/Flutter", 304 | ); 305 | INFOPLIST_FILE = Runner/Info.plist; 306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 307 | LIBRARY_SEARCH_PATHS = ( 308 | "$(inherited)", 309 | "$(PROJECT_DIR)/Flutter", 310 | ); 311 | PRODUCT_BUNDLE_IDENTIFIER = com.xinwei.example; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | SWIFT_VERSION = 4.0; 314 | VERSIONING_SYSTEM = "apple-generic"; 315 | }; 316 | name = Profile; 317 | }; 318 | 97C147031CF9000F007C117D /* Debug */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ALWAYS_SEARCH_USER_PATHS = NO; 322 | CLANG_ANALYZER_NONNULL = YES; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 328 | CLANG_WARN_BOOL_CONVERSION = YES; 329 | CLANG_WARN_COMMA = YES; 330 | CLANG_WARN_CONSTANT_CONVERSION = YES; 331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 332 | CLANG_WARN_EMPTY_BODY = YES; 333 | CLANG_WARN_ENUM_CONVERSION = YES; 334 | CLANG_WARN_INFINITE_RECURSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 337 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 338 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 339 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 340 | CLANG_WARN_STRICT_PROTOTYPES = YES; 341 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 342 | CLANG_WARN_UNREACHABLE_CODE = YES; 343 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 344 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 345 | COPY_PHASE_STRIP = NO; 346 | DEBUG_INFORMATION_FORMAT = dwarf; 347 | ENABLE_STRICT_OBJC_MSGSEND = YES; 348 | ENABLE_TESTABILITY = YES; 349 | GCC_C_LANGUAGE_STANDARD = gnu99; 350 | GCC_DYNAMIC_NO_PIC = NO; 351 | GCC_NO_COMMON_BLOCKS = YES; 352 | GCC_OPTIMIZATION_LEVEL = 0; 353 | GCC_PREPROCESSOR_DEFINITIONS = ( 354 | "DEBUG=1", 355 | "$(inherited)", 356 | ); 357 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 358 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 359 | GCC_WARN_UNDECLARED_SELECTOR = YES; 360 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 361 | GCC_WARN_UNUSED_FUNCTION = YES; 362 | GCC_WARN_UNUSED_VARIABLE = YES; 363 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 364 | MTL_ENABLE_DEBUG_INFO = YES; 365 | ONLY_ACTIVE_ARCH = YES; 366 | SDKROOT = iphoneos; 367 | TARGETED_DEVICE_FAMILY = "1,2"; 368 | }; 369 | name = Debug; 370 | }; 371 | 97C147041CF9000F007C117D /* Release */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | ALWAYS_SEARCH_USER_PATHS = NO; 375 | CLANG_ANALYZER_NONNULL = YES; 376 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 377 | CLANG_CXX_LIBRARY = "libc++"; 378 | CLANG_ENABLE_MODULES = YES; 379 | CLANG_ENABLE_OBJC_ARC = YES; 380 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 381 | CLANG_WARN_BOOL_CONVERSION = YES; 382 | CLANG_WARN_COMMA = YES; 383 | CLANG_WARN_CONSTANT_CONVERSION = YES; 384 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 385 | CLANG_WARN_EMPTY_BODY = YES; 386 | CLANG_WARN_ENUM_CONVERSION = YES; 387 | CLANG_WARN_INFINITE_RECURSION = YES; 388 | CLANG_WARN_INT_CONVERSION = YES; 389 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 390 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 391 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 392 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 393 | CLANG_WARN_STRICT_PROTOTYPES = YES; 394 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 395 | CLANG_WARN_UNREACHABLE_CODE = YES; 396 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 397 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 398 | COPY_PHASE_STRIP = NO; 399 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 400 | ENABLE_NS_ASSERTIONS = NO; 401 | ENABLE_STRICT_OBJC_MSGSEND = YES; 402 | GCC_C_LANGUAGE_STANDARD = gnu99; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 405 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 406 | GCC_WARN_UNDECLARED_SELECTOR = YES; 407 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 408 | GCC_WARN_UNUSED_FUNCTION = YES; 409 | GCC_WARN_UNUSED_VARIABLE = YES; 410 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 411 | MTL_ENABLE_DEBUG_INFO = NO; 412 | SDKROOT = iphoneos; 413 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 414 | TARGETED_DEVICE_FAMILY = "1,2"; 415 | VALIDATE_PRODUCT = YES; 416 | }; 417 | name = Release; 418 | }; 419 | 97C147061CF9000F007C117D /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 422 | buildSettings = { 423 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 424 | CLANG_ENABLE_MODULES = YES; 425 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 426 | DEVELOPMENT_TEAM = H6GCWZCE8G; 427 | ENABLE_BITCODE = NO; 428 | FRAMEWORK_SEARCH_PATHS = ( 429 | "$(inherited)", 430 | "$(PROJECT_DIR)/Flutter", 431 | ); 432 | INFOPLIST_FILE = Runner/Info.plist; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 434 | LIBRARY_SEARCH_PATHS = ( 435 | "$(inherited)", 436 | "$(PROJECT_DIR)/Flutter", 437 | ); 438 | PRODUCT_BUNDLE_IDENTIFIER = com.xinwei.example; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 441 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 442 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 443 | SWIFT_VERSION = 4.0; 444 | VERSIONING_SYSTEM = "apple-generic"; 445 | }; 446 | name = Debug; 447 | }; 448 | 97C147071CF9000F007C117D /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | CLANG_ENABLE_MODULES = YES; 454 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 455 | DEVELOPMENT_TEAM = H6GCWZCE8G; 456 | ENABLE_BITCODE = NO; 457 | FRAMEWORK_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | INFOPLIST_FILE = Runner/Info.plist; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 463 | LIBRARY_SEARCH_PATHS = ( 464 | "$(inherited)", 465 | "$(PROJECT_DIR)/Flutter", 466 | ); 467 | PRODUCT_BUNDLE_IDENTIFIER = com.xinwei.example; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 470 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 471 | SWIFT_VERSION = 4.0; 472 | VERSIONING_SYSTEM = "apple-generic"; 473 | }; 474 | name = Release; 475 | }; 476 | /* End XCBuildConfiguration section */ 477 | 478 | /* Begin XCConfigurationList section */ 479 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 480 | isa = XCConfigurationList; 481 | buildConfigurations = ( 482 | 97C147031CF9000F007C117D /* Debug */, 483 | 97C147041CF9000F007C117D /* Release */, 484 | 249021D3217E4FDB00AE95B9 /* Profile */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 97C147061CF9000F007C117D /* Debug */, 493 | 97C147071CF9000F007C117D /* Release */, 494 | 249021D4217E4FDB00AE95B9 /* Profile */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | /* End XCConfigurationList section */ 500 | }; 501 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 502 | } 503 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/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. -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /example/lib/gzx_dropdown_menu_test_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gzx_dropdown_menu/gzx_dropdown_menu.dart'; 3 | 4 | class SortCondition { 5 | String name; 6 | bool isSelected; 7 | 8 | SortCondition({ 9 | required this.name, 10 | required this.isSelected, 11 | }); 12 | } 13 | 14 | class GZXDropDownMenuTestPage extends StatefulWidget { 15 | @override 16 | _GZXDropDownMenuTestPageState createState() => _GZXDropDownMenuTestPageState(); 17 | } 18 | 19 | class _GZXDropDownMenuTestPageState extends State { 20 | List _dropDownHeaderItemStrings = ['全城', '品牌', '距离近', '筛选']; 21 | List _brandSortConditions = []; 22 | List _distanceSortConditions = []; 23 | late SortCondition _selectBrandSortCondition; 24 | late SortCondition _selectDistanceSortCondition; 25 | GZXDropdownMenuController _dropdownMenuController = GZXDropdownMenuController(); 26 | 27 | var _scaffoldKey = new GlobalKey(); 28 | GlobalKey _stackKey = GlobalKey(); 29 | 30 | String _dropdownMenuChange = ''; 31 | 32 | @override 33 | void initState() { 34 | // TODO: implement initState 35 | super.initState(); 36 | 37 | _brandSortConditions.add(SortCondition(name: '全部', isSelected: true)); 38 | _brandSortConditions.add(SortCondition(name: '金逸影城', isSelected: false)); 39 | _brandSortConditions.add(SortCondition(name: '中影国际城我比较长,你看我选择后是怎么显示的', isSelected: false)); 40 | _brandSortConditions.add(SortCondition(name: '星美国际城', isSelected: false)); 41 | _brandSortConditions.add(SortCondition(name: '博纳国际城', isSelected: false)); 42 | _brandSortConditions.add(SortCondition(name: '大地影院', isSelected: false)); 43 | _brandSortConditions.add(SortCondition(name: '嘉禾影城', isSelected: false)); 44 | _brandSortConditions.add(SortCondition(name: '太平洋影城', isSelected: false)); 45 | _brandSortConditions.add(SortCondition(name: '万达影城', isSelected: false)); 46 | _brandSortConditions.add(SortCondition(name: '万达影城1', isSelected: false)); 47 | _brandSortConditions.add(SortCondition(name: '万达影城2', isSelected: false)); 48 | _brandSortConditions.add(SortCondition(name: '万达影城3', isSelected: false)); 49 | _brandSortConditions.add(SortCondition(name: '万达影城4', isSelected: false)); 50 | _brandSortConditions.add(SortCondition(name: '万达影城5', isSelected: false)); 51 | _brandSortConditions.add(SortCondition(name: '万达影城6', isSelected: false)); 52 | _brandSortConditions.add(SortCondition(name: '万达影城7', isSelected: false)); 53 | _brandSortConditions.add(SortCondition(name: '万达影城8', isSelected: false)); 54 | _brandSortConditions.add(SortCondition(name: '万达影城9', isSelected: false)); 55 | _selectBrandSortCondition = _brandSortConditions[0]; 56 | 57 | _distanceSortConditions.add(SortCondition(name: '距离近', isSelected: true)); 58 | _distanceSortConditions.add(SortCondition(name: '价格低', isSelected: false)); 59 | _distanceSortConditions.add(SortCondition(name: '价格高', isSelected: false)); 60 | 61 | _selectDistanceSortCondition = _distanceSortConditions[0]; 62 | } 63 | 64 | @override 65 | Widget build(BuildContext context) { 66 | print('_GZXDropDownMenuTestPageState.build'); 67 | 68 | return Scaffold( 69 | key: _scaffoldKey, 70 | appBar: PreferredSize( 71 | child: AppBar( 72 | brightness: Brightness.dark, 73 | backgroundColor: Theme.of(context).primaryColor, 74 | elevation: 0, 75 | ), 76 | preferredSize: Size.fromHeight(0), 77 | ), 78 | backgroundColor: Colors.white, 79 | endDrawer: Container( 80 | margin: EdgeInsets.only(left: MediaQuery.of(context).size.width / 4, top: 0), 81 | color: Colors.white, 82 | // child: Container(color: Colors.red,child: Padding( 83 | // padding: const EdgeInsets.all(8.0), 84 | // child: TextField(), 85 | // ),), 86 | child: ListView( 87 | children: [ 88 | TextField(), 89 | ], 90 | ), 91 | ), 92 | // GZXDropDownMenu目前只能在Stack内,后续有时间会改进,以及支持CustomScrollView和NestedScrollView 93 | body: Stack( 94 | key: _stackKey, 95 | children: [ 96 | Column( 97 | children: [ 98 | Container( 99 | width: MediaQuery.of(context).size.width, 100 | height: 44, 101 | color: Theme.of(context).primaryColor, 102 | alignment: Alignment.center, 103 | child: Text( 104 | '仿美团电影下拉筛选菜单$_dropdownMenuChange', 105 | style: TextStyle( 106 | fontSize: 16, 107 | color: Colors.white, 108 | fontWeight: FontWeight.bold, 109 | ), 110 | ), 111 | ), 112 | // SizedBox(height: 20,), 113 | // 下拉菜单头部 114 | GZXDropDownHeader( 115 | // 下拉的头部项,目前每一项,只能自定义显示的文字、图标、图标大小修改 116 | items: [ 117 | GZXDropDownHeaderItem(_dropDownHeaderItemStrings[0]), 118 | GZXDropDownHeaderItem( 119 | _dropDownHeaderItemStrings[1], 120 | iconData: Icons.keyboard_arrow_down, 121 | iconDropDownData: Icons.keyboard_arrow_up, 122 | ), 123 | GZXDropDownHeaderItem( 124 | _dropDownHeaderItemStrings[2], 125 | style: TextStyle(color: Colors.green), 126 | iconData: Icons.arrow_upward, 127 | iconDropDownData: Icons.arrow_downward, 128 | ), 129 | GZXDropDownHeaderItem( 130 | _dropDownHeaderItemStrings[3], 131 | iconData: Icons.filter_frames, 132 | iconSize: 18, 133 | ), 134 | ], 135 | // GZXDropDownHeader对应第一父级Stack的key 136 | stackKey: _stackKey, 137 | // controller用于控制menu的显示或隐藏 138 | controller: _dropdownMenuController, 139 | // 当点击头部项的事件,在这里可以进行页面跳转或openEndDrawer 140 | onItemTap: (index) { 141 | if (index == 3) { 142 | _dropdownMenuController.hide(); 143 | _scaffoldKey.currentState!.openEndDrawer(); 144 | } 145 | }, 146 | // // 头部的高度 147 | // height: 40, 148 | // // 头部背景颜色 149 | // color: Colors.red, 150 | // // 头部边框宽度 151 | // borderWidth: 1, 152 | // // 头部边框颜色 153 | // borderColor: Color(0xFFeeede6), 154 | // // 分割线高度 155 | // dividerHeight: 20, 156 | // // 分割线颜色 157 | // dividerColor: Color(0xFFeeede6), 158 | // // 文字样式 159 | style: TextStyle(color: Color(0xFF666666), fontSize: 14), 160 | // // 下拉时文字样式 161 | dropDownStyle: TextStyle( 162 | fontSize: 14, 163 | color: Theme.of(context).primaryColor, 164 | ), 165 | // // 图标大小 166 | // iconSize: 20, 167 | // // 图标颜色 168 | // iconColor: Color(0xFFafada7), 169 | // // 下拉时图标颜色 170 | // iconDropDownColor: Theme.of(context).primaryColor, 171 | ), 172 | Expanded( 173 | child: ListView.separated( 174 | itemCount: 100, 175 | separatorBuilder: (BuildContext context, int index) => Divider(height: 1.0), 176 | itemBuilder: (BuildContext context, int index) { 177 | return GestureDetector( 178 | child: ListTile( 179 | leading: Text('test$index'), 180 | ), 181 | onTap: () {}, 182 | ); 183 | }), 184 | ), 185 | ], 186 | ), 187 | // 下拉菜单,注意GZXDropDownMenu目前只能在Stack内,后续有时间会改进,以及支持CustomScrollView和NestedScrollView 188 | GZXDropDownMenu( 189 | // controller用于控制menu的显示或隐藏 190 | controller: _dropdownMenuController, 191 | // 下拉菜单显示或隐藏动画时长 192 | animationMilliseconds: 300, 193 | // 下拉后遮罩颜色 194 | // maskColor: Theme.of(context).primaryColor.withOpacity(0.5), 195 | // maskColor: Colors.red.withOpacity(0.5), 196 | dropdownMenuChanging: (isShow, index) { 197 | setState(() { 198 | _dropdownMenuChange = '(正在${isShow ? '显示' : '隐藏'}$index)'; 199 | print(_dropdownMenuChange); 200 | }); 201 | }, 202 | dropdownMenuChanged: (isShow, index) { 203 | setState(() { 204 | _dropdownMenuChange = '(已经${isShow ? '显示' : '隐藏'}$index)'; 205 | print(_dropdownMenuChange); 206 | }); 207 | }, 208 | // 下拉菜单,高度自定义,你想显示什么就显示什么,完全由你决定,你只需要在选择后调用_dropdownMenuController.hide();即可 209 | menus: [ 210 | GZXDropdownMenuBuilder( 211 | dropDownHeight: 40 * 8.0, 212 | dropDownWidget: _buildAddressWidget((selectValue) { 213 | _dropDownHeaderItemStrings[0] = selectValue; 214 | _dropdownMenuController.hide(); 215 | setState(() {}); 216 | })), 217 | GZXDropdownMenuBuilder( 218 | dropDownHeight: 40 * 8.0, 219 | dropDownWidget: _buildConditionListWidget(_brandSortConditions, (value) { 220 | _selectBrandSortCondition = value; 221 | _dropDownHeaderItemStrings[1] = 222 | _selectBrandSortCondition.name == '全部' ? '品牌' : _selectBrandSortCondition.name; 223 | _dropdownMenuController.hide(); 224 | setState(() {}); 225 | })), 226 | GZXDropdownMenuBuilder( 227 | dropDownHeight: 40.0 * _distanceSortConditions.length, 228 | dropDownWidget: _buildConditionListWidget(_distanceSortConditions, (value) { 229 | _selectDistanceSortCondition = value; 230 | _dropDownHeaderItemStrings[2] = _selectDistanceSortCondition.name; 231 | _dropdownMenuController.hide(); 232 | setState(() {}); 233 | })), 234 | ], 235 | ), 236 | ], 237 | ), 238 | ); 239 | } 240 | 241 | int _selectTempFirstLevelIndex = 0; 242 | int _selectFirstLevelIndex = 0; 243 | int _selectSecondLevelIndex = -1; 244 | 245 | _buildAddressWidget(void itemOnTap(String selectValue)) { 246 | // List firstLevels = new List.filled(15, 0); 247 | List firstLevels = new List.generate(15, (int index) { 248 | if (index == 0) { 249 | return '全部'; 250 | } 251 | return '$index区'; 252 | }); 253 | 254 | List secondLevels = new List.generate(15, (int index) { 255 | if (index == 0) { 256 | return '全部'; 257 | } 258 | return '$_selectTempFirstLevelIndex$index街道办'; 259 | }); 260 | 261 | return Row( 262 | children: [ 263 | Container( 264 | width: 100, 265 | child: ListView( 266 | children: firstLevels.map( 267 | (item) { 268 | int index = firstLevels.indexOf(item); 269 | return gestureDetector0(index, itemOnTap, item); 270 | }, 271 | ).toList(), 272 | ), 273 | ), 274 | Expanded( 275 | child: Container( 276 | color: Colors.grey[200], 277 | child: _selectTempFirstLevelIndex == 0 278 | ? Container() 279 | : ListView( 280 | children: secondLevels.map( 281 | (item) { 282 | int index = secondLevels.indexOf(item); 283 | return gestureDetector1(index, itemOnTap, firstLevels, item); 284 | }, 285 | ).toList(), 286 | ), 287 | ), 288 | ), 289 | ], 290 | ); 291 | } 292 | 293 | GestureDetector gestureDetector0(int index, void itemOnTap(String selectValue), item) { 294 | return GestureDetector( 295 | onTap: () { 296 | _selectTempFirstLevelIndex = index; 297 | 298 | if (_selectTempFirstLevelIndex == 0) { 299 | itemOnTap('全城'); 300 | return; 301 | } 302 | setState(() {}); 303 | }, 304 | child: Container( 305 | height: 40, 306 | color: _selectTempFirstLevelIndex == index ? Colors.grey[200] : Colors.white, 307 | alignment: Alignment.center, 308 | child: _selectTempFirstLevelIndex == index 309 | ? Text( 310 | '$item', 311 | style: TextStyle( 312 | color: Theme.of(context).primaryColor, 313 | ), 314 | ) 315 | : Text('$item'), 316 | ), 317 | ); 318 | } 319 | 320 | GestureDetector gestureDetector1(int index, void itemOnTap(String selectValue), List firstLevels, item) { 321 | return GestureDetector( 322 | onTap: () { 323 | _selectSecondLevelIndex = index; 324 | _selectFirstLevelIndex = _selectTempFirstLevelIndex; 325 | if (_selectSecondLevelIndex == 0) { 326 | itemOnTap(firstLevels[_selectFirstLevelIndex]); 327 | } else { 328 | itemOnTap(item); 329 | } 330 | }, 331 | child: Container( 332 | height: 40, 333 | alignment: Alignment.centerLeft, 334 | child: Row( 335 | children: [ 336 | SizedBox( 337 | width: 20, 338 | ), 339 | _selectFirstLevelIndex == _selectTempFirstLevelIndex && _selectSecondLevelIndex == index 340 | ? Text( 341 | '$item', 342 | style: TextStyle( 343 | color: Theme.of(context).primaryColor, 344 | ), 345 | ) 346 | : Text('$item'), 347 | ], 348 | ), 349 | ), 350 | ); 351 | } 352 | 353 | _buildConditionListWidget(items, void itemOnTap(SortCondition sortCondition)) { 354 | return ListView.separated( 355 | shrinkWrap: true, 356 | scrollDirection: Axis.vertical, 357 | itemCount: items.length, 358 | // item 的个数 359 | separatorBuilder: (BuildContext context, int index) => Divider(height: 1.0), 360 | // 添加分割线 361 | itemBuilder: (BuildContext context, int index) { 362 | return gestureDetector(items, index, itemOnTap, context); 363 | }, 364 | ); 365 | } 366 | 367 | GestureDetector gestureDetector(items, int index, void itemOnTap(SortCondition sortCondition), BuildContext context) { 368 | SortCondition goodsSortCondition = items[index]; 369 | return GestureDetector( 370 | onTap: () { 371 | for (var value in items) { 372 | value.isSelected = false; 373 | } 374 | goodsSortCondition.isSelected = true; 375 | 376 | itemOnTap(goodsSortCondition); 377 | }, 378 | child: Container( 379 | // color: Colors.blue, 380 | height: 40, 381 | child: Row( 382 | children: [ 383 | SizedBox( 384 | width: 16, 385 | ), 386 | Expanded( 387 | child: Text( 388 | goodsSortCondition.name, 389 | style: TextStyle( 390 | color: goodsSortCondition.isSelected ? Theme.of(context).primaryColor : Colors.black, 391 | ), 392 | ), 393 | ), 394 | goodsSortCondition.isSelected 395 | ? Icon( 396 | Icons.check, 397 | color: Theme.of(context).primaryColor, 398 | size: 16, 399 | ) 400 | : SizedBox(), 401 | SizedBox( 402 | width: 16, 403 | ), 404 | ], 405 | ), 406 | ), 407 | ); 408 | } 409 | } 410 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'gzx_dropdown_menu_test_page.dart'; 4 | 5 | void main() { 6 | print('main'); 7 | runApp(MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | // This widget is the root of your application. 12 | @override 13 | Widget build(BuildContext context) { 14 | return MaterialApp( 15 | title: 'Flutter Demo', 16 | debugShowCheckedModeBanner: false, 17 | theme: ThemeData( 18 | // This is the theme of your application. 19 | // 20 | // Try running your application with "flutter run". You'll see the 21 | // application has a blue toolbar. Then, without quitting the app, try 22 | // changing the primarySwatch below to Colors.green and then invoke 23 | // "hot reload" (press "r" in the console where you ran "flutter run", 24 | // or simply save your changes to "hot reload" in a Flutter IDE). 25 | // Notice that the counter didn't reset back to zero; the application 26 | // is not restarted. 27 | primarySwatch: Colors.blue, 28 | ), 29 | home: GZXDropDownMenuTestPage(), 30 | // home: TestPage(), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example/lib/test_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TestPage extends StatefulWidget { 4 | @override 5 | _TestPageState createState() => _TestPageState(); 6 | } 7 | 8 | class _TestPageState extends State { 9 | var _scaffoldKey = new GlobalKey(); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | print('_TestPageState.build'); 14 | 15 | return Scaffold( 16 | key: _scaffoldKey, 17 | endDrawer: Container( 18 | margin: EdgeInsets.only(left: MediaQuery.of(context).size.width / 4, top: 0), 19 | color: Colors.white, 20 | // child: Container(color: Colors.red,child: Padding( 21 | // padding: const EdgeInsets.all(8.0), 22 | // child: TextField(), 23 | // ),), 24 | child: ListView( 25 | children: [TextField()], 26 | ), 27 | ), 28 | appBar: AppBar( 29 | leading: Container(), 30 | actions: [ 31 | IconButton( 32 | icon: Icon(Icons.menu), 33 | onPressed: () { 34 | _scaffoldKey.currentState!.openEndDrawer(); 35 | }) 36 | ], 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: gzx_dropdown_menu_example 2 | description: Demonstrates how to use the gzx_dropdown_menu plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | #Dart 运行环境区间 9 | environment: 10 | # sdk: ">=2.11.0 <3.0.0" # Dart SDK版本号,多人开发建议写死 11 | # 健全的空安全已在 Dart 2.12 和 Flutter 2 中可用。 12 | # 所以迁移到空安全的 13 | # 第一步:升级Flutter到2.0 14 | # 第二步:修改Dart SDK范围为2.12.x以上 15 | sdk: ">=2.12.0 <3.0.0" 16 | 17 | dependencies: 18 | flutter: 19 | sdk: flutter 20 | 21 | # The following adds the Cupertino Icons font to your application. 22 | # Use with the CupertinoIcons class for iOS style icons. 23 | cupertino_icons: ^1.0.2 24 | 25 | # 你可以通过以下三种方式引入gzx_dropdown_menu 26 | 27 | # 方式1:使用语义版本控制(推荐使用) 28 | # ^3.1.5 等于 '>=3.1.5 <4.0.0' 29 | # ^1.2.3 等于 '>=1.2.3 <2.0.0' 30 | # ^0.1.2 等于 '>=0.1.2 <0.2.0' 31 | # see detail https://stackoverflow.com/questions/53563079/what-is-the-caret-sign-before-the-dependency-version-number-in-flutters-pub 32 | # gzx_dropdown_menu : ^2.1.0 33 | 34 | # 方式2:通过远程Git仓库 35 | # gzx_dropdown_menu : 36 | # git: 37 | # url: https://github.com/GanZhiXiong/gzx_dropdown_menu.git 38 | 39 | # 方式3:通过本地路径 40 | gzx_dropdown_menu: 41 | path: ../ 42 | 43 | dev_dependencies: 44 | flutter_test: 45 | sdk: flutter 46 | 47 | # For information on the generic Dart part of this file, see the 48 | # following page: https://dart.dev/tools/pub/pubspec 49 | 50 | # The following section is specific to Flutter. 51 | flutter: 52 | 53 | # The following line ensures that the Material Icons font is 54 | # included with your application, so that you can use the icons in 55 | # the material Icons class. 56 | uses-material-design: true 57 | 58 | # To add assets to your application, add an assets section, like this: 59 | # assets: 60 | # - images/a_dot_burr.jpeg 61 | # - images/a_dot_ham.jpeg 62 | 63 | # An image asset can refer to one or more resolution-specific "variants", see 64 | # https://flutter.dev/assets-and-images/#resolution-aware. 65 | 66 | # For details regarding adding assets from package dependencies, see 67 | # https://flutter.dev/assets-and-images/#from-packages 68 | 69 | # To add custom fonts to your application, add a fonts section here, 70 | # in this "flutter" section. Each entry in this list should have a 71 | # "family" key with the font family name, and a "fonts" key with a 72 | # list giving the asset and other descriptors for the font. For 73 | # example: 74 | # fonts: 75 | # - family: Schyler 76 | # fonts: 77 | # - asset: fonts/Schyler-Regular.ttf 78 | # - asset: fonts/Schyler-Italic.ttf 79 | # style: italic 80 | # - family: Trajan Pro 81 | # fonts: 82 | # - asset: fonts/TrajanPro.ttf 83 | # - asset: fonts/TrajanPro_Bold.ttf 84 | # weight: 700 85 | # 86 | # For details regarding fonts from package dependencies, 87 | # see https://flutter.dev/custom-fonts/#from-packages 88 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:gzx_dropdown_menu_example/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(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/gzx_dropdown_menu.dart: -------------------------------------------------------------------------------- 1 | library gzx_dropdown_menu; 2 | 3 | export 'src/gzx_dropdown_header.dart'; 4 | export 'src/gzx_dropdown_menu.dart'; 5 | export 'src/gzx_dropdown_menu_controller.dart'; 6 | -------------------------------------------------------------------------------- /lib/src/gzx_dropdown_header.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'gzx_dropdown_menu_controller.dart'; 4 | 5 | /// Signature for when a tap has occurred. 6 | typedef OnItemTap = void Function(T value); 7 | 8 | /// Dropdown header widget. 9 | class GZXDropDownHeader extends StatefulWidget { 10 | final Color color; 11 | final double borderWidth; 12 | final Color borderColor; 13 | final TextStyle style; 14 | final TextStyle? dropDownStyle; 15 | final double iconSize; 16 | final Color iconColor; 17 | final Color? iconDropDownColor; 18 | 19 | // final List menuStrings; 20 | final double height; 21 | final double dividerHeight; 22 | final Color dividerColor; 23 | final GZXDropdownMenuController controller; 24 | final OnItemTap? onItemTap; 25 | final List items; 26 | final GlobalKey stackKey; 27 | 28 | /// Creates a dropdown header widget, Contains more than one header items. 29 | GZXDropDownHeader({ 30 | Key? key, 31 | required this.items, 32 | required this.controller, 33 | required this.stackKey, 34 | this.style = const TextStyle(color: Color(0xFF666666), fontSize: 13), 35 | this.dropDownStyle, 36 | this.height = 40, 37 | this.iconColor = const Color(0xFFafada7), 38 | this.iconDropDownColor, 39 | this.iconSize = 20, 40 | this.borderWidth = 1, 41 | this.borderColor = const Color(0xFFeeede6), 42 | this.dividerHeight = 20, 43 | this.dividerColor = const Color(0xFFeeede6), 44 | this.onItemTap, 45 | this.color = Colors.white, 46 | }) : super(key: key); 47 | 48 | @override 49 | _GZXDropDownHeaderState createState() => _GZXDropDownHeaderState(); 50 | } 51 | 52 | class _GZXDropDownHeaderState extends State 53 | with SingleTickerProviderStateMixin { 54 | bool _isShowDropDownItemWidget = false; 55 | late double _screenWidth; 56 | late int _menuCount; 57 | GlobalKey _keyDropDownHeader = GlobalKey(); 58 | TextStyle? _dropDownStyle; 59 | Color? _iconDropDownColor; 60 | 61 | @override 62 | void initState() { 63 | // TODO: implement initState 64 | super.initState(); 65 | widget.controller.addListener(_onController); 66 | } 67 | 68 | _onController() { 69 | if (mounted) { 70 | setState(() {}); 71 | } 72 | // print(widget.controller.menuIndex); 73 | } 74 | 75 | @override 76 | Widget build(BuildContext context) { 77 | // print('_GZXDropDownHeaderState.build'); 78 | 79 | _dropDownStyle = widget.dropDownStyle ?? 80 | TextStyle(color: Theme.of(context).primaryColor, fontSize: 13); 81 | _iconDropDownColor = 82 | widget.iconDropDownColor ?? Theme.of(context).primaryColor; 83 | 84 | MediaQueryData mediaQuery = MediaQuery.of(context); 85 | _screenWidth = mediaQuery.size.width; 86 | _menuCount = widget.items.length; 87 | 88 | var gridView = GridView.count( 89 | physics: NeverScrollableScrollPhysics(), 90 | crossAxisCount: _menuCount, 91 | childAspectRatio: (_screenWidth / _menuCount) / widget.height, 92 | children: widget.items.map((item) { 93 | return _menu(item); 94 | }).toList(), 95 | ); 96 | 97 | return Container( 98 | key: _keyDropDownHeader, 99 | height: widget.height, 100 | // padding: EdgeInsets.only(top: 1, bottom: 1), 101 | decoration: BoxDecoration( 102 | border: Border.all( 103 | color: widget.borderColor, 104 | width: widget.borderWidth, 105 | ), 106 | ), 107 | child: gridView, 108 | ); 109 | } 110 | 111 | dispose() { 112 | super.dispose(); 113 | } 114 | 115 | _menu(GZXDropDownHeaderItem item) { 116 | int index = widget.items.indexOf(item); 117 | int menuIndex = widget.controller.menuIndex; 118 | _isShowDropDownItemWidget = index == menuIndex && widget.controller.isShow; 119 | 120 | return GestureDetector( 121 | onTap: () { 122 | final RenderBox? overlay = 123 | widget.stackKey.currentContext!.findRenderObject() as RenderBox?; 124 | 125 | final RenderBox dropDownItemRenderBox = 126 | _keyDropDownHeader.currentContext!.findRenderObject() as RenderBox; 127 | 128 | var position = 129 | dropDownItemRenderBox.localToGlobal(Offset.zero, ancestor: overlay); 130 | // print("POSITION : $position "); 131 | var size = dropDownItemRenderBox.size; 132 | // print("SIZE : $size"); 133 | 134 | widget.controller.dropDownMenuTop = size.height + position.dy; 135 | 136 | if (index == menuIndex) { 137 | if (widget.controller.isShow) { 138 | widget.controller.hide(); 139 | } else { 140 | widget.controller.show(index); 141 | } 142 | } else { 143 | if (widget.controller.isShow) { 144 | widget.controller.hide(isShowHideAnimation: false); 145 | } 146 | widget.controller.show(index); 147 | } 148 | 149 | if (widget.onItemTap != null) { 150 | widget.onItemTap!(index); 151 | } 152 | 153 | setState(() {}); 154 | }, 155 | child: Container( 156 | color: widget.color, 157 | child: Row( 158 | mainAxisAlignment: MainAxisAlignment.center, 159 | children: [ 160 | Expanded( 161 | child: Row( 162 | mainAxisAlignment: MainAxisAlignment.center, 163 | children: [ 164 | Flexible( 165 | child: Text( 166 | item.title, 167 | maxLines: 1, 168 | overflow: TextOverflow.ellipsis, 169 | style: _isShowDropDownItemWidget 170 | ? _dropDownStyle 171 | : widget.style.merge(item.style), 172 | ), 173 | ), 174 | Icon( 175 | !_isShowDropDownItemWidget 176 | ? item.iconData ?? Icons.arrow_drop_down 177 | : item.iconDropDownData ?? 178 | item.iconData ?? 179 | Icons.arrow_drop_up, 180 | color: _isShowDropDownItemWidget 181 | ? _iconDropDownColor 182 | : item.style?.color ?? widget.iconColor, 183 | size: item.iconSize ?? widget.iconSize, 184 | ), 185 | ], 186 | ), 187 | ), 188 | index == widget.items.length - 1 189 | ? Container() 190 | : Container( 191 | height: widget.dividerHeight, 192 | decoration: BoxDecoration( 193 | border: Border( 194 | right: BorderSide(color: widget.dividerColor, width: 1), 195 | ), 196 | ), 197 | ), 198 | ], 199 | ), 200 | ), 201 | ); 202 | } 203 | } 204 | 205 | class GZXDropDownHeaderItem { 206 | final String title; 207 | final IconData? iconData; 208 | final IconData? iconDropDownData; 209 | final double? iconSize; 210 | final TextStyle? style; 211 | 212 | GZXDropDownHeaderItem( 213 | this.title, { 214 | this.iconData, 215 | this.iconDropDownData, 216 | this.iconSize, 217 | this.style, 218 | }); 219 | } 220 | -------------------------------------------------------------------------------- /lib/src/gzx_dropdown_menu.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'gzx_dropdown_menu_controller.dart'; 4 | 5 | /// Information about the dropdown menu widget, such as the height of the drop down menu to be displayed. 6 | class GZXDropdownMenuBuilder { 7 | /// A dropdown menu displays the widget. 8 | final Widget dropDownWidget; 9 | 10 | /// Dropdown menu height. 11 | final double dropDownHeight; 12 | 13 | GZXDropdownMenuBuilder({ 14 | required this.dropDownWidget, 15 | required this.dropDownHeight, 16 | }); 17 | } 18 | 19 | typedef DropdownMenuChange = void Function(bool isShow, int? index); 20 | 21 | /// Dropdown menu widget. 22 | class GZXDropDownMenu extends StatefulWidget { 23 | final GZXDropdownMenuController controller; 24 | final List menus; 25 | final int animationMilliseconds; 26 | final Color maskColor; 27 | 28 | /// Called when dropdown menu start showing or hiding. 29 | final DropdownMenuChange? dropdownMenuChanging; 30 | 31 | /// Called when dropdown menu has been shown or hidden. 32 | final DropdownMenuChange? dropdownMenuChanged; 33 | 34 | /// Creates a dropdown menu widget. 35 | /// The widget must be inside the Stack because the widget is a Positioned. 36 | const GZXDropDownMenu({ 37 | Key? key, 38 | required this.controller, 39 | required this.menus, 40 | this.animationMilliseconds = 500, 41 | this.maskColor = const Color.fromRGBO(0, 0, 0, 0.5), 42 | this.dropdownMenuChanging, 43 | this.dropdownMenuChanged, 44 | }) : super(key: key); 45 | 46 | @override 47 | _GZXDropDownMenuState createState() => _GZXDropDownMenuState(); 48 | } 49 | 50 | class _GZXDropDownMenuState extends State 51 | with SingleTickerProviderStateMixin { 52 | bool _isShowDropDownItemWidget = false; 53 | bool _isShowMask = false; 54 | bool _isControllerDisposed = false; 55 | Animation? _animation; 56 | AnimationController? _controller; 57 | 58 | late double _maskColorOpacity; 59 | 60 | double? _dropDownHeight; 61 | 62 | int? _currentMenuIndex; 63 | 64 | @override 65 | void initState() { 66 | // TODO: implement initState 67 | super.initState(); 68 | 69 | widget.controller.addListener(_onController); 70 | _controller = new AnimationController( 71 | duration: Duration(milliseconds: widget.animationMilliseconds), 72 | vsync: this); 73 | } 74 | 75 | _onController() { 76 | // print('_GZXDropDownMenuState._onController ${widget.controller.menuIndex}'); 77 | 78 | _showDropDownItemWidget(); 79 | } 80 | 81 | @override 82 | Widget build(BuildContext context) { 83 | // print('_GZXDropDownMenuState.build'); 84 | _controller!.duration = 85 | Duration(milliseconds: widget.animationMilliseconds); 86 | return _buildDropDownWidget(); 87 | } 88 | 89 | dispose() { 90 | _animation?.removeListener(_animationListener); 91 | _animation?.removeStatusListener(_animationStatusListener); 92 | widget.controller.removeListener(_onController); 93 | _controller?.dispose(); 94 | _isControllerDisposed = true; 95 | super.dispose(); 96 | } 97 | 98 | _showDropDownItemWidget() { 99 | _currentMenuIndex = widget.controller.menuIndex; 100 | if (_currentMenuIndex! >= widget.menus.length) { 101 | return; 102 | } 103 | 104 | _isShowDropDownItemWidget = !_isShowDropDownItemWidget; 105 | if (widget.dropdownMenuChanging != null) { 106 | widget.dropdownMenuChanging!( 107 | _isShowDropDownItemWidget, _currentMenuIndex); 108 | } 109 | if (!_isShowMask) { 110 | _isShowMask = true; 111 | } 112 | 113 | _dropDownHeight = widget.menus[_currentMenuIndex!].dropDownHeight; 114 | 115 | _animation?.removeListener(_animationListener); 116 | _animation?.removeStatusListener(_animationStatusListener); 117 | _animation = 118 | new Tween(begin: 0.0, end: _dropDownHeight).animate(_controller!) 119 | ..addListener(_animationListener) 120 | ..addStatusListener(_animationStatusListener); 121 | 122 | if (_isControllerDisposed) return; 123 | 124 | // print('${widget.controller.isShow}'); 125 | 126 | if (widget.controller.isShow) { 127 | _controller!.forward(); 128 | } else if (widget.controller.isShowHideAnimation) { 129 | _controller!.reverse(); 130 | } else { 131 | _controller!.value = 0; 132 | } 133 | } 134 | 135 | void _animationStatusListener(AnimationStatus status) { 136 | switch (status) { 137 | case AnimationStatus.dismissed: 138 | // print('dismissed'); 139 | _isShowMask = false; 140 | if (widget.dropdownMenuChanged != null) { 141 | widget.dropdownMenuChanged!(false, _currentMenuIndex); 142 | } 143 | break; 144 | case AnimationStatus.forward: 145 | // TODO: Handle this case. 146 | break; 147 | case AnimationStatus.reverse: 148 | // TODO: Handle this case. 149 | break; 150 | case AnimationStatus.completed: 151 | // print('completed'); 152 | if (widget.dropdownMenuChanged != null) { 153 | widget.dropdownMenuChanged!(true, _currentMenuIndex); 154 | } 155 | break; 156 | } 157 | } 158 | 159 | void _animationListener() { 160 | var heightScale = _animation!.value / _dropDownHeight!; 161 | _maskColorOpacity = widget.maskColor.opacity * heightScale; 162 | // print('$_maskColorOpacity'); 163 | //这行如果不写,没有动画效果 164 | setState(() {}); 165 | } 166 | 167 | Widget _mask() { 168 | if (_isShowMask) { 169 | return GestureDetector( 170 | onTap: () { 171 | widget.controller.hide(); 172 | }, 173 | child: Container( 174 | width: double.infinity, 175 | height: MediaQuery.of(context).size.height, 176 | color: widget.maskColor.withOpacity(_maskColorOpacity), 177 | // color: widget.maskColor, 178 | ), 179 | ); 180 | } else { 181 | return Container( 182 | height: 0, 183 | ); 184 | } 185 | } 186 | 187 | Widget _buildDropDownWidget() { 188 | int menuIndex = widget.controller.menuIndex; 189 | 190 | if (menuIndex >= widget.menus.length) { 191 | return Container(); 192 | } 193 | 194 | return Positioned( 195 | top: widget.controller.dropDownMenuTop, 196 | left: 0, 197 | right: 0, 198 | child: Column( 199 | children: [ 200 | Container( 201 | color: Colors.white, 202 | width: double.infinity, 203 | height: _animation == null ? 0 : _animation!.value, 204 | child: widget.menus[menuIndex].dropDownWidget, 205 | ), 206 | _mask(), 207 | ], 208 | )); 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /lib/src/gzx_dropdown_menu_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | /// GZXDropdownMenuController use to show and hide drop-down menus. 4 | /// Used for GZXDropdownHeader and GZXDropdownMenu passing[dropDownMenuTop], [menuIndex], [isShow] and [isShowHideAnimation]. 5 | class GZXDropdownMenuController extends ChangeNotifier { 6 | /// [dropDownMenuTop] that the GZXDropDownMenu top edge is inset from the top of the stack. 7 | /// 8 | /// Since the GZXDropDownMenu actually returns a Positioned widget, the GZXDropDownMenu must be inside the Stack 9 | /// vertically. 10 | double? dropDownMenuTop; 11 | 12 | /// Current or last dropdown menu index, default is 0. 13 | int menuIndex = 0; 14 | 15 | /// Whether to display a dropdown menu. 16 | bool isShow = false; 17 | 18 | /// Whether to display animations when hiding dropdown menu. 19 | bool isShowHideAnimation = false; 20 | 21 | /// Use to display GZXDropdownMenu specified dropdown menu index. 22 | void show(int index) { 23 | isShow = true; 24 | menuIndex = index; 25 | notifyListeners(); 26 | } 27 | 28 | /// Use to hide GZXDropdownMenu. If you don't need to show the hidden animation, [isShowHideAnimation] pass in false, Like when you click on another GZXDropdownHeaderItem. 29 | void hide({bool isShowHideAnimation = true}) { 30 | this.isShowHideAnimation = isShowHideAnimation; 31 | isShow = false; 32 | notifyListeners(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /preview_images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/preview_images/1.png -------------------------------------------------------------------------------- /preview_images/淘宝.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/preview_images/淘宝.gif -------------------------------------------------------------------------------- /preview_images/美团.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GanZhiXiong/gzx_dropdown_menu/a3d3fbf686dbcf0e83aaeeb72c5622f2ce5a379b/preview_images/美团.gif -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.5.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.2.0" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0" 46 | fake_async: 47 | dependency: transitive 48 | description: 49 | name: fake_async 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.2.0" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_test: 59 | dependency: "direct dev" 60 | description: flutter 61 | source: sdk 62 | version: "0.0.0" 63 | matcher: 64 | dependency: transitive 65 | description: 66 | name: matcher 67 | url: "https://pub.flutter-io.cn" 68 | source: hosted 69 | version: "0.12.10" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.flutter-io.cn" 75 | source: hosted 76 | version: "1.3.0" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "1.8.0" 84 | sky_engine: 85 | dependency: transitive 86 | description: flutter 87 | source: sdk 88 | version: "0.0.99" 89 | source_span: 90 | dependency: transitive 91 | description: 92 | name: source_span 93 | url: "https://pub.flutter-io.cn" 94 | source: hosted 95 | version: "1.8.0" 96 | stack_trace: 97 | dependency: transitive 98 | description: 99 | name: stack_trace 100 | url: "https://pub.flutter-io.cn" 101 | source: hosted 102 | version: "1.10.0" 103 | stream_channel: 104 | dependency: transitive 105 | description: 106 | name: stream_channel 107 | url: "https://pub.flutter-io.cn" 108 | source: hosted 109 | version: "2.1.0" 110 | string_scanner: 111 | dependency: transitive 112 | description: 113 | name: string_scanner 114 | url: "https://pub.flutter-io.cn" 115 | source: hosted 116 | version: "1.1.0" 117 | term_glyph: 118 | dependency: transitive 119 | description: 120 | name: term_glyph 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "1.2.0" 124 | test_api: 125 | dependency: transitive 126 | description: 127 | name: test_api 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "0.2.19" 131 | typed_data: 132 | dependency: transitive 133 | description: 134 | name: typed_data 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "1.3.0" 138 | vector_math: 139 | dependency: transitive 140 | description: 141 | name: vector_math 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "2.1.0" 145 | sdks: 146 | dart: ">=2.12.0 <3.0.0" 147 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: gzx_dropdown_menu 2 | description: A custom is strong dropdown menu for Flutter. Easy to use and powerful for customization, it's up to you what you want to display in the dropdown menu! 3 | version: 3.1.0 4 | homepage: https://github.com/GanZhiXiong/gzx_dropdown_menu 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://www.dartlang.org/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | 23 | # To add assets to your package, add an assets section, like this: 24 | # assets: 25 | # - images/a_dot_burr.jpeg 26 | # - images/a_dot_ham.jpeg 27 | # 28 | # For details regarding assets in packages, see 29 | # https://flutter.dev/assets-and-images/#from-packages 30 | # 31 | # An image asset can refer to one or more resolution-specific "variants", see 32 | # https://flutter.dev/assets-and-images/#resolution-aware. 33 | 34 | # To add custom fonts to your package, add a fonts section here, 35 | # in this "flutter" section. Each entry in this list should have a 36 | # "family" key with the font family name, and a "fonts" key with a 37 | # list giving the asset and other descriptors for the font. For 38 | # example: 39 | # fonts: 40 | # - family: Schyler 41 | # fonts: 42 | # - asset: fonts/Schyler-Regular.ttf 43 | # - asset: fonts/Schyler-Italic.ttf 44 | # style: italic 45 | # - family: Trajan Pro 46 | # fonts: 47 | # - asset: fonts/TrajanPro.ttf 48 | # - asset: fonts/TrajanPro_Bold.ttf 49 | # weight: 700 50 | # 51 | # For details regarding fonts in packages, see 52 | # https://flutter.dev/custom-fonts/#from-packages 53 | -------------------------------------------------------------------------------- /test/gzx_dropdown_menu_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | --------------------------------------------------------------------------------