Skip to content

Commit

Permalink
Fix #1 #2 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Aug 6, 2019
1 parent ce43417 commit 4067daf
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.3] - [2019-08-06]
* 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)
* 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)

## [1.0.2] - [2019-06-06]
* update readme

Expand Down
6 changes: 4 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 5TJCW7YTN9;
LastSwiftMigration = 0910;
};
};
Expand Down Expand Up @@ -307,7 +308,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = S8QB4VV633;
DEVELOPMENT_TEAM = 5TJCW7YTN9;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -436,6 +437,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 5TJCW7YTN9;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -464,6 +466,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 5TJCW7YTN9;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -508,7 +511,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
17 changes: 12 additions & 5 deletions example/lib/gzx_dropdown_menu_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class GZXDropDownMenuTestPage extends StatefulWidget {
}

class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {
List<String> _dropDownHeaderItemStrings = ['全城', '品牌', '价格低', '筛选'];
List<String> _dropDownHeaderItemStrings = ['全城', '品牌', '距离近', '筛选'];
List<SortCondition> _brandSortConditions = [];
List<SortCondition> _distanceSortConditions = [];
SortCondition _selectBrandSortCondition;
Expand Down Expand Up @@ -51,6 +51,8 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {

_distanceSortConditions.add(SortCondition(name: '距离近', isSelected: true));
_distanceSortConditions.add(SortCondition(name: '价格低', isSelected: false));
_distanceSortConditions.add(SortCondition(name: '价格高', isSelected: false));

_selectDistanceSortCondition = _distanceSortConditions[0];
}

Expand All @@ -71,6 +73,13 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {
endDrawer: Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width / 4, top: 0),
color: Colors.white,
// child: Container(color: Colors.red,child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: TextField(),
// ),),
child: ListView(
children: <Widget>[TextField()],
),
),
body: Stack(
key: _stackKey,
Expand Down Expand Up @@ -108,7 +117,6 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {
onItemTap: (index) {
if (index == 3) {
_scaffoldKey.currentState.openEndDrawer();
_dropdownMenuController.hide();
}
},
// // 头部的高度
Expand Down Expand Up @@ -179,8 +187,8 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {
GZXDropdownMenuBuilder(
dropDownHeight: 40.0 * _distanceSortConditions.length,
dropDownWidget: _buildConditionListWidget(_distanceSortConditions, (value) {
_dropDownHeaderItemStrings[2] = _selectDistanceSortCondition.name;
_selectDistanceSortCondition = value;
_dropDownHeaderItemStrings[2] = _selectDistanceSortCondition.name;
_dropdownMenuController.hide();
setState(() {});
})),
Expand All @@ -193,7 +201,6 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {

int _selectTempFirstLevelIndex = 0;
int _selectFirstLevelIndex = 0;

int _selectSecondLevelIndex = -1;

_buildAddressWidget(void itemOnTap(String selectValue)) {
Expand Down Expand Up @@ -288,7 +295,7 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {
);
}

_buildConditionListWidget(items, void itemOnTap(sortCondition)) {
_buildConditionListWidget(items, void itemOnTap(SortCondition sortCondition)) {
return ListView.separated(
shrinkWrap: true,
scrollDirection: Axis.vertical,
Expand Down
4 changes: 3 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'gzx_dropdown_menu_test_page.dart';
import 'test_page.dart';

void main() {
print('main');
Expand All @@ -26,6 +27,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
),
home: GZXDropDownMenuTestPage(),
// home: TestPage(),
);
}
}
}
8 changes: 4 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
Expand Down Expand Up @@ -52,7 +52,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.2"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -80,7 +80,7 @@ packages:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
version: "1.7.0"
quiver:
dependency: transitive
description:
Expand Down Expand Up @@ -150,4 +150,4 @@ packages:
source: hosted
version: "2.0.8"
sdks:
dart: ">=2.2.0 <3.0.0"
dart: ">=2.2.2 <3.0.0"
2 changes: 2 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ dependencies:
cupertino_icons: ^0.1.2

# gzx_dropdown_menu : ^1.0.0

# gzx_dropdown_menu :
# git:
# url: https://github.com/GanZhiXiong/gzx_dropdown_menu.git

gzx_dropdown_menu :
path : ../

Expand Down
1 change: 1 addition & 0 deletions lib/src/gzx_dropdown_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class _GZXDropDownHeaderState extends State<GZXDropDownHeader> with SingleTicker
}

_onController() {
setState(() {});
// print(widget.controller.menuIndex);
}

Expand Down
6 changes: 5 additions & 1 deletion lib/src/gzx_dropdown_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class _GZXDropDownMenuState extends State<GZXDropDownMenu> with SingleTickerProv
if (_isShowMask) {
return GestureDetector(
onTap: () {
_hideDropDownItemWidget();
widget.controller.hide();
},
child: Container(
width: MediaQuery.of(context).size.width,
Expand All @@ -108,6 +108,10 @@ class _GZXDropDownMenuState extends State<GZXDropDownMenu> with SingleTickerProv
Widget _buildDropDownWidget() {
int menuIndex = widget.controller.menuIndex;

if (menuIndex >= widget.menus.length) {
return Container();
}

return Positioned(
width: MediaQuery.of(context).size.width,
top: widget.controller.dropDownHearderHeight,
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.2.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -66,14 +66,14 @@ packages:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
version: "1.7.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2"
version: "2.0.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -120,7 +120,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4"
version: "0.2.5"
typed_data:
dependency: transitive
description:
Expand All @@ -136,4 +136,4 @@ packages:
source: hosted
version: "2.0.8"
sdks:
dart: ">=2.2.0 <3.0.0"
dart: ">=2.2.2 <3.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: gzx_dropdown_menu
description: A custom is strong dropdown menu for Flutter.
version: 1.0.2
version: 1.0.3
author: GanZhiXiong <ganzhixiong@sina.cn>
homepage: https://github.com/GanZhiXiong/gzx_dropdown_menu

Expand Down

0 comments on commit 4067daf

Please sign in to comment.