diff --git a/lib/src/widgets/seedphrase_grid_widget.dart b/lib/src/widgets/seedphrase_grid_widget.dart index fb6c62d32..df8535f57 100644 --- a/lib/src/widgets/seedphrase_grid_widget.dart +++ b/lib/src/widgets/seedphrase_grid_widget.dart @@ -8,13 +8,27 @@ class SeedPhraseGridWidget extends StatelessWidget { final List list; + + @override Widget build(BuildContext context) { + + double desiredTileWidth = 120; + double spacing = 4; + double padding = 4; + double screenWidth = MediaQuery.of(context).size.width; + + int crossAxisCount = + ((screenWidth + spacing - (2 * padding)) / (desiredTileWidth + spacing)) + .floor(); + + if (crossAxisCount < 1) crossAxisCount = 1; + return GridView.builder( itemCount: list.length, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - childAspectRatio: 2.8, + crossAxisCount: crossAxisCount, + childAspectRatio: 2.6, mainAxisSpacing: 8.0, crossAxisSpacing: 8.0, ), @@ -41,6 +55,8 @@ class SeedPhraseGridWidget extends StatelessWidget { fontWeight: FontWeight.w700, color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5), ), + softWrap: true, + maxLines: null, ), ), const SizedBox(width: 6), @@ -48,7 +64,7 @@ class SeedPhraseGridWidget extends StatelessWidget { child: Text( '${item[0].toLowerCase()}${item.substring(1)}', style: Theme.of(context).textTheme.bodyMedium?.copyWith( - height: 1.9, + height: 1, fontWeight: FontWeight.w700, color: Theme.of(context).colorScheme.onSurface, ),