diff --git a/lib/ui/code_widget.dart b/lib/ui/code_widget.dart index 7c8617aa9..29cfe0005 100644 --- a/lib/ui/code_widget.dart +++ b/lib/ui/code_widget.dart @@ -206,7 +206,7 @@ class _CodeWidgetState extends State { return Material( type: MaterialType.transparency, child: Text( - value, + _getFormattedCode(value), style: const TextStyle(fontSize: 24), ), ); @@ -231,7 +231,7 @@ class _CodeWidgetState extends State { return Material( type: MaterialType.transparency, child: Text( - value, + _getFormattedCode(value), style: const TextStyle( fontSize: 18, color: Colors.grey, @@ -409,4 +409,11 @@ class _CodeWidgetState extends State { return context.l10n.error; } } + + String _getFormattedCode(String code) { + if (code.length == 6) { + return code.substring(0, 3) + " " + code.substring(3, 6); + } + return code; + } }