-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
568 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { Tabs } from 'nextra/components'; | ||
import { Widget } from "../../components/widget"; | ||
|
||
# Calendar | ||
A date field component that allows users to enter and edit date. | ||
|
||
The calendar pages are designed to be navigable through swipe gestures on mobile platforms, allowing left and right swipes | ||
to transition between pages. | ||
|
||
<Tabs items={['Preview', 'Code']}> | ||
<Tabs.Tab> | ||
<Widget name='calendar' query={{}} height={500}/> | ||
</Tabs.Tab> | ||
<Tabs.Tab> | ||
```dart | ||
FCalendar( | ||
controller: FCalendarSingleRangeController(), | ||
start: DateTime.utc(2024), | ||
end: DateTime.utc(2030), | ||
); | ||
``` | ||
</Tabs.Tab> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
### `FCalendar(...)` | ||
|
||
```dart | ||
FCalendar( | ||
controller: FCalendarSingleRangeController(), | ||
start: DateTime.utc(2024), | ||
end: DateTime.utc(2030), | ||
today: DateTime.utc(2024, 7, 14), | ||
initalType = FCalendarPickerType.yearMonth, | ||
initialDate = DateTime.utc(2024, 9, 12), | ||
enabled: (date) => allowed.contains(date), | ||
onMonthChange: (date) => print(date), | ||
onPress: (date) => print(date), | ||
onLongPress: (date) => print(date), | ||
); | ||
``` | ||
## Examples | ||
|
||
### Single Date | ||
<Tabs items={['Preview', 'Code']}> | ||
<Tabs.Tab> | ||
<Widget name='calendar' query={{}} height={500}/> | ||
</Tabs.Tab> | ||
<Tabs.Tab> | ||
```dart | ||
FCalendar( | ||
controller: FCalendarSingleValueController(), | ||
start: DateTime.utc(2024), | ||
end: DateTime.utc(2030), | ||
); | ||
``` | ||
</Tabs.Tab> | ||
</Tabs> | ||
|
||
### Multiple Dates | ||
<Tabs items={['Preview', 'Code']}> | ||
<Tabs.Tab> | ||
<Widget name='calendar' variant='multi-value' query={{}} height={500}/> | ||
</Tabs.Tab> | ||
<Tabs.Tab> | ||
```dart | ||
FCalendar( | ||
controller: FCalendarMultiValueController(), | ||
start: DateTime.utc(2024), | ||
end: DateTime.utc(2030), | ||
); | ||
``` | ||
</Tabs.Tab> | ||
</Tabs> | ||
|
||
### Single Range | ||
<Tabs items={['Preview', 'Code']}> | ||
<Tabs.Tab> | ||
<Widget name='calendar' variant='single-range' query={{}} height={500}/> | ||
</Tabs.Tab> | ||
<Tabs.Tab> | ||
```dart | ||
FCalendar( | ||
controller: FCalendarSingleRangeController(), | ||
start: DateTime.utc(2024), | ||
end: DateTime.utc(2030), | ||
) | ||
``` | ||
</Tabs.Tab> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.