Skip to content

Instantly share code, notes, and snippets.

@rydmike
Created June 2, 2021 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rydmike/2ecb71880f215f7a76e041a2f7cc4fca to your computer and use it in GitHub Desktop.
Save rydmike/2ecb71880f215f7a76e041a2f7cc4fca to your computer and use it in GitHub Desktop.
Flutter: SelectableText has extra padding and does not align with Text
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'),
],
),
),
],
),
),
);
}
}
@rydmike
Copy link
Author

rydmike commented Jun 2, 2021

Sample code for DartPad demo https://www.dartpad.dev/2ecb71880f215f7a76e041a2f7cc4fca related to Flutter issue: flutter/flutter#83784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment