Skip to content

Instantly share code, notes, and snippets.

@Divyosmi
Created May 17, 2021 08:32
Show Gist options
  • Select an option

  • Save Divyosmi/82666eb357f7b558b6c12903512e56fd to your computer and use it in GitHub Desktop.

Select an option

Save Divyosmi/82666eb357f7b558b6c12903512e56fd to your computer and use it in GitHub Desktop.
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