Created
January 4, 2023 17:40
-
-
Save felipecastrosales/d28b8320f41001949bb0607f8429f9b8 to your computer and use it in GitHub Desktop.
column_row_center.dart
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(const Alinhamento()); | |
} | |
class Alinhamento extends StatelessWidget { | |
const Alinhamento({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp(home: Scaffold( | |
appBar: AppBar( | |
title: const Text('Teste'), | |
), | |
body: Align( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const [ | |
MeuItem(texto: 'texto'), | |
MeuItem(texto: 'texto texto texto texto texto texto '), | |
MeuItem(texto: 'textotexto textotexto '), | |
MeuItem(texto: 'texto'), | |
MeuItem(texto: 'texto'), | |
], | |
), | |
),), | |
); | |
} | |
} | |
class MeuItem extends StatelessWidget { | |
const MeuItem({ | |
super.key, | |
required this.texto, | |
}); | |
final String texto; | |
@override | |
Widget build(BuildContext context) { | |
return SizedBox( | |
height: 30, | |
child: Row( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
const Icon( | |
Icons.check, | |
), | |
const SizedBox(width: 18), | |
Text( | |
texto, | |
overflow: TextOverflow.ellipsis, | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment