Skip to content

Commit 87ea243

Browse files
ci: bump version to v0.5.4
1 parent 6c61894 commit 87ea243

5 files changed

Lines changed: 24 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [0.5.4]
4+
5+
- Released @ 11/2025 (UTC)
6+
- Simplify setPreservationStrategy
7+
38
## [0.5.3]
49

510
- Released @ 11/2025 (UTC)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[![banner](https://github.com/dev-cetera/df_router/blob/v0.5.3/doc/assets/banner.png?raw=true)](https://github.com/dev-cetera)
1+
[![banner](https://github.com/dev-cetera/df_router/blob/v0.5.4/doc/assets/banner.png?raw=true)](https://github.com/dev-cetera)
22

33
[![pub](https://img.shields.io/pub/v/df_router.svg)](https://pub.dev/packages/df_router)
4-
[![tag](https://img.shields.io/badge/Tag-v0.5.3-purple?logo=github)](https://github.com/dev-cetera/df_router/tree/v0.5.3)
4+
[![tag](https://img.shields.io/badge/Tag-v0.5.4-purple?logo=github)](https://github.com/dev-cetera/df_router/tree/v0.5.4)
55
[![buymeacoffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/dev_cetera)
66
[![sponsor](https://img.shields.io/badge/Sponsor-grey?logo=github-sponsors&logoColor=pink)](https://github.com/sponsors/dev-cetera)
77
[![patreon](https://img.shields.io/badge/Patreon-grey?logo=patreon)](https://www.patreon.com/t0mb3rr)

example/example.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ class ChatScreen extends StatelessWidget with RouteWidgetMixin {
143143
ElevatedButton(
144144
onPressed: () {
145145
final controller = RouteController.of(context);
146-
controller.goBackward(animationEffect: const BackwardEffectWeb());
146+
controller.goBackward(
147+
animationEffect: const BackwardEffectWeb(),
148+
);
147149
},
148150
child: const Text('Go Back - Quick Back Effect'),
149151
),

hosted_example/lib/main.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ class ChatScreen extends StatelessWidget with RouteWidgetMixin {
135135
ElevatedButton(
136136
onPressed: () {
137137
final controller = RouteController.of(context);
138-
controller.goBackward(animationEffect: const BackwardEffectWeb());
138+
controller.goBackward(
139+
animationEffect: const BackwardEffectWeb(),
140+
);
139141
},
140142
child: const Text('Go Back - Quick Back Effect'),
141143
),

lib/src/route_controller.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ class RouteController {
131131
_preservationStrategy = shouldPreserve;
132132

133133
void _maybeRemoveStaleRoute(RouteState routeState) {
134-
final routeBuilder =
135-
_getBuilderByPath(routeState.uri)?.copyWith(routeState: routeState);
134+
final routeBuilder = _getBuilderByPath(
135+
routeState.uri,
136+
)?.copyWith(routeState: routeState);
136137
if (routeBuilder == null) return;
137138
if (!_preservationStrategy(routeBuilder)) {
138139
_widgetCache[routeState] = SizedBox.shrink(key: routeState.key);
@@ -244,8 +245,9 @@ class RouteController {
244245
if (index < 0 || index >= state.routes.length) return false;
245246

246247
_previousRouteForTransition = currentRouteState;
247-
_nextAnimationEffect =
248-
index < state.index ? backwardAnimationEffect : forwardAnimationEffect;
248+
_nextAnimationEffect = index < state.index
249+
? backwardAnimationEffect
250+
: forwardAnimationEffect;
249251

250252
final newRoute = state.routes[index];
251253
addToCache([newRoute]); // Ensure widget exists before navigating.
@@ -385,8 +387,9 @@ class RouteController {
385387
},
386388
builder: (context, results) {
387389
final children = _widgetCache.values.toList();
388-
final layerEffects =
389-
results.isNotEmpty ? results.map((e) => e.data).first : null;
390+
final layerEffects = results.isNotEmpty
391+
? results.map((e) => e.data).first
392+
: null;
390393
return PrioritizedIndexedStack(
391394
indices: [
392395
_indexOfRouteState(routeState),
@@ -411,8 +414,8 @@ class RouteController {
411414
}
412415

413416
static RouteController of(BuildContext context) {
414-
final provider =
415-
context.dependOnInheritedWidgetOfExactType<RouteControllerProvider>();
417+
final provider = context
418+
.dependOnInheritedWidgetOfExactType<RouteControllerProvider>();
416419
if (provider == null) {
417420
throw FlutterError('No RouteControllerProvider found in context');
418421
}

0 commit comments

Comments
 (0)