Skip to content

Commit

Permalink
adds code documentation and license
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushBherwani1998 committed Apr 11, 2020
1 parent c935d40 commit f7b3d4d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
46 changes: 46 additions & 0 deletions lib/src/flutter/drop_down_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,68 @@ class VxDropDownButton extends VxWidgetBuilder<StatefulBuilder> {
@required this.valueHolder,
}) : assert(valueHolder != null);

/// The List<String> used to create [DropdownMenuItem].
///
/// _items can't be null.
final List<String> _items;

/// The value used to define currently selected value of [VxDropDownButton].
String valueHolder;

/// Defines the [TextStyle] for [DropdownMenuItem].
///
/// By default the value of `_textStyle` is [TextTheme.subhead]
/// value of the current [ThemeData.textTheme].
TextStyle _textStyle;

/// Defines the widget used to draw underline for [VxDropDownButton]
Widget _underLine;

/// Defines the elevation for menu when drop down is open.
///
/// By default, the value of `_elevation` is 8.
int _elevation;

/// Defines the size of [VxDropDownButton] icon.
///
/// By default, the value of `_iconSize` is 24.
double _iconSize;

/// The [Icon] used for [VxDropDownButton].
///
/// By default, the icon is [Icons.arrow_drop_down]
Icon _dropDownIcon;

/// Defines the drop down button icon color when button is disabled.
///
/// By default, the color is `Colors.grey.shade400`.
Color _disabledIconColor;

/// Defines the drop down button icon color when button is enabled.
///
/// By default, the color is `Colors.grey.shade700` when the theme's [ThemeData.brightness]
/// is [Brightness.light] and to [Colors.white70] when it is [Brightness.dark].
Color _enabledIconColor;

/// The color for the button's Material when it has the input focus.
Color _focusColor;

/// If the `_autoFocus` is true, [VxDropDownButton] will be selected as the initial focus when no other node
/// in its scope is currently focused.
bool _autoFocus = false;

/// Set the dropdown's inner contents to horizontally fill its parent.
bool _isExpanded = false;

/// Reduce the button's height.
///
/// By default this button's height is the same as its menu items' heights.
bool _isDense = false;

/// Called when user selects a value from drop down menu.
ValueChanged<String> _onValueChange;


VxDropDownButton textStyle(TextStyle style) => this.._textStyle = style;

VxDropDownButton underLine(Widget widget) => this.._underLine = widget;
Expand Down
13 changes: 13 additions & 0 deletions test/flutter/drop_down_button_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Copyright 2020 Pawan Kumar. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:velocity_x/velocity_x.dart';
Expand Down

0 comments on commit f7b3d4d

Please sign in to comment.