Compare commits

..

No commits in common. "master" and "v0.0.1" have entirely different histories.

23 changed files with 224 additions and 442 deletions

View file

@ -1,10 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "daily"

View file

@ -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

View file

@ -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

5
.gitignore vendored
View file

@ -28,10 +28,5 @@ migrate_working_dir/
.dart_tool/ .dart_tool/
.packages .packages
build/ build/
.metadata
coverage/ coverage/
# FVM Version Cache
.fvm/
.fvmrc

10
.metadata Normal file
View 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

View file

@ -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 ## [0.0.1] - 2 September 2022
* Initial release. * Initial release.

View file

@ -1 +0,0 @@
List of Features from this component:

View file

@ -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.

View file

@ -1,23 +1,20 @@
[![pub package](https://img.shields.io/pub/v/agenda.svg)](https://github.com/Iconica-Development) [![Build status](https://img.shields.io/github/workflow/status/Iconica-Development/agenda/CI)](https://github.com/Iconica-Development/agenda/actions/new) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) [![pub package](https://img.shields.io/pub/v/[PACKAGE NAME ON PUB].svg)](https://github.com/Iconica-Development) [![Build status](https://github.com/Iconica-Development/agenda)](URL TO GITHUB ACTIONS) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](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.
![Agenda GIF](agenda.gif)
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. 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 ## Issues
@ -29,4 +26,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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

View file

@ -25,6 +25,8 @@ 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
@ -204,6 +206,7 @@ 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

36
example/.metadata Normal file
View 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'

View file

@ -25,6 +25,8 @@ 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
@ -204,6 +206,7 @@ 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

View file

@ -1,16 +1,8 @@
// SPDX-FileCopyrightText: 2022 Iconica import 'package:agenda/agenda.dart';
//
// 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( runApp(const MaterialApp(home: AgendaDemo()));
const MaterialApp(
home: AgendaDemo(),
),
);
} }
class AgendaDemo extends StatelessWidget { class AgendaDemo extends StatelessWidget {
@ -19,109 +11,64 @@ class AgendaDemo extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(), body: SafeArea(
body: AgendaWidget( child: AgendaWidget(
header: Text( header: Text('Agenda', style: Theme.of(context).textTheme.headline6),
'Agenda', blockWidth: 50,
style: Theme.of(context).textTheme.titleLarge,
),
blockDimension: 50,
highlightToday: false, highlightToday: false,
blocks: [ blocks: [
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract( start: DateTime.now().subtract(const Duration(hours: 3)),
const Duration(hours: 3), end: DateTime.now().add(const Duration(hours: 2)),
),
end: DateTime.now().add(
const Duration(hours: 2),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract( start: DateTime.now().subtract(const Duration(hours: 2)),
const Duration(hours: 2), end: DateTime.now().add(const Duration(hours: 1)),
),
end: DateTime.now().add(
const Duration(hours: 1),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract( start: DateTime.now().subtract(const Duration(hours: 1)),
const Duration(hours: 1), end: DateTime.now().add(const Duration(hours: 1)),
),
end: DateTime.now().add(
const Duration(hours: 1),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add( start: DateTime.now().add(const Duration(hours: 3)),
const Duration(hours: 3), end: DateTime.now().add(const Duration(hours: 4)),
),
end: DateTime.now().add(
const Duration(hours: 4),
),
id: 4, id: 4,
content: const Text('event 4'), content: const Text('event 4'),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add( start: DateTime.now().add(const Duration(hours: 3)),
const Duration(hours: 3), end: DateTime.now().add(const Duration(hours: 4)),
),
end: DateTime.now().add(
const Duration(hours: 4),
),
id: 4, id: 4,
content: const Text('event 5'), content: const Text('event 5'),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add( start: DateTime.now().add(const Duration(hours: 3)),
const Duration(hours: 3), end: DateTime.now().add(const Duration(hours: 4)),
),
end: DateTime.now().add(
const Duration(hours: 4),
),
id: 4, id: 4,
content: const Text('event 6'), content: const Text('event 6'),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add( start: DateTime.now().add(const Duration(days: 1)),
const Duration(days: 1),
),
end: DateTime.now() end: DateTime.now()
.add( .add(const Duration(days: 1))
const Duration(days: 1), .add(const Duration(hours: 2)),
)
.add(
const Duration(hours: 2),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract( start: DateTime.now().subtract(const Duration(hours: 2)),
const Duration(hours: 2), end: DateTime.now().add(const Duration(hours: 1)),
),
end: DateTime.now().add(
const Duration(hours: 1),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add( start: DateTime.now().add(const Duration(days: 2)),
const Duration(days: 2), end: DateTime.now().add(const Duration(days: 3)),
),
end: DateTime.now().add(
const Duration(days: 3),
),
), ),
], ],
disabledDates: [ disabledDates: [
// yesterday // yesterday
DateTime.now().subtract( DateTime.now().subtract(const Duration(days: 1)),
const Duration(days: 1),
),
], ],
highlightedDates: [ highlightedDates: [
// tomorrow // tomorrow
DateTime.now().add( DateTime.now().add(const Duration(days: 1)),
const Duration(days: 1),
),
], ],
theme: const AgendaTheme( theme: const AgendaTheme(
tableTheme: TableTheme( tableTheme: TableTheme(
@ -129,6 +76,7 @@ class AgendaDemo extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
} }

View file

@ -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
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.11.0" version: "2.9.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" version: "1.2.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dartlang.org"
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
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.18.0" version: "1.16.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.8" version: "1.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
flutter: flutter:
@ -62,114 +62,69 @@ 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:
name: flutter_date_time_picker path: "."
sha256: d34231fae366fca3b14af3f810d750d56cb282a56e4721470d65074b1fbce969 ref: stable
url: "https://forgejo.internal.iconica.nl/api/packages/internal/pub/" resolved-ref: "6b3f1f5d12c1762bc208a1f1a4b9384dcb3369d4"
source: hosted url: "git@github.com:Iconica-Development/flutter_date_time_picker.git"
version: "3.3.0" source: git
version: "0.0.1"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.3" version: "2.0.1"
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
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "0.19.0" version: "0.17.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
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.12"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "0.8.0" version: "0.1.5"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.12.0" version: "1.8.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.0" version: "1.8.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -179,66 +134,60 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.9.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.1.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dartlang.org"
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
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted 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: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" url: "https://pub.dartlang.org"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.2"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=2.18.0 <3.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=2.0.0"

View file

@ -13,7 +13,7 @@ dependencies:
sdk: flutter sdk: flutter
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
flutter_agenda: agenda:
path: ../ path: ../
dev_dependencies: dev_dependencies:

7
lib/agenda.dart Normal file
View 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';

View file

@ -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';

View file

@ -1,12 +1,8 @@
// SPDX-FileCopyrightText: 2022 Iconica import 'package:agenda/src/models/agenda_event.dart';
// 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:flutter_timetable/flutter_timetable.dart'; import 'package:timetable/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.
@ -14,43 +10,26 @@ 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.hourDimension = 80, this.hourHeight = 80,
this.highlightToday = true, this.highlightToday = true,
this.updateEmptyChildPosition = true, this.blockWidth = 50,
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;
@ -75,21 +54,11 @@ class AgendaWidget extends StatefulWidget {
/// Hour at which the timetable ends. /// Hour at which the timetable ends.
final int endHour; final int endHour;
/// The amount of pixels above the timetable /// The heigh of one hour in the timetable.
final double tableTopPadding; final double hourHeight;
/// The extra height of the datePicker when it is expanded /// The width of the agendaItem if there is no child
final double datePickerExpansion; final double blockWidth;
/// [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;
@ -98,9 +67,6 @@ 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;
@ -113,7 +79,6 @@ 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() {
@ -124,72 +89,31 @@ 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 DragDownDateTimePicker( return DateTimePicker(
alwaysUse24HourFormat: widget.alwaysUse24HourFormat,
initialDate: _selectedDate, initialDate: _selectedDate,
pickTime: false, pickTime: false,
highlightToday: widget.highlightToday, highlightToday: widget.highlightToday,
header: widget.header, header: widget.header,
onTapDay: (selected) { onTapDay: (p0) {
widget.onTapDay?.call(selected);
setState(() { setState(() {
_selectedDate = selected; _selectedDate = p0;
}); });
}, },
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: Column( child: Timetable(
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, scrollPhysics: widget.scrollPhysics,
scrollController: widget.scrollController, scrollController: widget.scrollController,
blockColor: widget.blockColor, blockColor: widget.blockColor,
blockDimension: widget.blockDimension, blockWidth: widget.blockWidth,
hourDimension: widget.hourDimension, hourHeight: widget.hourHeight,
startHour: widget.startHour, startHour: widget.startHour,
endHour: widget.endHour, endHour: widget.endHour,
timeBlocks: events, timeBlocks: events,
theme: widget.theme.tableTheme, theme: widget.theme.tableTheme,
combineBlocks: true, combineBlocks: true,
mergeBlocks: true, mergeBlocks: true,
size: (widget.size != null)
? Size(
widget.size!.width,
widget.size!.height - widget.tableTopPadding,
)
: null,
),
),
],
), ),
); );
} }
@ -220,7 +144,6 @@ 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,
), ),
) )

View file

@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AgendaEvent { class AgendaEvent {
@ -12,7 +8,6 @@ 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.
@ -21,14 +16,9 @@ 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;

View file

@ -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_date_time_picker/flutter_date_time_picker.dart';
import 'package:flutter_timetable/flutter_timetable.dart'; import 'package:timetable/timetable.dart';
class AgendaTheme { class AgendaTheme {
/// [AgendaTheme] is a class that contains all styling options /// [AgendaTheme] is a class that contains all styling options

View file

@ -1,23 +1,25 @@
name: flutter_agenda name: agenda
description: Agenda widget with an underlying timetable included description: Agenda widget with timetable
version: 2.0.0 version: 0.0.1
homepage: https://github.com/Iconica-Development/flutter_agenda homepage: https://github.com/Iconica-Development/agenda
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub publish_to: none
environment: environment:
sdk: ">=3.0.0 <4.0.0" sdk: ">=2.18.0 <3.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:
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub git:
version: ">=3.3.0 <4.0.0" url: git@github.com:Iconica-Development/flutter_date_time_picker.git
flutter_timetable: ref: stable
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub timetable:
version: ">=2.0.0 <3.0.0" git:
url: git@github.com:Iconica-Development/timetable.git
ref: v0.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View file

@ -1,9 +1,5 @@
// SPDX-FileCopyrightText: 2022 Iconica import 'package:agenda/agenda.dart';
//
// 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() {
@ -13,7 +9,6 @@ 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: [],
), ),
@ -31,7 +26,6 @@ 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)),
@ -68,7 +62,6 @@ 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(