What changed, and why it matters
This commit is purely a code-formatting cleanup in a single Dart file that builds the QR-code generation screen. It rewraps long lines, adjusts indentation, and replaces a deprecated SVG color property with a newer colorFilter property. No security-sensitive logic, permissions, or data handling changed.
No security action needed; treat as routine formatting/maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart is stylistic: line breaks in strings and comments, indentation changes, and migration from SvgPicture’s color parameter to colorFilter: ColorFilter.mode(..., BlendMode.srcIn). Functional behavior of QR generation, file saving, and sharing remains identical. No new dependencies, inputs, or outputs are introduced.
Changed components
lib/pages/receive_view/generate_receiving_uri_qr_code_view.dartInspect captured patch +184 / −206
diff --git a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart
index d485cfa..8b81c59 100644
--- a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart
+++ b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart
@@ -90,7 +90,8 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
final dir = Directory("${Platform.environment['HOME']}");
if (!dir.existsSync()) {
throw Exception(
- "Home dir not found while trying to open filepicker on QR image save",
+ "Home dir not found while trying to open filepicker on QR image"
+ " save",
);
}
final path = await FilePicker.platform.saveFile(
@@ -122,10 +123,13 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
}
}
} else {
- // await DocumentFileSavePlus.saveFile(
- // pngBytes,
- // "receive_qr_code_${DateTime.now().toLocal().toIso8601String()}.png",
- // "image/png");
+ // await DocumentFileSavePlus.saveFile(
+ // pngBytes,
+ // "receive_qr_code_"
+ // "${DateTime.now().toLocal().toIso8601String()}"
+ // ".png",
+ // "image/png",
+ // );
}
} else {
final tempDir = await getTemporaryDirectory();
@@ -237,10 +241,12 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
Assets.svg.share,
width: 14,
height: 14,
- color:
- Theme.of(
- context,
- ).extension<StackColors>()!.buttonTextSecondary,
+ colorFilter: .mode(
+ Theme.of(
+ context,
+ ).extension<StackColors>()!.buttonTextSecondary,
+ .srcIn,
+ ),
),
onPressed: () async {
await _capturePng(false);
@@ -293,68 +299,56 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
return ConditionalParent(
condition: !isDesktop,
- builder:
- (child) => Background(
- child: Scaffold(
- backgroundColor:
- Theme.of(context).extension<StackColors>()!.background,
- appBar: AppBar(
- leading: AppBarBackButton(
- onPressed: () async {
- if (FocusScope.of(context).hasFocus) {
- FocusScope.of(context).unfocus();
- await Future<void>.delayed(
- const Duration(milliseconds: 70),
- );
- }
- if (context.mounted) {
- Navigator.of(context).pop();
- }
- },
- ),
- title: Text(
- "Generate QR code",
- style: STextStyles.navBarTitle(context),
- ),
- ),
- body: SafeArea(
- child: LayoutBuilder(
- builder: (buildContext, constraints) {
- return Padding(
- padding: const EdgeInsets.only(
- left: 12,
- top: 12,
- right: 12,
+ builder: (child) => Background(
+ child: Scaffold(
+ backgroundColor: Theme.of(
+ context,
+ ).extension<StackColors>()!.background,
+ appBar: AppBar(
+ leading: AppBarBackButton(
+ onPressed: () async {
+ if (FocusScope.of(context).hasFocus) {
+ FocusScope.of(context).unfocus();
+ await Future<void>.delayed(const Duration(milliseconds: 70));
+ }
+ if (context.mounted) {
+ Navigator.of(context).pop();
+ }
+ },
+ ),
+ title: Text(
+ "Generate QR code",
+ style: STextStyles.navBarTitle(context),
+ ),
+ ),
+ body: SafeArea(
+ child: LayoutBuilder(
+ builder: (buildContext, constraints) {
+ return Padding(
+ padding: const EdgeInsets.only(left: 12, top: 12, right: 12),
+ child: SingleChildScrollView(
+ child: ConstrainedBox(
+ constraints: BoxConstraints(
+ minHeight: constraints.maxHeight - 24,
),
- child: SingleChildScrollView(
- child: ConstrainedBox(
- constraints: BoxConstraints(
- minHeight: constraints.maxHeight - 24,
- ),
- child: IntrinsicHeight(
- child: Padding(
- padding: const EdgeInsets.all(4),
- child: child,
- ),
- ),
+ child: IntrinsicHeight(
+ child: Padding(
+ padding: const EdgeInsets.all(4),
+ child: child,
),
),
- );
- },
- ),
- ),
+ ),
+ ),
+ );
+ },
),
),
+ ),
+ ),
child: Padding(
- padding:
- isDesktop
- ? const EdgeInsets.only(
- top: 12,
- left: 32,
- right: 32,
- bottom: 32,
- )
- : const EdgeInsets.all(0),
+ padding: isDesktop
+ ? const EdgeInsets.only(top: 12, left: 32, right: 32, bottom: 32)
+ : const EdgeInsets.all(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: isDesktop ? MainAxisSize.min : MainAxisSize.max,
@@ -369,17 +363,13 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
if (!isDesktop) const SizedBox(height: 12),
Text(
"Amount (Optional)",
- style:
- isDesktop
- ? STextStyles.desktopTextExtraExtraSmall(
- context,
- ).copyWith(
- color:
- Theme.of(context)
- .extension<StackColors>()!
- .textFieldActiveSearchIconRight,
- )
- : STextStyles.smallMed12(context),
+ style: isDesktop
+ ? STextStyles.desktopTextExtraExtraSmall(context).copyWith(
+ color: Theme.of(context)
+ .extension<StackColors>()!
+ .textFieldActiveSearchIconRight,
+ )
+ : STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
SizedBox(height: isDesktop ? 10 : 8),
@@ -392,74 +382,64 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
enableSuggestions: Util.isDesktop ? false : true,
controller: amountController,
focusNode: _amountFocusNode,
- style:
- isDesktop
- ? STextStyles.desktopTextExtraExtraSmall(
+ style: isDesktop
+ ? STextStyles.desktopTextExtraExtraSmall(context).copyWith(
+ color: Theme.of(
context,
- ).copyWith(
- color:
- Theme.of(
- context,
- ).extension<StackColors>()!.textFieldDefaultText,
- height: 1.8,
- )
- : STextStyles.field(context),
- keyboardType:
- Util.isDesktop
- ? null
- : const TextInputType.numberWithOptions(decimal: true),
+ ).extension<StackColors>()!.textFieldDefaultText,
+ height: 1.8,
+ )
+ : STextStyles.field(context),
+ keyboardType: Util.isDesktop
+ ? null
+ : const TextInputType.numberWithOptions(decimal: true),
onChanged: (_) => setState(() {}),
- decoration: standardInputDecoration(
- "Amount",
- _amountFocusNode,
- context,
- ).copyWith(
- contentPadding:
- isDesktop
+ decoration:
+ standardInputDecoration(
+ "Amount",
+ _amountFocusNode,
+ context,
+ ).copyWith(
+ contentPadding: isDesktop
? const EdgeInsets.only(
- left: 16,
- top: 11,
- bottom: 12,
- right: 5,
- )
+ left: 16,
+ top: 11,
+ bottom: 12,
+ right: 5,
+ )
: null,
- suffixIcon:
- amountController.text.isNotEmpty
+ suffixIcon: amountController.text.isNotEmpty
? Padding(
- padding: const EdgeInsets.only(right: 0),
- child: UnconstrainedBox(
- child: Row(
- children: [
- TextFieldIconButton(
- child: const XIcon(),
- onTap: () async {
- setState(() {
- amountController.text = "";
- });
- },
- ),
- ],
+ padding: const EdgeInsets.only(right: 0),
+ child: UnconstrainedBox(
+ child: Row(
+ children: [
+ TextFieldIconButton(
+ child: const XIcon(),
+ onTap: () async {
+ setState(() {
+ amountController.text = "";
+ });
+ },
+ ),
+ ],
+ ),
),
- ),
- )
+ )
: null,
- ),
+ ),
),
),
SizedBox(height: isDesktop ? 20 : 12),
Text(
"Note (Optional)",
- style:
- isDesktop
- ? STextStyles.desktopTextExtraExtraSmall(
- context,
- ).copyWith(
- color:
- Theme.of(context)
- .extension<StackColors>()!
- .textFieldActiveSearchIconRight,
- )
- : STextStyles.smallMed12(context),
+ style: isDesktop
+ ? STextStyles.desktopTextExtraExtraSmall(context).copyWith(
+ color: Theme.of(context)
+ .extension<StackColors>()!
+ .textFieldActiveSearchIconRight,
+ )
+ : STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
SizedBox(height: isDesktop ? 10 : 8),
@@ -472,73 +452,67 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
enableSuggestions: Util.isDesktop ? false : true,
controller: noteController,
focusNode: _noteFocusNode,
- style:
- isDesktop
- ? STextStyles.desktopTextExtraExtraSmall(
+ style: isDesktop
+ ? STextStyles.desktopTextExtraExtraSmall(context).copyWith(
+ color: Theme.of(
context,
- ).copyWith(
- color:
- Theme.of(
- context,
- ).extension<StackColors>()!.textFieldDefaultText,
- height: 1.8,
- )
- : STextStyles.field(context),
+ ).extension<StackColors>()!.textFieldDefaultText,
+ height: 1.8,
+ )
+ : STextStyles.field(context),
onChanged: (_) => setState(() {}),
- decoration: standardInputDecoration(
- "Note",
- _noteFocusNode,
- context,
- ).copyWith(
- contentPadding:
- isDesktop
+ decoration:
+ standardInputDecoration(
+ "Note",
+ _noteFocusNode,
+ context,
+ ).copyWith(
+ contentPadding: isDesktop
? const EdgeInsets.only(
- left: 16,
- top: 11,
- bottom: 12,
- right: 5,
- )
+ left: 16,
+ top: 11,
+ bottom: 12,
+ right: 5,
+ )
: null,
- suffixIcon:
- noteController.text.isNotEmpty
+ suffixIcon: noteController.text.isNotEmpty
? Padding(
- padding: const EdgeInsets.only(right: 0),
- child: UnconstrainedBox(
- child: Row(
- children: [
- TextFieldIconButton(
- child: const XIcon(),
- onTap: () async {
- setState(() {
- noteController.text = "";
- });
- },
- ),
- ],
+ padding: const EdgeInsets.only(right: 0),
+ child: UnconstrainedBox(
+ child: Row(
+ children: [
+ TextFieldIconButton(
+ child: const XIcon(),
+ onTap: () async {
+ setState(() {
+ noteController.text = "";
+ });
+ },
+ ),
+ ],
+ ),
),
- ),
- )
+ )
: null,
- ),
+ ),
),
),
SizedBox(height: isDesktop ? 20 : 8),
PrimaryButton(
label: "Generate QR code",
- onPressed:
- isDesktop
- ? () {
- final uriString = _generateURI();
- if (uriString == null) {
- return;
- }
-
- setState(() {
- didGenerate = true;
- _uriString = uriString;
- });
+ onPressed: isDesktop
+ ? () {
+ final uriString = _generateURI();
+ if (uriString == null) {
+ return;
}
- : onGeneratePressed,
+
+ setState(() {
+ didGenerate = true;
+ _uriString = uriString;
+ });
+ }
+ : onGeneratePressed,
buttonHeight: isDesktop ? ButtonHeight.l : null,
),
if (isDesktop && didGenerate)
@@ -551,10 +525,9 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
children: [
const SizedBox(height: 20),
RoundedWhiteContainer(
- borderColor:
- Theme.of(
- context,
- ).extension<StackColors>()!.background,
+ borderColor: Theme.of(
+ context,
+ ).extension<StackColors>()!.background,
width: isDesktop ? 370 : null,
child: Column(
children: [
@@ -575,16 +548,16 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
),
const SizedBox(height: 12),
Row(
- mainAxisAlignment:
- isDesktop
- ? MainAxisAlignment.center
- : MainAxisAlignment.start,
+ mainAxisAlignment: isDesktop
+ ? MainAxisAlignment.center
+ : MainAxisAlignment.start,
children: [
if (!isDesktop)
SecondaryButton(
width: 170,
- buttonHeight:
- isDesktop ? ButtonHeight.l : null,
+ buttonHeight: isDesktop
+ ? ButtonHeight.l
+ : null,
onPressed: () async {
await _capturePng(false);
},
@@ -593,17 +566,20 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
Assets.svg.share,
width: 20,
height: 20,
- color:
- Theme.of(context)
- .extension<StackColors>()!
- .buttonTextSecondary,
+ colorFilter: .mode(
+ Theme.of(context)
+ .extension<StackColors>()!
+ .buttonTextSecondary,
+ .srcIn,
+ ),
),
),
if (!isDesktop) const SizedBox(width: 16),
PrimaryButton(
width: 170,
- buttonHeight:
- isDesktop ? ButtonHeight.l : null,
+ buttonHeight: isDesktop
+ ? ButtonHeight.l
+ : null,
onPressed: () async {
// TODO: add save functionality instead of share
// save works on linux at the moment
@@ -614,10 +590,12 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
Assets.svg.arrowDown,
width: 20,
height: 20,
- color:
- Theme.of(context)
- .extension<StackColors>()!
- .buttonTextPrimary,
+ colorFilter: .mode(
+ Theme.of(context)
+ .extension<StackColors>()!
+ .buttonTextPrimary,
+ .srcIn,
+ ),
),
),
],
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.