Skip to content

Instantly share code, notes, and snippets.

@Sameerkash
Created May 5, 2021 09:42
Show Gist options
  • Save Sameerkash/24b8652405c0a6110607121603806de3 to your computer and use it in GitHub Desktop.
Save Sameerkash/24b8652405c0a6110607121603806de3 to your computer and use it in GitHub Desktop.
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
final String imageLink =
'https://www.adorama.com/alc/wp-content/uploads/2018/11/landscape-photography-tips-yosemite-valley-feature.jpg';
String text = '''
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
''';
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Image.network(imageLink, height: 300, width: 500),
Padding(
padding: EdgeInsets.all(10),
child: ListTile(
title: Text("Some Garden Cherry",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 21)),
subtitle: Text("Kandersteg, Switzerland",
style: TextStyle(fontSize: 18)),
trailing:
Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.star, color: Colors.red),
SizedBox(
width: 5,
),
Text("41"),
],
),
),
),
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
IconText("Call", Icons.call),
IconText("Route", Icons.navigation),
IconText("Share", Icons.share),
],
),
SizedBox(
height: 50,
),
Padding(padding: EdgeInsets.all(20), child: Text(text))
],
),
);
}
}
class IconText extends StatelessWidget {
final String text;
final IconData icon;
IconText(this.text, this.icon);
@override
Widget build(BuildContext context) {
return Column(
children: [
Icon(icon),
SizedBox(height: 10),
Text(text),
],
);
}
}
@Sameerkash
Copy link
Author

Sameerkash commented May 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment