Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 5.0.0 - 1st June 2026

- **Breaking change:** `AppLock` now uses an `Overlay` instead of a nested `Navigator` to show the lock and inactive screens. This fixes Hero animations ([#31](https://github.com/tomalabaster/flutter_app_lock/issues/31)) and Android back navigation after dialogs ([#35](https://github.com/tomalabaster/flutter_app_lock/issues/35)).
- **Breaking change:** removed deprecated `lockScreen`, `enabled`, and `backgroundLockLatency` constructor parameters. Use `lockScreenBuilder`, `initiallyEnabled`, and `initialBackgroundLockLatency` instead.
- Background lock is deferred until the app returns to the foreground when the latency timer fires while the app is still backgrounded.

## 4.3.0 - 19th August 2025

- `InactiveBehavior` enum to control whether the widget returned by [AppLock.inactiveBuilder] is shown only when [AppLock] is enabled or whether it should always been shown
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In your flutter project add the dependency:
```yaml
dependencies:
...
flutter_app_lock: ^4.2.0+2
flutter_app_lock: ^5.0.0
```

For help getting started with Flutter, view the online documentation.
Expand Down
66 changes: 64 additions & 2 deletions example/lib/screens/my_home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ class _MyHomePageState extends State<MyHomePage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
const Hero(
tag: 'CounterIntroText',
child: Material(
child: Text(
'You have pushed the button this many times:',
),
),
),
Text(
'$_counter',
Expand Down Expand Up @@ -76,6 +81,63 @@ class _MyHomePageState extends State<MyHomePage> {
onPressed: () => AppLock.of(context)!
.setBackgroundLockLatency(const Duration(seconds: 5)),
),
ElevatedButton(
key: const Key('HeroTest'),
child: const Text('Hero test'),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (context) => Scaffold(
appBar: AppBar(title: const Text('Hero detail')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Hero(
tag: 'CounterIntroText',
child: Material(child: Text('Hero detail')),
),
ElevatedButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Pop'),
),
],
),
),
),
),
),
),
ElevatedButton(
key: const Key('DialogBackTest'),
child: const Text('Dialog then back test'),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (context) => Scaffold(
appBar: AppBar(title: const Text('Second screen')),
body: Center(
child: ElevatedButton(
key: const Key('ShowDialog'),
onPressed: () async {
await showDialog<void>(
context: context,
builder: (context) => AlertDialog(
content: const Text('Example dialog'),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Close'),
),
],
),
);
},
child: const Text('Show dialog'),
),
),
),
),
),
),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.3.0"
version: "5.0.0"
flutter_driver:
dependency: "direct dev"
description: flutter
Expand Down
Loading