Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 4815598
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 18:24:08 2023 +0100

    Release v1.0.0-alpha.11

commit e7bae6d
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 18:18:38 2023 +0100

    Add more linter rules

commit 40f1b67
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 18:16:46 2023 +0100

    Update black_hole_flutter to ^1.0.0

commit ed2d0a0
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 18:14:42 2023 +0100

    Upgrade Dart to v2.18.0, Flutter to v3.3.0

commit 59b0eb4
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 15:40:14 2023 +0100

    Add DateScrollActivity

    Closes: JonasWanke#110

commit 8855d85
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 15:39:34 2023 +0100

    Implement Diagnosticable for VisibleDateRange

commit 469a0de
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 15:38:46 2023 +0100

    Add DateDiagnosticsProperty

commit b35b240
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 15:38:31 2023 +0100

    Fix allDayEventBorder.toString()

commit 174387e
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 15:38:09 2023 +0100

    Fix formatting

commit 8e0315c
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 12:36:34 2023 +0100

    Honor maxWidth in WeekIndicator

    Closes: JonasWanke#131

commit b2f06cf
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 12:03:19 2023 +0100

    Remove superfluous num type arguments

commit 763661e
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 11:51:44 2023 +0100

    Fix MonthPageView's shrinkWrapped height when jumping to far-away date

commit c0167c2
Author: Jonas Wanke <contact@jonas-wanke.com>
Date:   Tue Jan 24 11:51:04 2023 +0100

    Cancel animation when jumping in Date-/TimeController

    Closes JonasWanke#135
  • Loading branch information
TruFelix committed Jan 24, 2023
1 parent 17d8b66 commit d9c4158
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 129 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm


<!-- Template:
## NEW · 2022-xx-xx
## NEW · 2023-xx-xx
### ⚠️ BREAKING CHANGES
### 🎉 New Features
### ⚡ Changes
Expand All @@ -16,6 +17,25 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### 📦 Build & CI
-->

## 1.0.0-alpha.11 · 2023-01-24

### ⚠️ BREAKING CHANGES
* Add `DateScrollActivity` and subclasses. `dateController.value.activity` tells you the current activity and even the target when currently animating between dates. This is breaking because `dateController.value` now stores a `DatePageValueWithScrollActivity` instead of a `DatePageValue` ([`59b0eb4`](https://github.com/JonasWanke/timetable/commit/59b0eb48506cfe25aa5cda0de3bade261d502f43)), closes: [#110](https://github.com/JonasWanke/timetable/issues/110)

### 🎉 New Features
* add `DateDiagnosticsProperty` ([`469a0de`](https://github.com/JonasWanke/timetable/commit/469a0ded6acab100ad5deaae8eab0bf6b29a7544))
* implement `Diagnosticable` for `VisibleDateRange` and `DatePageValue` ([`8855d85`](https://github.com/JonasWanke/timetable/commit/8855d85690ef9f5b497fb27b28c1d9bf37734df9))

### 🐛 Bug Fixes
* cancel ongoing animations when jumping in `DateController`/`TimeController` ([`c0167c2`](https://github.com/JonasWanke/timetable/commit/c0167c24100fdd607ffb8a8d5ed9094a536e5848)), closes: [#135](https://github.com/JonasWanke/timetable/issues/135)
* honor maximum constraints in `WeekIndicator` ([`8e0315c`](https://github.com/JonasWanke/timetable/commit/8e0315cb4169b1a0d3c04c5411b2132ce0f2ce71)), closes: [#131](https://github.com/JonasWanke/timetable/issues/131)
* fix `MonthPageView`'s shrink-wrapped height when jumping to far-away date ([`763661e`](https://github.com/JonasWanke/timetable/commit/763661eeae0a84ab1d2af3d2cd0b05277f62c044))
* fix `allDayEventBorder.toString()` ([`b35b240`](https://github.com/JonasWanke/timetable/commit/b35b24032919a231d3d817e9afbeb816ef9a768d))

### 📦 Build & CI
* upgrade to Flutter: `>=3.3.0`, Dart `>=2.18.0 <3.0.0` ([`ed2d0a0`](https://github.com/JonasWanke/timetable/commit/ed2d0a0aeb6a57741b808088be847a430fecae6a))
* update `black_hole_flutter` to `^1.0.0` ([`40f1b67`](https://github.com/JonasWanke/timetable/commit/40f1b6764bf2e5fb7df9a95ea448c9a7071832a8))

## 1.0.0-alpha.10 · 2022-08-19

### 📜 Documentation updates
Expand Down
11 changes: 9 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ analyzer:
strict-casts: true
strict-inference: true
strict-raw-types: true
exclude:
- lib/generated_plugin_registrant.dart

linter:
rules:
Expand All @@ -18,6 +16,7 @@ linter:
avoid_final_parameters: true
avoid_implementing_value_types: true
avoid_js_rounded_ints: true
avoid_multiple_declarations_per_line: true
avoid_positional_boolean_parameters: true
avoid_returning_this: true
avoid_setters_without_getters: true
Expand All @@ -28,10 +27,13 @@ linter:
cancel_subscriptions: true
cast_nullable_to_non_nullable: true
close_sinks: true
combinators_ordering: true
comment_references: true
conditional_uri_does_not_exist: true
directives_ordering: true
discarded_futures: true
flutter_style_todos: true
invariant_booleans: true
join_return_with_assignment: true
no_adjacent_strings_in_list: true
omit_local_variable_types: true
Expand All @@ -53,14 +55,19 @@ linter:
throw_in_finally: true
tighten_type_of_initializing_formals: true
unawaited_futures: true
unnecessary_await_in_return: false
unnecessary_lambdas: true
unnecessary_null_aware_operator_on_extension_on_nullable: true
unnecessary_parenthesis: true
unnecessary_statements: true
unnecessary_to_list_in_spreads: true
unreachable_from_main: true
unsafe_html: true
use_colored_box: true
use_decorated_box: true
use_enums: true
use_key_in_widget_constructors: false
use_setters_to_change_properties: true
use_string_buffers: true
use_string_in_part_of_directives: true
use_super_parameters: true
98 changes: 21 additions & 77 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages:
name: black_hole_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.5"
version: "1.0.0"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -70,49 +70,21 @@ packages:
name: debug_overlay
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.2"
version: "0.2.5"
device_info_plus:
dependency: transitive
description:
name: device_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.5"
device_info_plus_linux:
dependency: transitive
description:
name: device_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
device_info_plus_macos:
dependency: transitive
description:
name: device_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
version: "8.0.0"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
device_info_plus_web:
dependency: transitive
description:
name: device_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
device_info_plus_windows:
dependency: transitive
description:
name: device_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.2"
version: "7.0.0"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -176,7 +148,7 @@ packages:
name: implicitly_animated_list
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -211,7 +183,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.13"
version: "0.12.14"
material_color_utilities:
dependency: transitive
description:
Expand All @@ -232,42 +204,14 @@ packages:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.3+1"
package_info_plus_linux:
dependency: transitive
description:
name: package_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_macos:
dependency: transitive
description:
name: package_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "3.0.2"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
package_info_plus_web:
dependency: transitive
description:
name: package_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.6"
package_info_plus_windows:
dependency: transitive
description:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.0.1"
path:
dependency: transitive
description:
Expand All @@ -288,14 +232,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
remind_timetable:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.0.0-alpha.13"
version: "3.2.1"
sensors_plus:
dependency: transitive
description:
Expand Down Expand Up @@ -323,7 +260,7 @@ packages:
name: shake
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.2.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -349,7 +286,7 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
Expand All @@ -371,6 +308,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
timetable:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.0.0-alpha.11"
tuple:
dependency: transitive
description:
Expand Down Expand Up @@ -398,7 +342,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.1.3"
sdks:
dart: ">=2.18.6 <3.0.0"
flutter: ">=3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: A simple example app for the timetable package
publish_to: none

environment:
sdk: '>=2.17.0-266.8.beta <3.0.0'
flutter: '>=2.13.0-0.4.pre'
sdk: '>=2.18.0 <3.0.0'
flutter: '>=3.3.0'

dependencies:
debug_overlay: ^0.2.1
Expand Down
18 changes: 11 additions & 7 deletions lib/src/components/now_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:ui';

import 'package:async/async.dart';
Expand Down Expand Up @@ -314,7 +315,7 @@ class _NowIndicatorPainter extends CustomPainter {

@override
void paint(Canvas canvas, Size size) {
_repaint?.cancel();
unawaited(_repaint?.cancel());
_repaint = null;

final pageValue = controller.value;
Expand All @@ -340,11 +341,14 @@ class _NowIndicatorPainter extends CustomPainter {
final maxDistance = 0.5 / devicePixelRatio;
final delay = 1.days * (maxDistance / size.height);
_repaint = CancelableOperation.fromFuture(
Future<void>.delayed(delay).then((_) {
// [ChangeNotifier.notifyListeners] is protected, so we use a
// [ValueNotifier] and always set a different time.
_repaintNotifier.value = DateTimeTimetable.now();
}),
Future<void>.delayed(
delay,
() {
// [ChangeNotifier.notifyListeners] is protected, so we use a
// [ValueNotifier] and always set a different time.
_repaintNotifier.value = DateTimeTimetable.now();
},
),
);
}

Expand All @@ -362,7 +366,7 @@ class _NowIndicatorPainter extends CustomPainter {
void removeListener(VoidCallback listener) {
_activeListenerCount--;
if (_activeListenerCount == 0) {
_repaint?.cancel();
unawaited(_repaint?.cancel());
_repaint = null;
}
super.removeListener(listener);
Expand Down
15 changes: 7 additions & 8 deletions lib/src/components/week_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,19 @@ class _RenderWeekIndicatorText extends RenderBox {

@override
double computeMinIntrinsicWidth(double height) =>
_labelPainters.map<num>((it) => it.width).min.toDouble();
_labelPainters.map((it) => it.width).min.toDouble();
@override
double computeMaxIntrinsicWidth(double height) {
final widths = _labelPainters.map<num>((it) => it.width);
final widths = _labelPainters.map((it) => it.width);
return (alwaysUseNarrowestVariant ? widths.min : widths.max).toDouble();
}

@override
double computeMinIntrinsicHeight(double width) =>
_labelPainters.map<num>((it) => it.height).min.toDouble();
_labelPainters.map((it) => it.height).min.toDouble();
@override
double computeMaxIntrinsicHeight(double width) {
final heights = _labelPainters.map<num>((it) => it.height);
final heights = _labelPainters.map((it) => it.height);
return (alwaysUseNarrowestVariant ? heights.min : heights.max).toDouble();
}

Expand All @@ -238,13 +238,12 @@ class _RenderWeekIndicatorText extends RenderBox {
.firstOrNull ??
narrowestPainter();
}
size = _labelPainter.size;
size = constraints.constrain(_labelPainter.size);
}

@override
void paint(PaintingContext context, Offset offset) {
_labelPainter.paint(context.canvas, offset);
}
void paint(PaintingContext context, Offset offset) =>
_labelPainter.paint(context.canvas, offset);
}

/// Defines visual properties for [WeekIndicator].
Expand Down
Loading

0 comments on commit d9c4158

Please sign in to comment.