Skip to content

Commit

Permalink
chore(docs): clarify that handler instance should be kept with state
Browse files Browse the repository at this point in the history
  • Loading branch information
SPodjasek committed Jun 27, 2024
1 parent a67e125 commit 36fec2c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/flutter_password_scoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ Use `PasswordScoringBuilder` to build your UI. Take a look at example code if
you wan't to customize dictionaries and other options based on `Locale`.

```dart
PasswordScoringBuilder(
handler: kIsWeb
/// Keep in mind that when using Isolate based handler it's
/// crucial to keep it final in state, so it won't be
/// recreated on every call to [build].
final handler = kIsWeb
? PasswordScoringHandler()
: PasswordScoringIsolateHandler(),
: PasswordScoringIsolateHandler();
PasswordScoringBuilder(
handler: handler,
loadingPlaceholder: const Center(
child: CircularProgressIndicator(),
),
Expand Down

0 comments on commit 36fec2c

Please sign in to comment.