Align text vertically flutter
525
Just set crossAxisAlignment
to start
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Project Name",
style: TextStyle(
fontSize: 36,
color: Colors.white,
fontWeight: FontWeight.w600,
),
),
Author by
Gustav
Updated on January 04, 2023Comments
-
Gustav over 1 year
I think the best way to explain my issue is with images, so this is what I want to achieve, dont mind the styling of either image.
But when I try to implement it myself, the bottom text gets indented.
Here are my code. Note I am new to flutter, so tips are also appreciated.
SizedBox( width: 580, height: 95, child: Material( color: panelBackground, borderRadius: BorderRadius.circular(5), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 25), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( children: [ const Text( "Project Name", style: TextStyle( fontSize: 36, color: Colors.white, fontWeight: FontWeight.bold, ), ), const SizedBox(height: 5), RichText( text: const TextSpan( text: "Made by: ", style: TextStyle( fontSize: 14, color: Color(0xFF838383), ), children: [ TextSpan( text: '/', style: TextStyle( color: Colors.amber, fontWeight: FontWeight.bold)), TextSpan( text: '6u5t4v', style: TextStyle( color: Colors.amberAccent, letterSpacing: 2, fontWeight: FontWeight.bold, fontStyle: FontStyle.italic)) ])), ], ), Column( children: [Text("rating here")], ), const SidebarIcon( icon: Icon(Icons.save), ) ], ), ), ), ),