DropdownBody constructor

DropdownBody({
  1. required Key key,
  2. required GlobalKey<State<StatefulWidget>> inputKey,
  3. required List dropdownList,
  4. required Function onChange,
  5. required Function closeDropdown,
  6. required Function getSelectedItem,
  7. required Map selectedItem,
  8. required bool dropdownItemReverse,
  9. required bool isTriangle,
  10. required double resultWidth,
  11. required double resultHeight,
  12. double? dropdownWidth,
  13. required double dropdownHeight,
  14. required double dropdownItemHeight,
  15. required Alignment resultAlign,
  16. required String dropdownAlign,
  17. required String triangleAlign,
  18. required Alignment dropdownItemAlign,
  19. required MainAxisAlignment dropdownItemMainAxis,
  20. required EdgeInsets dropdownItemPadding,
  21. required EdgeInsets dropdownPadding,
  22. required EdgeInsets selectedItemPadding,
  23. required BoxDecoration resultBD,
  24. required BoxDecoration dropdownBD,
  25. required BoxDecoration selectedItemBD,
  26. required TextStyle selectedItemTS,
  27. required TextStyle unselectedItemTS,
  28. required double labelIconGap,
  29. required double dropdownItemGap,
  30. required double dropdownItemTopGap,
  31. required double dropdownItemBottomGap,
  32. required double gap,
  33. required double triangleWidth,
  34. required double triangleHeight,
  35. required bool isAnimation,
  36. required bool isResultLabel,
  37. required BuildContext bodyContext,
  38. required bool isDropdownLabel,
  39. dynamic triangleBorder,
  40. required double triangleLeft,
})

Implementation

DropdownBody(
    {required this.key,
    required this.inputKey,
    required this.dropdownList,
    required this.onChange,
    required this.closeDropdown,
    required this.getSelectedItem,
    required this.selectedItem,
    required this.dropdownItemReverse,
    required this.isTriangle,
    required this.resultWidth,
    required this.resultHeight,
    this.dropdownWidth,
    required this.dropdownHeight,
    required this.dropdownItemHeight,
    required this.resultAlign,
    required this.dropdownAlign,
    required this.triangleAlign,
    required this.dropdownItemAlign,
    required this.dropdownItemMainAxis,
    required this.dropdownItemPadding,
    required this.dropdownPadding,
    required this.selectedItemPadding,
    required this.resultBD,
    required this.dropdownBD,
    required this.selectedItemBD,
    required this.selectedItemTS,
    required this.unselectedItemTS,
    required this.labelIconGap,
    required this.dropdownItemGap,
    required this.dropdownItemTopGap,
    required this.dropdownItemBottomGap,
    required this.gap,
    required this.triangleWidth,
    required this.triangleHeight,
    required this.isAnimation,
    required this.isResultLabel,
    required this.bodyContext,
    required this.isDropdownLabel,
    triangleBorder,
    required this.triangleLeft}) {
  // dropdown list 초기화
  for (var i = 0; i < this.dropdownList.length; i++) {
    this.dropdownIsSelected.add(false);
  }
  // 삼각형 border 셋팅
  this.triangleBorder = this.dropdownBD.border != null
      ? this.dropdownBD.border!.top
      : BorderSide(
          color: Colors.transparent,
          width: 0,
          style: BorderStyle.none,
        );
  // 그림자 셋팅
  triangleBoxShadows = this.dropdownBD.boxShadow ?? [];
  // screenHeight 셋팅
  this.screenHeight = MediaQuery.of(this.bodyContext).size.height;
  // dropdownWidth setting
  this.dropdownWidth = this.dropdownWidth ?? this.resultWidth;
}