Comments (3)
I agree, adding holiday support sounds like a good idea.
As for customizing markers - have you tried using Calendar Builders? You can also take a look in example project.
Do you have any suggestions about displaying holiday rules? Eg. different text color / different background / additional markers (via builders)
from table_calendar.
Hello,
When it comes to Holiday support, I was thinking on an interface like "public bool IsHoliday(DateTime date)". Then people can write theire own logic into it.
When it comes to customizing markers:
I am new to Flutter/Dart, so I thought the example main.dart, line 220, was mandatory Text child.
child: Text(
'${events.length}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 12.0,
),
Now, I have learned that I can replace Text to a Row of Images, if I want.
However, the Interface does only support ONE marker, and it is places in the right bottom. It would be great with yet another marker, in the left corner :)
Colors:
According to my calander that I find in the store. The holiday is marked in the color red, as same as sundays. That should be the default color, but people should be able to override it.
WeekendStyle: I don't like that you handle both Saturday and sunday the same. Many people work on saturday, and people has different salery on sauturday vs. sunday. You should have SaturdayStyle and SundayStyle instead of WeekendStyle, or maybe all of them.
Regards
from table_calendar.
#39 resolves all of this by adding revamped markers API and holiday support 🎉
First, update your package version to 1.2.0
.
New markers API uses a list of widgets, instead of a single widget. This allows for a much more refined customization -> provide as many icons as you want. Then you can wrap each of them with Positioned
widget to control their layout (see example project).
For holidays, take a look here.
As for splitting weekendStyle
into 2 entities, I suggest a different solution - just use a custom Builder:
weekendDayBuilder: (context, date, _) {
TextStyle style;
if (date.weekday == 7) {
// Sunday
style = TextStyle().copyWith(color: Colors.red);
} else {
// Saturday
style = TextStyle().copyWith(color: Colors.purple);
}
return Center(
child: Text(
'${date.weekday}',
style: style,
),
);
},
Note that you will also need to provide selectedDayBuilder
and todayDayBuilder
, but they follow the same template. Take a look at example project - then using them should be clear.
from table_calendar.
Related Issues (20)
- Allow Removable of a Day in the Calendar
- We should support vertical scroll also.
- Add Month and year picker on header when pick date
- Today style is not applied if the tile is disabled HOT 1
- missing onVisibleDaysChanged HOT 1
- TableCalendar inside CustomScrollView HOT 1
- Not compatible with intl 0.19.0 HOT 2
- Incorrect behavior when firstDay parameter changes HOT 1
- How to add 29 days in February every year? HOT 1
- Responsive layout for both Width and Height
- How to get visible first day and last day on format change?
- Timezone issue HOT 2
- Line separator between month name and daysOfWeek HOT 1
- How to drag and select range?Is that supported. HOT 1
- The following assertion was thrown building AnimatedContainer(duration: 250ms, Alignment.center, padding: EdgeInsets.zero, bg: BoxDecoration(color: Color(0xff6262d5), borderRadius: BorderRadius.circular(10.0)), margin: EdgeInsets.all(6.0), clipBehavior: Clip.none, dirty, state: _AnimatedContainerState#d3f3a(ticker active, AlignmentGeometryTween(Alignment.center → Alignment.center), padding: EdgeInsetsGeometryTween(EdgeInsets.zero → EdgeInsets.zero), bg: DecorationTween(BoxDecoration(shape: circle) → BoxDecoration(color: Color(0xff6262d5), borderRadius: BorderRadius.circular(10.0))), margin: EdgeInsetsGeometryTween(EdgeInsets.all(6.0) → EdgeInsets.all(6.0)))): 'package:flutter/src/painting/box_decoration.dart': Failed assertion: line 128 pos 12: 'shape != BoxShape.circle || borderRadius == null': is not true. HOT 2
- Please upgrade intl HOT 1
- Is this repo abandoned? Recommended alternatives? HOT 2
- ReorderableDelayedDragStartListener causes changing months not to work HOT 1
- incompatible with flutter_localizations HOT 2
- eventLoader is polling many unnecessary dates during onPageChanged callback HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from table_calendar.