mirror of
https://github.com/Iconica-Development/flutter_agenda.git
synced 2025-05-19 05:13:44 +02:00
Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
|
8da50e6ad0 | ||
|
ecb1e52c6b | ||
|
37612f54b0 | ||
|
3f76987900 | ||
|
b81b870c74 | ||
|
1803099575 | ||
|
81c744f22c | ||
|
4f30c46e77 | ||
|
7facbf1152 | ||
|
90f697647e | ||
|
3f9f2e5f20 | ||
|
500c6177f8 | ||
|
fd3d73d8ea | ||
|
1bd7294ef4 | ||
|
a0fdeb753f | ||
|
7a5f65f009 | ||
|
eaf55a9349 | ||
1fa502e658 |
23 changed files with 442 additions and 224 deletions
10
.github/dependabot.yaml
vendored
Normal file
10
.github/dependabot.yaml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
- package-ecosystem: "pub"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
14
.github/workflows/component-documentation.yml
vendored
Normal file
14
.github/workflows/component-documentation.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
name: Iconica Standard Component Documentation Workflow
|
||||||
|
# Workflow Caller version: 1.0.0
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-iconica-component-documentation-workflow:
|
||||||
|
uses: Iconica-Development/.github/.github/workflows/component-documentation.yml@master
|
||||||
|
secrets: inherit
|
||||||
|
permissions: write-all
|
12
.github/workflows/flutter.yml
vendored
Normal file
12
.github/workflows/flutter.yml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
name: Iconica Standard Component CI Workflow
|
||||||
|
# Workflow Caller version: 1.0.0
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-global-iconica-workflow:
|
||||||
|
uses: Iconica-Development/.github/.github/workflows/component-ci.yml@master
|
||||||
|
secrets: inherit
|
||||||
|
permissions: write-all
|
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -28,5 +28,10 @@ migrate_working_dir/
|
||||||
.dart_tool/
|
.dart_tool/
|
||||||
.packages
|
.packages
|
||||||
build/
|
build/
|
||||||
|
.metadata
|
||||||
|
|
||||||
coverage/
|
coverage/
|
||||||
|
|
||||||
|
# FVM Version Cache
|
||||||
|
.fvm/
|
||||||
|
.fvmrc
|
||||||
|
|
10
.metadata
10
.metadata
|
@ -1,10 +0,0 @@
|
||||||
# This file tracks properties of this Flutter project.
|
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
||||||
#
|
|
||||||
# This file should be version controlled and should not be manually edited.
|
|
||||||
|
|
||||||
version:
|
|
||||||
revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
channel: stable
|
|
||||||
|
|
||||||
project_type: package
|
|
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -1,3 +1,18 @@
|
||||||
|
## [2.0.0] - 11 July 2024
|
||||||
|
|
||||||
|
- Upgrade to flutter_timetable 2.0.0
|
||||||
|
|
||||||
|
## [1.1.0] - 17 August 2023
|
||||||
|
|
||||||
|
- Updated flutter_timetable to version 1.1.0
|
||||||
|
- Updated flutter_date_time_picker to 3.3.0
|
||||||
|
|
||||||
|
## [1.0.0] - 27 December 2022
|
||||||
|
|
||||||
|
* Added option for custom Widget when there are no events for a given day
|
||||||
|
* Support for both horizontal and vertical variant
|
||||||
|
* Adjustable size for the component
|
||||||
|
|
||||||
## [0.0.1] - 2 September 2022
|
## [0.0.1] - 2 September 2022
|
||||||
|
|
||||||
* Initial release.
|
* Initial release.
|
||||||
|
|
1
FEATURES.md
Normal file
1
FEATURES.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
List of Features from this component:
|
9
LICENSE
Normal file
9
LICENSE
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Copyright (c) 2022 Iconica, All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
README.md
13
README.md
|
@ -1,20 +1,23 @@
|
||||||
[](https://github.com/Iconica-Development) [](URL TO GITHUB ACTIONS) [](https://github.com/tenhobi/effective_dart)
|
[](https://github.com/Iconica-Development) [](https://github.com/Iconica-Development/agenda/actions/new) [](https://github.com/tenhobi/effective_dart)
|
||||||
|
|
||||||
# Agenda
|
# Agenda
|
||||||
A Flutter package for creating an agenda that displays events per day with an included calendar for picking the date. Multiple events at the same time are alongside each other. There is also the option to stack multiple items at the same time.
|
A Flutter package for creating an agenda that displays events per day with an included calendar for picking the date. Multiple events at the same time are alongside each other. There is also the option to stack multiple items at the same time.
|
||||||
The underlying datepicker widget supports marking dates and disabling dates.
|
The underlying datepicker widget supports marking dates and disabling dates.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Figma Design that defines this component (only accessible for Iconica developers): https://www.figma.com/file/4WkjwynOz5wFeFBRqTHPeP/Iconica-Design-System?type=design&node-id=340%3A612&mode=design&t=XulkAJNPQ32ARxWh-1
|
||||||
|
Figma clickable prototype that demonstrates this component (only accessible for Iconica developers): https://www.figma.com/proto/4WkjwynOz5wFeFBRqTHPeP/Iconica-Design-System?page-id=340%3A611&type=design&node-id=433-15620&viewport=-160%2C212%2C0.17&t=5fagYht1Mhp7ZCIJ-1&scaling=scale-down&starting-point-node-id=433%3A15620&show-proto-sidebar=1&mode=design
|
||||||
|
|
||||||
Supports all Flutter platforms.
|
Supports all Flutter platforms.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To use this package, add `agenda` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/platform-integration/platform-channels).
|
To use this package, add `agenda` as a dependency in your pubspec.yaml file.
|
||||||
|
|
||||||
### Example
|
## How to Use
|
||||||
|
|
||||||
See [Example Code](example/lib/main.dart) for more info.
|
See the [Example Code](example/lib/main.dart) for an example on how to use this package.
|
||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
|
@ -26,4 +29,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
This agenda for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at <support@iconica.nl>
|
This `agenda` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at <support@iconica.nl>
|
BIN
agenda.gif
Normal file
BIN
agenda.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 MiB |
|
@ -25,8 +25,6 @@ linter:
|
||||||
empty_statements: true
|
empty_statements: true
|
||||||
hash_and_equals: true
|
hash_and_equals: true
|
||||||
invariant_booleans: true
|
invariant_booleans: true
|
||||||
iterable_contains_unrelated_type: true
|
|
||||||
list_remove_unrelated_type: true
|
|
||||||
literal_only_boolean_expressions: true
|
literal_only_boolean_expressions: true
|
||||||
no_adjacent_strings_in_list: true
|
no_adjacent_strings_in_list: true
|
||||||
no_duplicate_case_values: true
|
no_duplicate_case_values: true
|
||||||
|
@ -206,7 +204,6 @@ linter:
|
||||||
void_checks: true
|
void_checks: true
|
||||||
# pub rules
|
# pub rules
|
||||||
depend_on_referenced_packages: true
|
depend_on_referenced_packages: true
|
||||||
lowercase_with_underscores: true
|
|
||||||
secure_pubspec_urls: false
|
secure_pubspec_urls: false
|
||||||
sort_pub_dependencies: false
|
sort_pub_dependencies: false
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
# This file tracks properties of this Flutter project.
|
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
||||||
#
|
|
||||||
# This file should be version controlled.
|
|
||||||
|
|
||||||
version:
|
|
||||||
revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
channel: stable
|
|
||||||
|
|
||||||
project_type: app
|
|
||||||
|
|
||||||
# Tracks metadata for the flutter migrate command
|
|
||||||
migration:
|
|
||||||
platforms:
|
|
||||||
- platform: root
|
|
||||||
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
- platform: android
|
|
||||||
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
- platform: ios
|
|
||||||
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
- platform: web
|
|
||||||
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
|
|
||||||
|
|
||||||
# User provided section
|
|
||||||
|
|
||||||
# List of Local paths (relative to this file) that should be
|
|
||||||
# ignored by the migrate tool.
|
|
||||||
#
|
|
||||||
# Files that are not part of the templates will be ignored by default.
|
|
||||||
unmanaged_files:
|
|
||||||
- 'lib/main.dart'
|
|
||||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
|
|
@ -25,8 +25,6 @@ linter:
|
||||||
empty_statements: true
|
empty_statements: true
|
||||||
hash_and_equals: true
|
hash_and_equals: true
|
||||||
invariant_booleans: true
|
invariant_booleans: true
|
||||||
iterable_contains_unrelated_type: true
|
|
||||||
list_remove_unrelated_type: true
|
|
||||||
literal_only_boolean_expressions: true
|
literal_only_boolean_expressions: true
|
||||||
no_adjacent_strings_in_list: true
|
no_adjacent_strings_in_list: true
|
||||||
no_duplicate_case_values: true
|
no_duplicate_case_values: true
|
||||||
|
@ -206,7 +204,6 @@ linter:
|
||||||
void_checks: true
|
void_checks: true
|
||||||
# pub rules
|
# pub rules
|
||||||
depend_on_referenced_packages: true
|
depend_on_referenced_packages: true
|
||||||
lowercase_with_underscores: true
|
|
||||||
secure_pubspec_urls: false
|
secure_pubspec_urls: false
|
||||||
sort_pub_dependencies: false
|
sort_pub_dependencies: false
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
import 'package:agenda/agenda.dart';
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_agenda/flutter_agenda.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MaterialApp(home: AgendaDemo()));
|
runApp(
|
||||||
|
const MaterialApp(
|
||||||
|
home: AgendaDemo(),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class AgendaDemo extends StatelessWidget {
|
class AgendaDemo extends StatelessWidget {
|
||||||
|
@ -11,69 +19,113 @@ class AgendaDemo extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SafeArea(
|
appBar: AppBar(),
|
||||||
child: AgendaWidget(
|
body: AgendaWidget(
|
||||||
header: Text('Agenda', style: Theme.of(context).textTheme.headline6),
|
header: Text(
|
||||||
blockWidth: 50,
|
'Agenda',
|
||||||
highlightToday: false,
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
blocks: [
|
),
|
||||||
AgendaEvent(
|
blockDimension: 50,
|
||||||
start: DateTime.now().subtract(const Duration(hours: 3)),
|
highlightToday: false,
|
||||||
end: DateTime.now().add(const Duration(hours: 2)),
|
blocks: [
|
||||||
|
AgendaEvent(
|
||||||
|
start: DateTime.now().subtract(
|
||||||
|
const Duration(hours: 3),
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
end: DateTime.now().add(
|
||||||
start: DateTime.now().subtract(const Duration(hours: 2)),
|
const Duration(hours: 2),
|
||||||
end: DateTime.now().add(const Duration(hours: 1)),
|
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
),
|
||||||
start: DateTime.now().subtract(const Duration(hours: 1)),
|
AgendaEvent(
|
||||||
end: DateTime.now().add(const Duration(hours: 1)),
|
start: DateTime.now().subtract(
|
||||||
|
const Duration(hours: 2),
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
end: DateTime.now().add(
|
||||||
start: DateTime.now().add(const Duration(hours: 3)),
|
const Duration(hours: 1),
|
||||||
end: DateTime.now().add(const Duration(hours: 4)),
|
|
||||||
id: 4,
|
|
||||||
content: const Text('event 4'),
|
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
),
|
||||||
start: DateTime.now().add(const Duration(hours: 3)),
|
AgendaEvent(
|
||||||
end: DateTime.now().add(const Duration(hours: 4)),
|
start: DateTime.now().subtract(
|
||||||
id: 4,
|
const Duration(hours: 1),
|
||||||
content: const Text('event 5'),
|
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
end: DateTime.now().add(
|
||||||
start: DateTime.now().add(const Duration(hours: 3)),
|
const Duration(hours: 1),
|
||||||
end: DateTime.now().add(const Duration(hours: 4)),
|
|
||||||
id: 4,
|
|
||||||
content: const Text('event 6'),
|
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
),
|
||||||
start: DateTime.now().add(const Duration(days: 1)),
|
AgendaEvent(
|
||||||
end: DateTime.now()
|
start: DateTime.now().add(
|
||||||
.add(const Duration(days: 1))
|
const Duration(hours: 3),
|
||||||
.add(const Duration(hours: 2)),
|
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
end: DateTime.now().add(
|
||||||
start: DateTime.now().subtract(const Duration(hours: 2)),
|
const Duration(hours: 4),
|
||||||
end: DateTime.now().add(const Duration(hours: 1)),
|
|
||||||
),
|
),
|
||||||
AgendaEvent(
|
id: 4,
|
||||||
start: DateTime.now().add(const Duration(days: 2)),
|
content: const Text('event 4'),
|
||||||
end: DateTime.now().add(const Duration(days: 3)),
|
),
|
||||||
|
AgendaEvent(
|
||||||
|
start: DateTime.now().add(
|
||||||
|
const Duration(hours: 3),
|
||||||
),
|
),
|
||||||
],
|
end: DateTime.now().add(
|
||||||
disabledDates: [
|
const Duration(hours: 4),
|
||||||
// yesterday
|
|
||||||
DateTime.now().subtract(const Duration(days: 1)),
|
|
||||||
],
|
|
||||||
highlightedDates: [
|
|
||||||
// tomorrow
|
|
||||||
DateTime.now().add(const Duration(days: 1)),
|
|
||||||
],
|
|
||||||
theme: const AgendaTheme(
|
|
||||||
tableTheme: TableTheme(
|
|
||||||
blockPaddingBetween: 10,
|
|
||||||
),
|
),
|
||||||
|
id: 4,
|
||||||
|
content: const Text('event 5'),
|
||||||
|
),
|
||||||
|
AgendaEvent(
|
||||||
|
start: DateTime.now().add(
|
||||||
|
const Duration(hours: 3),
|
||||||
|
),
|
||||||
|
end: DateTime.now().add(
|
||||||
|
const Duration(hours: 4),
|
||||||
|
),
|
||||||
|
id: 4,
|
||||||
|
content: const Text('event 6'),
|
||||||
|
),
|
||||||
|
AgendaEvent(
|
||||||
|
start: DateTime.now().add(
|
||||||
|
const Duration(days: 1),
|
||||||
|
),
|
||||||
|
end: DateTime.now()
|
||||||
|
.add(
|
||||||
|
const Duration(days: 1),
|
||||||
|
)
|
||||||
|
.add(
|
||||||
|
const Duration(hours: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AgendaEvent(
|
||||||
|
start: DateTime.now().subtract(
|
||||||
|
const Duration(hours: 2),
|
||||||
|
),
|
||||||
|
end: DateTime.now().add(
|
||||||
|
const Duration(hours: 1),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AgendaEvent(
|
||||||
|
start: DateTime.now().add(
|
||||||
|
const Duration(days: 2),
|
||||||
|
),
|
||||||
|
end: DateTime.now().add(
|
||||||
|
const Duration(days: 3),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
disabledDates: [
|
||||||
|
// yesterday
|
||||||
|
DateTime.now().subtract(
|
||||||
|
const Duration(days: 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
highlightedDates: [
|
||||||
|
// tomorrow
|
||||||
|
DateTime.now().add(
|
||||||
|
const Duration(days: 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
theme: const AgendaTheme(
|
||||||
|
tableTheme: TableTheme(
|
||||||
|
blockPaddingBetween: 10,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,60 +1,60 @@
|
||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
agenda:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
path: ".."
|
|
||||||
relative: true
|
|
||||||
source: path
|
|
||||||
version: "0.0.1"
|
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.9.0"
|
version: "2.11.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.3.0"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.dartlang.org"
|
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.18.0"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
url: "https://pub.dartlang.org"
|
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.8"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -62,69 +62,114 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_agenda:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: ".."
|
||||||
|
relative: true
|
||||||
|
source: path
|
||||||
|
version: "2.0.0"
|
||||||
flutter_date_time_picker:
|
flutter_date_time_picker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
path: "."
|
name: flutter_date_time_picker
|
||||||
ref: stable
|
sha256: d34231fae366fca3b14af3f810d750d56cb282a56e4721470d65074b1fbce969
|
||||||
resolved-ref: "6b3f1f5d12c1762bc208a1f1a4b9384dcb3369d4"
|
url: "https://forgejo.internal.iconica.nl/api/packages/internal/pub/"
|
||||||
url: "git@github.com:Iconica-Development/flutter_date_time_picker.git"
|
source: hosted
|
||||||
source: git
|
version: "3.3.0"
|
||||||
version: "0.0.1"
|
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
url: "https://pub.dartlang.org"
|
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.3"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_timetable:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_timetable
|
||||||
|
sha256: "86eb6709133f179ea4d9f338a95630a43a4d03f9dc86719622c17970fb8a0655"
|
||||||
|
url: "https://forgejo.internal.iconica.nl/api/packages/internal/pub/"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
intl:
|
intl:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: intl
|
name: intl
|
||||||
url: "https://pub.dartlang.org"
|
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.17.0"
|
version: "0.19.0"
|
||||||
|
leak_tracker:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker
|
||||||
|
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "10.0.4"
|
||||||
|
leak_tracker_flutter_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_flutter_testing
|
||||||
|
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.3"
|
||||||
|
leak_tracker_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_testing
|
||||||
|
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.1"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.1"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.12"
|
version: "0.12.16+1"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.5"
|
version: "0.8.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.12.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.2"
|
version: "1.9.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -134,60 +179,66 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.10.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.11.1"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
url: "https://pub.dartlang.org"
|
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.2"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.2.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
url: "https://pub.dartlang.org"
|
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.2.1"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.12"
|
version: "0.7.0"
|
||||||
timetable:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
path: "."
|
|
||||||
ref: "v0.0.2"
|
|
||||||
resolved-ref: "62fdaa443818bd646058b536a12304725d1619fd"
|
|
||||||
url: "git@github.com:Iconica-Development/timetable.git"
|
|
||||||
source: git
|
|
||||||
version: "0.0.1"
|
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.4"
|
||||||
|
vm_service:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vm_service
|
||||||
|
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "14.2.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.18.0 <3.0.0"
|
dart: ">=3.3.0 <4.0.0"
|
||||||
flutter: ">=2.0.0"
|
flutter: ">=3.18.0-18.0.pre.54"
|
||||||
|
|
|
@ -13,7 +13,7 @@ dependencies:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
agenda:
|
flutter_agenda:
|
||||||
path: ../
|
path: ../
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
library agenda;
|
|
||||||
|
|
||||||
export 'package:agenda/src/agenda.dart';
|
|
||||||
export 'package:agenda/src/models/agenda_event.dart';
|
|
||||||
export 'package:agenda/src/models/agenda_theme.dart';
|
|
||||||
|
|
||||||
export 'package:timetable/timetable.dart';
|
|
9
lib/flutter_agenda.dart
Normal file
9
lib/flutter_agenda.dart
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
library agenda;
|
||||||
|
|
||||||
|
export 'package:flutter_agenda/src/agenda.dart';
|
||||||
|
export 'package:flutter_agenda/src/models/agenda_event.dart';
|
||||||
|
export 'package:flutter_agenda/src/models/agenda_theme.dart';
|
|
@ -1,8 +1,12 @@
|
||||||
import 'package:agenda/src/models/agenda_event.dart';
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||||||
import 'package:agenda/src/models/agenda_theme.dart';
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_agenda/src/models/agenda_event.dart';
|
||||||
|
import 'package:flutter_agenda/src/models/agenda_theme.dart';
|
||||||
import 'package:flutter_date_time_picker/flutter_date_time_picker.dart';
|
import 'package:flutter_date_time_picker/flutter_date_time_picker.dart';
|
||||||
import 'package:timetable/timetable.dart';
|
import 'package:flutter_timetable/flutter_timetable.dart';
|
||||||
|
|
||||||
class AgendaWidget extends StatefulWidget {
|
class AgendaWidget extends StatefulWidget {
|
||||||
/// [AgendaWidget] is a widget that displays a timetable with events.
|
/// [AgendaWidget] is a widget that displays a timetable with events.
|
||||||
|
@ -10,26 +14,43 @@ class AgendaWidget extends StatefulWidget {
|
||||||
/// All styling can be configured through the [AgendaTheme] class.
|
/// All styling can be configured through the [AgendaTheme] class.
|
||||||
const AgendaWidget({
|
const AgendaWidget({
|
||||||
required this.blocks,
|
required this.blocks,
|
||||||
|
this.tableDirection = Axis.vertical,
|
||||||
|
this.size,
|
||||||
this.highlightedDates = const [],
|
this.highlightedDates = const [],
|
||||||
this.disabledDates = const [],
|
this.disabledDates = const [],
|
||||||
this.initialDate,
|
this.initialDate,
|
||||||
|
this.alwaysUse24HourFormat,
|
||||||
this.header,
|
this.header,
|
||||||
|
this.childIfEmptyRoster,
|
||||||
this.scrollController,
|
this.scrollController,
|
||||||
this.scrollPhysics,
|
this.scrollPhysics,
|
||||||
this.onTapDay,
|
this.onTapDay,
|
||||||
|
this.tableTopPadding = 0,
|
||||||
|
this.datePickerExpansion = 0,
|
||||||
this.startHour = 0,
|
this.startHour = 0,
|
||||||
this.endHour = 24,
|
this.endHour = 24,
|
||||||
this.hourHeight = 80,
|
this.hourDimension = 80,
|
||||||
this.highlightToday = true,
|
this.highlightToday = true,
|
||||||
this.blockWidth = 50,
|
this.updateEmptyChildPosition = true,
|
||||||
|
this.blockDimension = 50,
|
||||||
this.blockColor = const Color(0x80FF0000),
|
this.blockColor = const Color(0x80FF0000),
|
||||||
this.theme = const AgendaTheme(),
|
this.theme = const AgendaTheme(),
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/// The [Axis] along which the timetable markings are lined out
|
||||||
|
final Axis tableDirection;
|
||||||
|
|
||||||
/// Header widget that is displayed above the datepicker.
|
/// Header widget that is displayed above the datepicker.
|
||||||
final Widget? header;
|
final Widget? header;
|
||||||
|
|
||||||
|
/// The Widget displayed instead of the timetable when no events are available
|
||||||
|
final Widget? childIfEmptyRoster;
|
||||||
|
|
||||||
|
/// Whether to change the position of the Empty Child Widget
|
||||||
|
/// when the datepicker is opened
|
||||||
|
final bool updateEmptyChildPosition;
|
||||||
|
|
||||||
/// The blocks that are displayed in the agenda
|
/// The blocks that are displayed in the agenda
|
||||||
final List<AgendaEvent> blocks;
|
final List<AgendaEvent> blocks;
|
||||||
|
|
||||||
|
@ -54,11 +75,21 @@ class AgendaWidget extends StatefulWidget {
|
||||||
/// Hour at which the timetable ends.
|
/// Hour at which the timetable ends.
|
||||||
final int endHour;
|
final int endHour;
|
||||||
|
|
||||||
/// The heigh of one hour in the timetable.
|
/// The amount of pixels above the timetable
|
||||||
final double hourHeight;
|
final double tableTopPadding;
|
||||||
|
|
||||||
/// The width of the agendaItem if there is no child
|
/// The extra height of the datePicker when it is expanded
|
||||||
final double blockWidth;
|
final double datePickerExpansion;
|
||||||
|
|
||||||
|
/// [bool] to set the clock on [TimePickerDialog] to a fixed 24 format.
|
||||||
|
/// By default this gets determined by the settings on the user device.
|
||||||
|
final bool? alwaysUse24HourFormat;
|
||||||
|
|
||||||
|
/// The dimension in pixels of one hour in the timetable.
|
||||||
|
final double hourDimension;
|
||||||
|
|
||||||
|
/// The dimension in pixels of the rosterItem if there is no child
|
||||||
|
final double blockDimension;
|
||||||
|
|
||||||
/// The color of the agendaItem if there is no child
|
/// The color of the agendaItem if there is no child
|
||||||
final Color blockColor;
|
final Color blockColor;
|
||||||
|
@ -67,6 +98,9 @@ class AgendaWidget extends StatefulWidget {
|
||||||
/// The [TableTheme] used by the timetable is included.
|
/// The [TableTheme] used by the timetable is included.
|
||||||
final AgendaTheme theme;
|
final AgendaTheme theme;
|
||||||
|
|
||||||
|
/// The [Size] of the timetable.
|
||||||
|
final Size? size;
|
||||||
|
|
||||||
/// The scroll controller to control the scrolling of the timetable.
|
/// The scroll controller to control the scrolling of the timetable.
|
||||||
final ScrollController? scrollController;
|
final ScrollController? scrollController;
|
||||||
|
|
||||||
|
@ -79,6 +113,7 @@ class AgendaWidget extends StatefulWidget {
|
||||||
|
|
||||||
class _AgendaWidgetState extends State<AgendaWidget> {
|
class _AgendaWidgetState extends State<AgendaWidget> {
|
||||||
late DateTime _selectedDate;
|
late DateTime _selectedDate;
|
||||||
|
double _scrollOffset = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -89,31 +124,72 @@ class _AgendaWidgetState extends State<AgendaWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var events = _filterEventsOnDay(widget.blocks, _selectedDate);
|
var events = _filterEventsOnDay(widget.blocks, _selectedDate);
|
||||||
return DateTimePicker(
|
return DragDownDateTimePicker(
|
||||||
|
alwaysUse24HourFormat: widget.alwaysUse24HourFormat,
|
||||||
initialDate: _selectedDate,
|
initialDate: _selectedDate,
|
||||||
pickTime: false,
|
pickTime: false,
|
||||||
highlightToday: widget.highlightToday,
|
highlightToday: widget.highlightToday,
|
||||||
header: widget.header,
|
header: widget.header,
|
||||||
onTapDay: (p0) {
|
onTapDay: (selected) {
|
||||||
|
widget.onTapDay?.call(selected);
|
||||||
setState(() {
|
setState(() {
|
||||||
_selectedDate = p0;
|
_selectedDate = selected;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onTimerPickerSheetChange: (p0) {
|
||||||
|
if (widget.updateEmptyChildPosition) {
|
||||||
|
setState(() {
|
||||||
|
_scrollOffset = p0 - widget.tableTopPadding;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
disabledDates: widget.disabledDates,
|
disabledDates: widget.disabledDates,
|
||||||
markedDates: widget.highlightedDates,
|
markedDates: widget.highlightedDates,
|
||||||
dateTimePickerTheme: widget.theme.timePickerTheme,
|
dateTimePickerTheme: widget.theme.timePickerTheme,
|
||||||
child: Timetable(
|
child: Column(
|
||||||
scrollPhysics: widget.scrollPhysics,
|
children: [
|
||||||
scrollController: widget.scrollController,
|
SizedBox(
|
||||||
blockColor: widget.blockColor,
|
height: widget.tableTopPadding,
|
||||||
blockWidth: widget.blockWidth,
|
),
|
||||||
hourHeight: widget.hourHeight,
|
SizedBox(
|
||||||
startHour: widget.startHour,
|
height: (widget.size != null)
|
||||||
endHour: widget.endHour,
|
? widget.size!.height - widget.tableTopPadding
|
||||||
timeBlocks: events,
|
: null,
|
||||||
theme: widget.theme.tableTheme,
|
width: (widget.size != null) ? widget.size!.width : null,
|
||||||
combineBlocks: true,
|
child: (widget.childIfEmptyRoster != null && events.isEmpty)
|
||||||
mergeBlocks: true,
|
? Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// add empty space between the top of the widget
|
||||||
|
//and the child if the datepicker is expanded
|
||||||
|
SizedBox(
|
||||||
|
height: _scrollOffset,
|
||||||
|
),
|
||||||
|
widget.childIfEmptyRoster!,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Timetable(
|
||||||
|
tableDirection: widget.tableDirection,
|
||||||
|
scrollPhysics: widget.scrollPhysics,
|
||||||
|
scrollController: widget.scrollController,
|
||||||
|
blockColor: widget.blockColor,
|
||||||
|
blockDimension: widget.blockDimension,
|
||||||
|
hourDimension: widget.hourDimension,
|
||||||
|
startHour: widget.startHour,
|
||||||
|
endHour: widget.endHour,
|
||||||
|
timeBlocks: events,
|
||||||
|
theme: widget.theme.tableTheme,
|
||||||
|
combineBlocks: true,
|
||||||
|
mergeBlocks: true,
|
||||||
|
size: (widget.size != null)
|
||||||
|
? Size(
|
||||||
|
widget.size!.width,
|
||||||
|
widget.size!.height - widget.tableTopPadding,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -144,6 +220,7 @@ class _AgendaWidgetState extends State<AgendaWidget> {
|
||||||
minute: e.end.minute,
|
minute: e.end.minute,
|
||||||
),
|
),
|
||||||
id: e.id ?? 0,
|
id: e.id ?? 0,
|
||||||
|
childDimension: e.childDimension,
|
||||||
child: e.content,
|
child: e.content,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class AgendaEvent {
|
class AgendaEvent {
|
||||||
|
@ -8,6 +12,7 @@ class AgendaEvent {
|
||||||
required this.end,
|
required this.end,
|
||||||
this.id,
|
this.id,
|
||||||
this.content,
|
this.content,
|
||||||
|
this.childDimension,
|
||||||
}) : assert(start.isBefore(end), 'start must be before end');
|
}) : assert(start.isBefore(end), 'start must be before end');
|
||||||
|
|
||||||
/// The start time of the event.
|
/// The start time of the event.
|
||||||
|
@ -16,9 +21,14 @@ class AgendaEvent {
|
||||||
/// The end time of the event.
|
/// The end time of the event.
|
||||||
final DateTime end;
|
final DateTime end;
|
||||||
|
|
||||||
///
|
/// The [Widget] displayed inside the roster at the event time
|
||||||
final Widget? content;
|
final Widget? content;
|
||||||
|
|
||||||
|
/// The dimension of the child in the axis of the timetable which it expands.
|
||||||
|
/// Only needed when child is not null and the horizontalvariant is used.
|
||||||
|
/// This is used to make the timetable background as large as all the blocks.
|
||||||
|
final double? childDimension;
|
||||||
|
|
||||||
/// The identifier of the event that is used to combine events
|
/// The identifier of the event that is used to combine events
|
||||||
/// with the same id. Leave empty or 0 if you don't want to combine events.
|
/// with the same id. Leave empty or 0 if you don't want to combine events.
|
||||||
final int? id;
|
final int? id;
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
import 'package:flutter_date_time_picker/flutter_date_time_picker.dart';
|
import 'package:flutter_date_time_picker/flutter_date_time_picker.dart';
|
||||||
import 'package:timetable/timetable.dart';
|
import 'package:flutter_timetable/flutter_timetable.dart';
|
||||||
|
|
||||||
class AgendaTheme {
|
class AgendaTheme {
|
||||||
/// [AgendaTheme] is a class that contains all styling options
|
/// [AgendaTheme] is a class that contains all styling options
|
||||||
|
|
24
pubspec.yaml
24
pubspec.yaml
|
@ -1,25 +1,23 @@
|
||||||
name: agenda
|
name: flutter_agenda
|
||||||
description: Agenda widget with timetable
|
description: Agenda widget with an underlying timetable included
|
||||||
version: 0.0.1
|
version: 2.0.0
|
||||||
homepage: https://github.com/Iconica-Development/agenda
|
homepage: https://github.com/Iconica-Development/flutter_agenda
|
||||||
|
|
||||||
publish_to: none
|
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.18.0 <3.0.0"
|
sdk: ">=3.0.0 <4.0.0"
|
||||||
flutter: ">=1.17.0"
|
flutter: ">=1.17.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_date_time_picker:
|
flutter_date_time_picker:
|
||||||
git:
|
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
url: git@github.com:Iconica-Development/flutter_date_time_picker.git
|
version: ">=3.3.0 <4.0.0"
|
||||||
ref: stable
|
flutter_timetable:
|
||||||
timetable:
|
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
git:
|
version: ">=2.0.0 <3.0.0"
|
||||||
url: git@github.com:Iconica-Development/timetable.git
|
|
||||||
ref: v0.0.2
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import 'package:agenda/agenda.dart';
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_agenda/flutter_agenda.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -9,6 +13,7 @@ void main() {
|
||||||
const MaterialApp(
|
const MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: AgendaWidget(
|
body: AgendaWidget(
|
||||||
|
size: const Size(500, 500),
|
||||||
header: Text('Agenda'),
|
header: Text('Agenda'),
|
||||||
blocks: [],
|
blocks: [],
|
||||||
),
|
),
|
||||||
|
@ -26,6 +31,7 @@ void main() {
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: AgendaWidget(
|
body: AgendaWidget(
|
||||||
|
size: const Size(500, 500),
|
||||||
blocks: [
|
blocks: [
|
||||||
AgendaEvent(
|
AgendaEvent(
|
||||||
start: DateTime.now().subtract(const Duration(days: 3)),
|
start: DateTime.now().subtract(const Duration(days: 3)),
|
||||||
|
@ -62,6 +68,7 @@ void main() {
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: AgendaWidget(
|
body: AgendaWidget(
|
||||||
|
size: const Size(500, 500),
|
||||||
initialDate: DateTime.now(),
|
initialDate: DateTime.now(),
|
||||||
blocks: [
|
blocks: [
|
||||||
AgendaEvent(
|
AgendaEvent(
|
||||||
|
|
Loading…
Reference in a new issue