Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement dividerHeight and dividerThickness #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class DatePicker {
String? cancelText,
bool looping: false,
bool reverse: false,
double? dividerHeight,
double? dividerThickness,
}) {
DateTime? _selectedDate = initialDate;
final List<Widget> listButtonActions = [
Expand Down Expand Up @@ -189,6 +191,8 @@ class DatePicker {
_selectedDate = date;
}),
looping: looping,
dividerHeight: dividerHeight,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to move this to the theme instead, (Since the dividerColor is passed there)

dividerThickness: dividerThickness,
),
),
actions:
Expand Down
12 changes: 8 additions & 4 deletions lib/widget/date_picker_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class DatePickerWidget extends StatefulWidget {
this.onChange,
this.onConfirm,
this.looping: false,
this.dividerHeight = 1,
this.dividerThickness = 2,
}) : super(key: key) {
DateTime minTime = firstDate ?? DateTime.parse(DATE_PICKER_MIN_DATETIME);
DateTime maxTime = lastDate ?? DateTime.parse(DATE_PICKER_MAX_DATETIME);
Expand All @@ -36,6 +38,8 @@ class DatePickerWidget extends StatefulWidget {
final String? dateFormat;
final DateTimePickerLocale? locale;
final DateTimePickerTheme? pickerTheme;
final double? dividerHeight;
final double? dividerThickness;

final DateVoidCallback? onCancel;
final DateValueCallback? onChange, onConfirm;
Expand Down Expand Up @@ -227,8 +231,8 @@ class _DatePickerWidgetState extends State<DatePickerWidget> {
child: Divider(
color: widget.pickerTheme!.dividerColor ??
widget.pickerTheme!.itemTextStyle.color,
height: 1,
thickness: 2,
height: widget.dividerHeight,
thickness: widget.dividerThickness,
),
),
SizedBox(width: MediaQuery.of(context).size.width * 0.02)
Expand All @@ -246,8 +250,8 @@ class _DatePickerWidgetState extends State<DatePickerWidget> {
child: Divider(
color: widget.pickerTheme!.dividerColor ??
widget.pickerTheme!.itemTextStyle.color,
height: 1,
thickness: 2,
height: widget.dividerHeight,
thickness: widget.dividerThickness,
),
),
SizedBox(width: MediaQuery.of(context).size.width * 0.02),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_holo_date_picker
description: A Flutter package of Datepicker that looks like Holo Theme in Android.
version: 1.0.6
version: 1.0.7
homepage: https://github.com/kfiross/flutter_holo_date_picker

environment:
Expand Down