Created
June 2, 2021 02:48
-
-
Save rydmike/2ecb71880f215f7a76e041a2f7cc4fca to your computer and use it in GitHub Desktop.
Flutter: SelectableText has extra padding and does not align with Text
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Row( | |
children: [ | |
Expanded( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.end, | |
children: [ | |
SizedBox(height: 30), | |
Text('0123456789', textAlign: TextAlign.end), | |
SelectableText('0123456789', textAlign: TextAlign.end), | |
Text('0123456789', textAlign: TextAlign.end), | |
SizedBox(height: 30), | |
Text('0123456789'), | |
SelectableText('0123456789'), | |
Text('0123456789'), | |
], | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample code for DartPad demo https://www.dartpad.dev/2ecb71880f215f7a76e041a2f7cc4fca related to Flutter issue: flutter/flutter#83784