Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: liquid 19, switch strategies #3

Merged
merged 2 commits into from
Feb 11, 2025
Merged
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
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 2626946c0f4c5a786ca56bc00721109d51be6950

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2
20 changes: 19 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:mtrust_sec_kit/mtrust_sec_kit.dart';

import 'package:liquid_flutter/liquid_flutter.dart';
import 'package:mtrust_urp_ble_strategy/mtrust_urp_ble_strategy.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
Expand Down Expand Up @@ -34,6 +35,9 @@ class MainApp extends StatefulWidget {
class _MainAppState extends State<MainApp> {
bool _canDismiss = true;

final UrpBleStrategy _bleStrategy = UrpBleStrategy();
bool _useVirtual = false;

@override
void initState() {
virtualStrategy.createVirtualReader(FoundDevice(
Expand All @@ -44,6 +48,12 @@ class _MainAppState extends State<MainApp> {
super.initState();
}

@override
void dispose() {
_bleStrategy.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return LdPortal(
Expand All @@ -56,6 +66,14 @@ class _MainAppState extends State<MainApp> {
),
body: SafeArea(
child: LdAutoSpace(children: [
LdToggle(
label: "Use virtual reader",
checked: _useVirtual,
onChanged: (value) {
setState(() {
_useVirtual = value;
});
}),
LdToggle(
label: "User can dismiss modal",
checked: _canDismiss,
Expand All @@ -66,7 +84,7 @@ class _MainAppState extends State<MainApp> {
}),
SecModalBuilder(
canDismiss: _canDismiss,
strategy: virtualStrategy,
strategy: _useVirtual ? virtualStrategy : _bleStrategy,
payload: "<example payload>",
onDismiss: () {
debugPrint("Dismissed");
Expand Down
50 changes: 25 additions & 25 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -289,18 +289,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
Expand All @@ -321,10 +321,10 @@ packages:
dependency: "direct main"
description:
name: liquid_flutter
sha256: "27cbb567fde79bd7faf80f6f7e7c3de3944d639e400bcc94270c5a0920a81542"
sha256: "860b21081222fb6ac77e46014fda0e5e29ff72cb8568c7c532f5fbea90640ca6"
url: "https://pub.dev"
source: hosted
version: "18.2.0"
version: "19.0.0"
logger:
dependency: transitive
description:
Expand Down Expand Up @@ -376,18 +376,18 @@ packages:
dependency: "direct main"
description:
name: mtrust_urp_ble_strategy
sha256: "38623dfd962db4e0049a67c594a902bc5908bfe9fdf09847d5f85d2d3123f754"
sha256: "9d1f2269a7f99400468cb98b2089f5831ae46c03bf033a2ef260841a4b7a711f"
url: "https://pub.dev"
source: hosted
version: "9.0.0-5"
version: "9.0.0-6"
mtrust_urp_core:
dependency: transitive
description:
name: mtrust_urp_core
sha256: "72e065f7d6a02cb4a11caed69d8fb133c2ee9071194ce72fcba6dddf54f3fbae"
sha256: "3765318619490727496b45c3a5fb041e53b07b0e6f7e099cef1a2de221ef72b5"
url: "https://pub.dev"
source: hosted
version: "9.0.0-5"
version: "9.0.0-6"
mtrust_urp_types:
dependency: "direct main"
description:
Expand All @@ -400,18 +400,18 @@ packages:
dependency: "direct main"
description:
name: mtrust_urp_ui
sha256: "80f85517cbd7f7562fbf34364566a3ef9ff89356a4a22da3b4864141e6979e4f"
sha256: "1ba16568ed9f1e85f94c27a9b958c536c165892d4babdd7ba93ac80cd53d29fa"
url: "https://pub.dev"
source: hosted
version: "9.0.0-5"
version: "9.0.0-6"
mtrust_urp_virtual_strategy:
dependency: "direct main"
description:
name: mtrust_urp_virtual_strategy
sha256: "77d8538179ffaf247c3fd4cdc5c6b4b0b903e7483f13e3e85bb296c817ff4ab1"
sha256: "4c7d0a8dda95c4279da71f1c0cf6f7009e847ac41b9756cd89adb47d9939a86a"
url: "https://pub.dev"
source: hosted
version: "9.0.0-5"
version: "9.0.0-6"
multi_split_view:
dependency: transitive
description:
Expand Down Expand Up @@ -600,7 +600,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_span:
dependency: transitive
description:
Expand All @@ -613,10 +613,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
Expand All @@ -629,10 +629,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
stringr:
dependency: transitive
description:
Expand All @@ -653,10 +653,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -709,10 +709,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
web:
dependency: transitive
description:
Expand Down
10 changes: 4 additions & 6 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ dependencies:
mtrust_sec_kit:
path: ../
mtrust_urp_types: ^4.1.0
mtrust_urp_ble_strategy: ^9.0.0-5
mtrust_urp_virtual_strategy: ^9.0.0-5
mtrust_urp_ui: ^9.0.0-5
liquid_flutter: ^18.2.0


mtrust_urp_ble_strategy: ^9.0.0-6
mtrust_urp_virtual_strategy: ^9.0.0-6
mtrust_urp_ui: ^9.0.0-6
liquid_flutter: ^19.0.0
dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
1 change: 1 addition & 0 deletions lib/src/ui/sec_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ LdModal secModal({
disableScrolling: true,
padding: EdgeInsets.zero,
noHeader: true,
showDismissButton: false,
userCanDismiss: canDismiss,
topRadius: topRadius,
fixedDialogSize: const Size(400, 400),
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ dependencies:
flutter_localizations:
sdk: flutter
intl: ^0.19.0
liquid_flutter: ^18.2.0
mtrust_urp_core: ^9.0.0-5
liquid_flutter: ^19.0.0
mtrust_urp_core: ^9.0.0-6
mtrust_urp_types: ^4.1.0
mtrust_urp_ui: ^9.0.0-5
mtrust_urp_ui: ^9.0.0-6
dev_dependencies:
flutter_test:
sdk: flutter
golden_toolkit: ^0.15.0
mtrust_urp_virtual_strategy: ^9.0.0-0
mtrust_urp_virtual_strategy: ^9.0.0-6
very_good_analysis: ^5.1.0
flutter:
uses-material-design: true
Expand Down