Skip to content

add option for edge fading #14

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

QuentinSc
Copy link

@QuentinSc QuentinSc commented Oct 23, 2019

Hello,

I just discovered the package https://pub.dev/packages/fading_edge_scrollview and I love it.
I propose an option to use it in your fabulous widget.
I tried to implement it without complexify maintenance.
I added it to example.

Screenshot_1571833192

Thank you

@QuentinSc
Copy link
Author

Don't hesitate to criticise my work, it's my first pull request on flutter :)

@@ -31,15 +33,16 @@ class DatePickerTimeline extends StatefulWidget {
this.daysCount = 50000,
this.onDateChange,
this.locale = "en_US",
this.isEdgeFadding = false,
Copy link
Author

Choose a reason for hiding this comment

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

New parameter to enable EdgeFadding

@iamvivekkaushik
Copy link
Owner

iamvivekkaushik commented Oct 24, 2019

Awesome work @QuentinSc, can you try to implement edge fading without using another third-party library? I am a little busy these days so I couldn't review your pull request sooner.

Comment on lines +59 to +75
Padding(
padding: EdgeInsets.all(50),
),
Text("With edge fadding"),
Padding(
padding: EdgeInsets.all(10),
),
DatePickerTimeline(
_selectedValue,
isEdgeFadding: true,
onDateChange: (date) {
// New date selected
setState(() {
_selectedValue = date;
});
},
),
Copy link
Author

Choose a reason for hiding this comment

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

2nd example, with EdgeFadding

Comment on lines +46 to +52
fading_edge_scrollview:
dependency: transitive
description:
name: fading_edge_scrollview
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
Copy link
Author

Choose a reason for hiding this comment

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

Add edgefading package

Comment on lines +72 to +90
return DateWidget(
date: date,
monthTextStyle: widget.monthTextStyle,
dateTextStyle: widget.dateTextStyle,
dayTextStyle: widget.dayTextStyle,
locale: widget.locale,
selectionColor:
isSelected ? widget.selectionColor : Colors.transparent,
onDateSelected: (selectedDate) {
// A date is selected
if (widget.onDateChange != null) {
widget.onDateChange(selectedDate);
}
setState(() {
widget.currentDate = selectedDate;
});
},
);
},
Copy link
Author

Choose a reason for hiding this comment

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

Just format code for the DateWidget

Comment on lines +61 to +70
Widget buildList(BuildContext context) {
return ListView.builder(
itemCount: widget.daysCount,
scrollDirection: Axis.horizontal,
controller: new ScrollController(),
itemBuilder: (context, index) {
// Return the Date Widget
DateTime _date = DateTime.now().add(Duration(days: index));
DateTime date = new DateTime(_date.year, _date.month, _date.day);
bool isSelected = compareDate(date, widget.currentDate);
Copy link
Author

Choose a reason for hiding this comment

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

Create buildList to avoid code diplucation

@QuentinSc
Copy link
Author

Thank you.
I correctly reposted my gitlab comment.
And I must correct my code, in english it's "fading" and not "fadding" ^^.
I could implement it without third party but I don't know when

@QuentinSc QuentinSc changed the title add option for edge fadding add option for edge fading Oct 25, 2019
@iamvivekkaushik iamvivekkaushik force-pushed the master branch 3 times, most recently from 208d012 to 955a106 Compare June 17, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants