Improved README, fixed dependencies, added GIF, added dependabot

This commit is contained in:
Thomas Klein Langenhorst 2022-12-13 13:40:56 +01:00
parent eaf55a9349
commit 7a5f65f009
8 changed files with 163 additions and 75 deletions

10
.github/dependabot.yaml vendored Normal file
View file

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

32
.github/workflows/flutter.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches:
- master
- feature/*
- bugfix/*
- hotfix/*
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
/opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter pub get
run: flutter pub get
- name: Flutter format
run: flutter format -o none --set-exit-if-changed .
- name: Flutter analyze
run: flutter analyze

View file

@ -1,20 +1,20 @@
[![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) [![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)
# 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)
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 +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>

BIN
agenda.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

View file

@ -6,7 +6,11 @@ import 'package:agenda/agenda.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() { void main() {
runApp(const MaterialApp(home: AgendaDemo())); runApp(
const MaterialApp(
home: AgendaDemo(),
),
);
} }
class AgendaDemo extends StatelessWidget { class AgendaDemo extends StatelessWidget {
@ -15,64 +19,109 @@ 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(
'Agenda',
style: Theme.of(context).textTheme.headline6,
),
blockWidth: 50, blockWidth: 50,
highlightToday: false, highlightToday: false,
blocks: [ blocks: [
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract(const Duration(hours: 3)), start: DateTime.now().subtract(
end: DateTime.now().add(const Duration(hours: 2)), const Duration(hours: 3),
),
end: DateTime.now().add(
const Duration(hours: 2),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract(const Duration(hours: 2)), start: DateTime.now().subtract(
end: DateTime.now().add(const Duration(hours: 1)), const Duration(hours: 2),
),
end: DateTime.now().add(
const Duration(hours: 1),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract(const Duration(hours: 1)), start: DateTime.now().subtract(
end: DateTime.now().add(const Duration(hours: 1)), const Duration(hours: 1),
),
end: DateTime.now().add(
const Duration(hours: 1),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add(const Duration(hours: 3)), start: DateTime.now().add(
end: DateTime.now().add(const Duration(hours: 4)), const Duration(hours: 3),
),
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(const Duration(hours: 3)), start: DateTime.now().add(
end: DateTime.now().add(const Duration(hours: 4)), const Duration(hours: 3),
),
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(const Duration(hours: 3)), start: DateTime.now().add(
end: DateTime.now().add(const Duration(hours: 4)), const Duration(hours: 3),
),
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(const Duration(days: 1)), start: DateTime.now().add(
const Duration(days: 1),
),
end: DateTime.now() end: DateTime.now()
.add(const Duration(days: 1)) .add(
.add(const Duration(hours: 2)), const Duration(days: 1),
)
.add(
const Duration(hours: 2),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().subtract(const Duration(hours: 2)), start: DateTime.now().subtract(
end: DateTime.now().add(const Duration(hours: 1)), const Duration(hours: 2),
),
end: DateTime.now().add(
const Duration(hours: 1),
),
), ),
AgendaEvent( AgendaEvent(
start: DateTime.now().add(const Duration(days: 2)), start: DateTime.now().add(
end: DateTime.now().add(const Duration(days: 3)), const Duration(days: 2),
),
end: DateTime.now().add(
const Duration(days: 3),
),
), ),
], ],
disabledDates: [ disabledDates: [
// yesterday // yesterday
DateTime.now().subtract(const Duration(days: 1)), DateTime.now().subtract(
const Duration(days: 1),
),
], ],
highlightedDates: [ highlightedDates: [
// tomorrow // tomorrow
DateTime.now().add(const Duration(days: 1)), DateTime.now().add(
const Duration(days: 1),
),
], ],
theme: const AgendaTheme( theme: const AgendaTheme(
tableTheme: TableTheme( tableTheme: TableTheme(
@ -80,7 +129,6 @@ class AgendaDemo extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
} }

View file

@ -66,11 +66,11 @@ packages:
dependency: transitive dependency: transitive
description: description:
path: "." path: "."
ref: stable ref: "2.2.1"
resolved-ref: "6b3f1f5d12c1762bc208a1f1a4b9384dcb3369d4" resolved-ref: "6c78d4d73fa61ac4e2b103c821edf474421f81b4"
url: "git@github.com:Iconica-Development/flutter_date_time_picker.git" url: "https://github.com/Iconica-Development/flutter_date_time_picker"
source: git source: git
version: "0.0.1" version: "2.2.1"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -176,11 +176,11 @@ packages:
dependency: transitive dependency: transitive
description: description:
path: "." path: "."
ref: "v0.0.2" ref: "1.0.0"
resolved-ref: "62fdaa443818bd646058b536a12304725d1619fd" resolved-ref: dada4ea9a440bcfe58a235dfd93798e4d5ce857a
url: "git@github.com:Iconica-Development/timetable.git" url: "https://github.com/Iconica-Development/flutter_timetable"
source: git source: git
version: "0.0.1" version: "0.0.2"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:

View file

@ -93,7 +93,7 @@ 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(
initialDate: _selectedDate, initialDate: _selectedDate,
pickTime: false, pickTime: false,
highlightToday: widget.highlightToday, highlightToday: widget.highlightToday,
@ -110,8 +110,6 @@ class _AgendaWidgetState extends State<AgendaWidget> {
scrollPhysics: widget.scrollPhysics, scrollPhysics: widget.scrollPhysics,
scrollController: widget.scrollController, scrollController: widget.scrollController,
blockColor: widget.blockColor, blockColor: widget.blockColor,
blockWidth: widget.blockWidth,
hourHeight: widget.hourHeight,
startHour: widget.startHour, startHour: widget.startHour,
endHour: widget.endHour, endHour: widget.endHour,
timeBlocks: events, timeBlocks: events,

View file

@ -14,12 +14,12 @@ dependencies:
sdk: flutter sdk: flutter
flutter_date_time_picker: flutter_date_time_picker:
git: git:
url: git@github.com:Iconica-Development/flutter_date_time_picker.git url: https://github.com/Iconica-Development/flutter_date_time_picker
ref: stable ref: 2.2.1
timetable: timetable:
git: git:
url: git@github.com:Iconica-Development/timetable.git url: https://github.com/Iconica-Development/flutter_timetable
ref: v0.0.2 ref: 1.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: