mirror of
https://github.com/Iconica-Development/flutter_agenda.git
synced 2025-05-19 05:13:44 +02:00
Compare commits
No commits in common. "master" and "v0.0.1" have entirely different histories.
23 changed files with 224 additions and 442 deletions
10
.github/dependabot.yaml
vendored
10
.github/dependabot.yaml
vendored
|
@ -1,10 +0,0 @@
|
|||
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
14
.github/workflows/component-documentation.yml
vendored
|
@ -1,14 +0,0 @@
|
|||
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
12
.github/workflows/flutter.yml
vendored
|
@ -1,12 +0,0 @@
|
|||
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,10 +28,5 @@ migrate_working_dir/
|
|||
.dart_tool/
|
||||
.packages
|
||||
build/
|
||||
.metadata
|
||||
|
||||
coverage/
|
||||
|
||||
# FVM Version Cache
|
||||
.fvm/
|
||||
.fvmrc
|
||||
coverage/
|
10
.metadata
Normal file
10
.metadata
Normal file
|
@ -0,0 +1,10 @@
|
|||
# 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,18 +1,3 @@
|
|||
## [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
|
||||
|
||||
* Initial release.
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
List of Features from this component:
|
9
LICENSE
9
LICENSE
|
@ -1,9 +0,0 @@
|
|||
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,23 +1,20 @@
|
|||
[](https://github.com/Iconica-Development) [](https://github.com/Iconica-Development/agenda/actions/new) [](https://github.com/tenhobi/effective_dart)
|
||||
[](https://github.com/Iconica-Development) [](URL TO GITHUB ACTIONS) [](https://github.com/tenhobi/effective_dart)
|
||||
|
||||
# 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.
|
||||
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.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this package, add `agenda` as a dependency in your pubspec.yaml file.
|
||||
To use this package, add `agenda` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/platform-integration/platform-channels).
|
||||
|
||||
## How to Use
|
||||
### Example
|
||||
|
||||
See the [Example Code](example/lib/main.dart) for an example on how to use this package.
|
||||
See [Example Code](example/lib/main.dart) for more info.
|
||||
|
||||
## Issues
|
||||
|
||||
|
@ -29,4 +26,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
|
|||
|
||||
## 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
BIN
agenda.gif
Binary file not shown.
Before Width: | Height: | Size: 3.6 MiB |
|
@ -25,6 +25,8 @@ linter:
|
|||
empty_statements: true
|
||||
hash_and_equals: true
|
||||
invariant_booleans: true
|
||||
iterable_contains_unrelated_type: true
|
||||
list_remove_unrelated_type: true
|
||||
literal_only_boolean_expressions: true
|
||||
no_adjacent_strings_in_list: true
|
||||
no_duplicate_case_values: true
|
||||
|
@ -204,6 +206,7 @@ linter:
|
|||
void_checks: true
|
||||
# pub rules
|
||||
depend_on_referenced_packages: true
|
||||
lowercase_with_underscores: true
|
||||
secure_pubspec_urls: false
|
||||
sort_pub_dependencies: false
|
||||
|
||||
|
|
36
example/.metadata
Normal file
36
example/.metadata
Normal file
|
@ -0,0 +1,36 @@
|
|||
# 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,6 +25,8 @@ linter:
|
|||
empty_statements: true
|
||||
hash_and_equals: true
|
||||
invariant_booleans: true
|
||||
iterable_contains_unrelated_type: true
|
||||
list_remove_unrelated_type: true
|
||||
literal_only_boolean_expressions: true
|
||||
no_adjacent_strings_in_list: true
|
||||
no_duplicate_case_values: true
|
||||
|
@ -204,6 +206,7 @@ linter:
|
|||
void_checks: true
|
||||
# pub rules
|
||||
depend_on_referenced_packages: true
|
||||
lowercase_with_underscores: true
|
||||
secure_pubspec_urls: false
|
||||
sort_pub_dependencies: false
|
||||
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:agenda/agenda.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_agenda/flutter_agenda.dart';
|
||||
|
||||
void main() {
|
||||
runApp(
|
||||
const MaterialApp(
|
||||
home: AgendaDemo(),
|
||||
),
|
||||
);
|
||||
runApp(const MaterialApp(home: AgendaDemo()));
|
||||
}
|
||||
|
||||
class AgendaDemo extends StatelessWidget {
|
||||
|
@ -19,113 +11,69 @@ class AgendaDemo extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: AgendaWidget(
|
||||
header: Text(
|
||||
'Agenda',
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
blockDimension: 50,
|
||||
highlightToday: false,
|
||||
blocks: [
|
||||
AgendaEvent(
|
||||
start: DateTime.now().subtract(
|
||||
const Duration(hours: 3),
|
||||
body: SafeArea(
|
||||
child: AgendaWidget(
|
||||
header: Text('Agenda', style: Theme.of(context).textTheme.headline6),
|
||||
blockWidth: 50,
|
||||
highlightToday: false,
|
||||
blocks: [
|
||||
AgendaEvent(
|
||||
start: DateTime.now().subtract(const Duration(hours: 3)),
|
||||
end: DateTime.now().add(const Duration(hours: 2)),
|
||||
),
|
||||
end: DateTime.now().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().subtract(
|
||||
const Duration(hours: 2),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().subtract(const Duration(hours: 1)),
|
||||
end: DateTime.now().add(const Duration(hours: 1)),
|
||||
),
|
||||
end: DateTime.now().add(
|
||||
const Duration(hours: 1),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().add(const Duration(hours: 3)),
|
||||
end: DateTime.now().add(const Duration(hours: 4)),
|
||||
id: 4,
|
||||
content: const Text('event 4'),
|
||||
),
|
||||
),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().subtract(
|
||||
const Duration(hours: 1),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().add(const Duration(hours: 3)),
|
||||
end: DateTime.now().add(const Duration(hours: 4)),
|
||||
id: 4,
|
||||
content: const Text('event 5'),
|
||||
),
|
||||
end: DateTime.now().add(
|
||||
const Duration(hours: 1),
|
||||
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(hours: 3),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().add(const Duration(days: 1)),
|
||||
end: DateTime.now()
|
||||
.add(const Duration(days: 1))
|
||||
.add(const Duration(hours: 2)),
|
||||
),
|
||||
end: DateTime.now().add(
|
||||
const Duration(hours: 4),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().subtract(const Duration(hours: 2)),
|
||||
end: DateTime.now().add(const Duration(hours: 1)),
|
||||
),
|
||||
id: 4,
|
||||
content: const Text('event 4'),
|
||||
),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().add(
|
||||
const Duration(hours: 3),
|
||||
AgendaEvent(
|
||||
start: DateTime.now().add(const Duration(days: 2)),
|
||||
end: DateTime.now().add(const Duration(days: 3)),
|
||||
),
|
||||
end: DateTime.now().add(
|
||||
const Duration(hours: 4),
|
||||
],
|
||||
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,
|
||||
),
|
||||
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
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
agenda:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
version: "2.9.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.2.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
version: "1.16.0"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.8"
|
||||
version: "1.0.5"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
flutter:
|
||||
|
@ -62,114 +62,69 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_agenda:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.0.0"
|
||||
flutter_date_time_picker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_date_time_picker
|
||||
sha256: d34231fae366fca3b14af3f810d750d56cb282a56e4721470d65074b1fbce969
|
||||
url: "https://forgejo.internal.iconica.nl/api/packages/internal/pub/"
|
||||
source: hosted
|
||||
version: "3.3.0"
|
||||
path: "."
|
||||
ref: stable
|
||||
resolved-ref: "6b3f1f5d12c1762bc208a1f1a4b9384dcb3369d4"
|
||||
url: "git@github.com:Iconica-Development/flutter_date_time_picker.git"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
version: "2.0.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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"
|
||||
version: "0.17.0"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.0.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.16+1"
|
||||
version: "0.12.12"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.8.0"
|
||||
version: "0.1.5"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.12.0"
|
||||
version: "1.8.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.0"
|
||||
version: "1.8.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
@ -179,66 +134,60 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.9.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
version: "1.10.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.1.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
version: "0.4.12"
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.dev"
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.1"
|
||||
version: "2.1.2"
|
||||
sdks:
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
dart: ">=2.18.0 <3.0.0"
|
||||
flutter: ">=2.0.0"
|
||||
|
|
|
@ -13,7 +13,7 @@ dependencies:
|
|||
sdk: flutter
|
||||
|
||||
cupertino_icons: ^1.0.2
|
||||
flutter_agenda:
|
||||
agenda:
|
||||
path: ../
|
||||
|
||||
dev_dependencies:
|
||||
|
|
7
lib/agenda.dart
Normal file
7
lib/agenda.dart
Normal file
|
@ -0,0 +1,7 @@
|
|||
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';
|
|
@ -1,9 +0,0 @@
|
|||
// 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,12 +1,8 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:agenda/src/models/agenda_event.dart';
|
||||
import 'package:agenda/src/models/agenda_theme.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_timetable/flutter_timetable.dart';
|
||||
import 'package:timetable/timetable.dart';
|
||||
|
||||
class AgendaWidget extends StatefulWidget {
|
||||
/// [AgendaWidget] is a widget that displays a timetable with events.
|
||||
|
@ -14,43 +10,26 @@ class AgendaWidget extends StatefulWidget {
|
|||
/// All styling can be configured through the [AgendaTheme] class.
|
||||
const AgendaWidget({
|
||||
required this.blocks,
|
||||
this.tableDirection = Axis.vertical,
|
||||
this.size,
|
||||
this.highlightedDates = const [],
|
||||
this.disabledDates = const [],
|
||||
this.initialDate,
|
||||
this.alwaysUse24HourFormat,
|
||||
this.header,
|
||||
this.childIfEmptyRoster,
|
||||
this.scrollController,
|
||||
this.scrollPhysics,
|
||||
this.onTapDay,
|
||||
this.tableTopPadding = 0,
|
||||
this.datePickerExpansion = 0,
|
||||
this.startHour = 0,
|
||||
this.endHour = 24,
|
||||
this.hourDimension = 80,
|
||||
this.hourHeight = 80,
|
||||
this.highlightToday = true,
|
||||
this.updateEmptyChildPosition = true,
|
||||
this.blockDimension = 50,
|
||||
this.blockWidth = 50,
|
||||
this.blockColor = const Color(0x80FF0000),
|
||||
this.theme = const AgendaTheme(),
|
||||
super.key,
|
||||
});
|
||||
|
||||
/// The [Axis] along which the timetable markings are lined out
|
||||
final Axis tableDirection;
|
||||
|
||||
/// Header widget that is displayed above the datepicker.
|
||||
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
|
||||
final List<AgendaEvent> blocks;
|
||||
|
||||
|
@ -75,21 +54,11 @@ class AgendaWidget extends StatefulWidget {
|
|||
/// Hour at which the timetable ends.
|
||||
final int endHour;
|
||||
|
||||
/// The amount of pixels above the timetable
|
||||
final double tableTopPadding;
|
||||
/// The heigh of one hour in the timetable.
|
||||
final double hourHeight;
|
||||
|
||||
/// The extra height of the datePicker when it is expanded
|
||||
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 width of the agendaItem if there is no child
|
||||
final double blockWidth;
|
||||
|
||||
/// The color of the agendaItem if there is no child
|
||||
final Color blockColor;
|
||||
|
@ -98,9 +67,6 @@ class AgendaWidget extends StatefulWidget {
|
|||
/// The [TableTheme] used by the timetable is included.
|
||||
final AgendaTheme theme;
|
||||
|
||||
/// The [Size] of the timetable.
|
||||
final Size? size;
|
||||
|
||||
/// The scroll controller to control the scrolling of the timetable.
|
||||
final ScrollController? scrollController;
|
||||
|
||||
|
@ -113,7 +79,6 @@ class AgendaWidget extends StatefulWidget {
|
|||
|
||||
class _AgendaWidgetState extends State<AgendaWidget> {
|
||||
late DateTime _selectedDate;
|
||||
double _scrollOffset = 0.0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -124,72 +89,31 @@ class _AgendaWidgetState extends State<AgendaWidget> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var events = _filterEventsOnDay(widget.blocks, _selectedDate);
|
||||
return DragDownDateTimePicker(
|
||||
alwaysUse24HourFormat: widget.alwaysUse24HourFormat,
|
||||
return DateTimePicker(
|
||||
initialDate: _selectedDate,
|
||||
pickTime: false,
|
||||
highlightToday: widget.highlightToday,
|
||||
header: widget.header,
|
||||
onTapDay: (selected) {
|
||||
widget.onTapDay?.call(selected);
|
||||
onTapDay: (p0) {
|
||||
setState(() {
|
||||
_selectedDate = selected;
|
||||
_selectedDate = p0;
|
||||
});
|
||||
},
|
||||
onTimerPickerSheetChange: (p0) {
|
||||
if (widget.updateEmptyChildPosition) {
|
||||
setState(() {
|
||||
_scrollOffset = p0 - widget.tableTopPadding;
|
||||
});
|
||||
}
|
||||
},
|
||||
disabledDates: widget.disabledDates,
|
||||
markedDates: widget.highlightedDates,
|
||||
dateTimePickerTheme: widget.theme.timePickerTheme,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: widget.tableTopPadding,
|
||||
),
|
||||
SizedBox(
|
||||
height: (widget.size != null)
|
||||
? widget.size!.height - widget.tableTopPadding
|
||||
: null,
|
||||
width: (widget.size != null) ? widget.size!.width : null,
|
||||
child: (widget.childIfEmptyRoster != null && events.isEmpty)
|
||||
? 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,
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Timetable(
|
||||
scrollPhysics: widget.scrollPhysics,
|
||||
scrollController: widget.scrollController,
|
||||
blockColor: widget.blockColor,
|
||||
blockWidth: widget.blockWidth,
|
||||
hourHeight: widget.hourHeight,
|
||||
startHour: widget.startHour,
|
||||
endHour: widget.endHour,
|
||||
timeBlocks: events,
|
||||
theme: widget.theme.tableTheme,
|
||||
combineBlocks: true,
|
||||
mergeBlocks: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -220,7 +144,6 @@ class _AgendaWidgetState extends State<AgendaWidget> {
|
|||
minute: e.end.minute,
|
||||
),
|
||||
id: e.id ?? 0,
|
||||
childDimension: e.childDimension,
|
||||
child: e.content,
|
||||
),
|
||||
)
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AgendaEvent {
|
||||
|
@ -12,7 +8,6 @@ class AgendaEvent {
|
|||
required this.end,
|
||||
this.id,
|
||||
this.content,
|
||||
this.childDimension,
|
||||
}) : assert(start.isBefore(end), 'start must be before end');
|
||||
|
||||
/// The start time of the event.
|
||||
|
@ -21,14 +16,9 @@ class AgendaEvent {
|
|||
/// The end time of the event.
|
||||
final DateTime end;
|
||||
|
||||
/// The [Widget] displayed inside the roster at the event time
|
||||
///
|
||||
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
|
||||
/// with the same id. Leave empty or 0 if you don't want to combine events.
|
||||
final int? id;
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter_date_time_picker/flutter_date_time_picker.dart';
|
||||
import 'package:flutter_timetable/flutter_timetable.dart';
|
||||
import 'package:timetable/timetable.dart';
|
||||
|
||||
class AgendaTheme {
|
||||
/// [AgendaTheme] is a class that contains all styling options
|
||||
|
|
24
pubspec.yaml
24
pubspec.yaml
|
@ -1,23 +1,25 @@
|
|||
name: flutter_agenda
|
||||
description: Agenda widget with an underlying timetable included
|
||||
version: 2.0.0
|
||||
homepage: https://github.com/Iconica-Development/flutter_agenda
|
||||
name: agenda
|
||||
description: Agenda widget with timetable
|
||||
version: 0.0.1
|
||||
homepage: https://github.com/Iconica-Development/agenda
|
||||
|
||||
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
sdk: ">=2.18.0 <3.0.0"
|
||||
flutter: ">=1.17.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
flutter_date_time_picker:
|
||||
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
version: ">=3.3.0 <4.0.0"
|
||||
flutter_timetable:
|
||||
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||
version: ">=2.0.0 <3.0.0"
|
||||
git:
|
||||
url: git@github.com:Iconica-Development/flutter_date_time_picker.git
|
||||
ref: stable
|
||||
timetable:
|
||||
git:
|
||||
url: git@github.com:Iconica-Development/timetable.git
|
||||
ref: v0.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:agenda/agenda.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_agenda/flutter_agenda.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
|
@ -13,7 +9,6 @@ void main() {
|
|||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: AgendaWidget(
|
||||
size: const Size(500, 500),
|
||||
header: Text('Agenda'),
|
||||
blocks: [],
|
||||
),
|
||||
|
@ -31,7 +26,6 @@ void main() {
|
|||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: AgendaWidget(
|
||||
size: const Size(500, 500),
|
||||
blocks: [
|
||||
AgendaEvent(
|
||||
start: DateTime.now().subtract(const Duration(days: 3)),
|
||||
|
@ -68,7 +62,6 @@ void main() {
|
|||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: AgendaWidget(
|
||||
size: const Size(500, 500),
|
||||
initialDate: DateTime.now(),
|
||||
blocks: [
|
||||
AgendaEvent(
|
||||
|
|
Loading…
Reference in a new issue