Skip to content

Instantly share code, notes, and snippets.

@felipecastrosales
Created January 4, 2023 17:40
Show Gist options
  • Save felipecastrosales/d28b8320f41001949bb0607f8429f9b8 to your computer and use it in GitHub Desktop.
Save felipecastrosales/d28b8320f41001949bb0607f8429f9b8 to your computer and use it in GitHub Desktop.
column_row_center.dart
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