-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push notifications showcase improvements
- Loading branch information
1 parent
e0029cf
commit 0b11dfa
Showing
14 changed files
with
182 additions
and
111 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
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
89 changes: 89 additions & 0 deletions
89
...cks/rx_bloc_base/__brick__/lib/feature_notifications/ui_components/push_token_widget.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,89 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:widget_toolkit/shimmer.dart'; | ||
import 'package:widget_toolkit/text_field_dialog.dart'; | ||
|
||
import '../../app_extensions.dart'; | ||
|
||
class PushTokenWidget extends StatelessWidget { | ||
const PushTokenWidget( | ||
{required this.label, this.value, this.error, super.key}); | ||
|
||
final String label; | ||
final String? value; | ||
final String? error; | ||
|
||
@override | ||
Widget build(BuildContext context) => InkWell( | ||
onTap: () { | ||
if (value != null) { | ||
Clipboard.setData(ClipboardData(text: value!)).then((_) { | ||
if (context.mounted) { | ||
ScaffoldMessenger.of(context).showSnackBar( | ||
SnackBar(content: Text(context.l10n.copiedToYourKeyboard))); | ||
} | ||
}); | ||
} | ||
}, | ||
customBorder: const CircleBorder(), | ||
child: Container( | ||
decoration: BoxDecoration( | ||
color: context.textFieldDialogTheme.editFieldRegularBackground, | ||
borderRadius: BorderRadius.circular( | ||
context.textFieldDialogTheme.editFieldBorderRadius, | ||
), | ||
), | ||
child: Padding( | ||
padding: EdgeInsets.symmetric( | ||
vertical: context.textFieldDialogTheme.spacingS, | ||
horizontal: context.textFieldDialogTheme.spacingM, | ||
), | ||
child: Row( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Expanded( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
label, | ||
style: context.textFieldDialogTheme.captionBold | ||
.copyWith( | ||
color: context.textFieldDialogTheme | ||
.editFieldLabelNotEditedColor), | ||
), | ||
SizedBox(height: context.textFieldDialogTheme.spacingXSS), | ||
ShimmerText( | ||
error ?? value, | ||
style: context.textFieldDialogTheme | ||
.editFieldTextNotEditedTextStyle | ||
.copyWith( | ||
color: error == null | ||
? context.textFieldDialogTheme | ||
.editFieldValueNotEditedColor | ||
: context.designSystem.colors.errorColor), | ||
) | ||
], | ||
), | ||
), | ||
Visibility( | ||
visible: value != null, | ||
replacement: SizedBox(), | ||
child: Padding( | ||
padding: EdgeInsets.only( | ||
left: context.textFieldDialogTheme.spacingS, | ||
top: context.textFieldDialogTheme.spacingXS, | ||
bottom: context.textFieldDialogTheme.spacingXS), | ||
child: Material( | ||
color: Colors.transparent, | ||
//.copyWith(color: _getValueColor(context)); | ||
child: Icon(context.designSystem.icons.copy), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} |
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
Oops, something went wrong.