Created
May 17, 2021 08:32
-
-
Save Divyosmi/82666eb357f7b558b6c12903512e56fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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) { | |
| // #docregion titleSection | |
| Widget titleSection = Container( | |
| padding: const EdgeInsets.all(32), | |
| child: Row( | |
| children: [ | |
| Expanded( | |
| /*1*/ | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| /*2*/ | |
| Container( | |
| padding: const EdgeInsets.only(bottom: 8), | |
| child: Text( | |
| 'Oeschinen Lake Campground', | |
| style: TextStyle( | |
| fontWeight: FontWeight.bold, | |
| ), | |
| ), | |
| ), | |
| Text( | |
| 'Kandersteg, Switzerland', | |
| style: TextStyle( | |
| color: Colors.grey[500], | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| /*3*/ | |
| Icon( | |
| Icons.star, | |
| color: Colors.red[500], | |
| ), | |
| Text('41'), | |
| ], | |
| ), | |
| ); | |
| // #enddocregion titleSection | |
| return MaterialApp( | |
| title: 'Flutter layout demo', | |
| home: Scaffold( | |
| appBar: AppBar( | |
| title: Text('Flutter layout demo'), | |
| ), | |
| body: Column( | |
| children: [ | |
| titleSection, | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment