This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from MXCzkEVM/blueberry_ring
Blueberry ring
- Loading branch information
Showing
12 changed files
with
271 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
lib/features/common/packages/bluetooth/blueberry_ring/domain/domain.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export 'blueberry_repository.dart'; | ||
export 'blueberry_ring_use_case.dart'; | ||
export 'blueberry_ring_background_notifications_use_case.dart'; | ||
export 'blueberry_ring_background_sync_use_case.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
lib/features/dapps/subfeatures/open_dapp/widgets/message_info.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'package:datadashwallet/common/common.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_i18n/flutter_i18n.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
import 'package:mxc_ui/mxc_ui.dart'; | ||
|
||
import '../open_dapp_presenter.dart'; | ||
|
||
class MessageInfo extends ConsumerWidget { | ||
const MessageInfo({ | ||
Key? key, | ||
required this.networkName, | ||
required this.message, | ||
this.onTap, | ||
}) : super(key: key); | ||
|
||
final String networkName; | ||
final String message; | ||
final VoidCallback? onTap; | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final presenter = ref.read(openDAppPageContainer.actions); | ||
return Column( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 6), | ||
child: Column( | ||
children: [ | ||
titleItem(context), | ||
messageItem(context, presenter, message), | ||
], | ||
), | ||
), | ||
const SizedBox(height: 8), | ||
signButton(context), | ||
], | ||
); | ||
} | ||
|
||
Widget signButton(BuildContext context) { | ||
String titleText = 'sign'; | ||
AxsButtonType type = AxsButtonType.primary; | ||
|
||
return MxcButton.primary( | ||
key: const ValueKey('signButton'), | ||
size: AxsButtonSize.xl, | ||
title: FlutterI18n.translate(context, titleText), | ||
type: type, | ||
onTap: () { | ||
if (onTap != null) onTap!(); | ||
Navigator.of(context).pop(true); | ||
}, | ||
); | ||
} | ||
|
||
Widget titleItem(BuildContext context) { | ||
return Column( | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text( | ||
networkName, | ||
style: FontTheme.of(context).body2.secondary(), | ||
softWrap: true, | ||
), | ||
const SizedBox(height: 4), | ||
], | ||
) | ||
], | ||
); | ||
} | ||
|
||
Widget messageItem(BuildContext context, OpenDAppPresenter presenter, String message) { | ||
return SingleLineInfoItem(title: FlutterI18n.translate(context, 'message'), value: message); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
lib/features/dapps/subfeatures/open_dapp/widgets/sign_message_bottom_sheet.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mxc_ui/mxc_ui.dart'; | ||
|
||
import 'message_info.dart'; | ||
|
||
Future<bool?> showSignMessageDialog( | ||
BuildContext context, { | ||
String? title, | ||
required String networkName, | ||
required String message, | ||
VoidCallback? onTap, | ||
}) { | ||
return showModalBottomSheet<bool>( | ||
context: context, | ||
useRootNavigator: true, | ||
isScrollControlled: true, | ||
isDismissible: false, | ||
useSafeArea: true, | ||
backgroundColor: Colors.transparent, | ||
builder: (BuildContext context) => Container( | ||
padding: const EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 44), | ||
decoration: BoxDecoration( | ||
color: ColorsTheme.of(context).screenBackground, | ||
borderRadius: const BorderRadius.only( | ||
topLeft: Radius.circular(20), | ||
topRight: Radius.circular(20), | ||
), | ||
), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
MxcAppBarEvenly.title( | ||
titleText: title ?? '', | ||
action: Container( | ||
alignment: Alignment.centerRight, | ||
child: InkWell( | ||
child: const Icon(Icons.close), | ||
onTap: () => Navigator.of(context).pop(false), | ||
), | ||
), | ||
), | ||
MessageInfo( | ||
message: message, | ||
networkName: networkName, | ||
onTap: onTap, | ||
), | ||
const SizedBox(height: 10), | ||
], | ||
), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.