Last active
June 9, 2021 15:10
-
-
Save anmolseth06/f80baa6da4953a02728a73e39fb791fc 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(MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Child(), | |
)); | |
} | |
class Child extends StatefulWidget { | |
@override | |
_ChildState createState() => _ChildState(); | |
} | |
class _ChildState extends State<Child> { | |
@override | |
Widget build(BuildContext context) { | |
var str = [ | |
"APPLE", | |
"BALL", | |
"CAT", | |
"DOG", | |
"EGG", | |
"FROG", | |
"GOAT", | |
"HEN", | |
"ICECREAM", | |
"JUG", | |
"KITE", | |
"LION", | |
"MANGO", | |
"NEST", | |
"ORANGE", | |
"PEACOCK", | |
"QUEEN", | |
"ROSE", | |
"SWAN", | |
"TELEPHONE", | |
"UMBRELLA", | |
"VAN", | |
"WATCH", | |
"XYLOPHONE", | |
"YACHT", | |
"ZEBRA", | |
]; | |
var images = [ | |
"https://cdn.pixabay.com/photo/2018/02/08/13/10/apple-3139465_960_720.jpg", | |
"https://zdnet4.cbsistatic.com/hub/i/r/2019/08/12/3a9d258e-c6f3-4abb-a0bf-e8945a564311/resize/1200x675/7c43bee4c2b7a7c507a7331f168a3e5d/kookaburra-smart-cricket-ball.jpg", | |
"https://allthatsinteresting.com/wordpress/wp-content/uploads/2019/09/garlic-the-chinese-clone-cat.jpg", | |
"https://www.medicalnewstoday.com/content/images/articles/326/326253/corgi-and-terrier-running.jpg", | |
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTWvsrv8bkUTZG6hA0l-p3ufj_nLdV9tv9xs-PTNd48ukzC2dzS8A", | |
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQmIcUhahjLbSt3ObWpAibJDic0FSyPzeX0eCkYvAGqZJR-tCnr", | |
"https://upload.wikimedia.org/wikipedia/commons/b/b2/Hausziege_04.jpg", | |
"https://www.britishironworkcentre.co.uk/media/catalog/product/cache/1/image/700x700/9df78eab33525d08d6e5fb8d27136e95/u/k/hetty_the_hen_rupert_the_rooster_hand_painted_chicken_sculptures.jpg", | |
"https://lovingitvegan.com/wp-content/uploads/2016/09/Vegan-Chocolate-Ice-Cream-13.jpg", | |
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ8zLmhCfLeyNbOuiTyIEbG9Nf1R5Bg6R_j-r8DqHyqwRrSNnq3", | |
"https://images-na.ssl-images-amazon.com/images/I/31pHVKAQOOL.jpg", | |
"https://upload.wikimedia.org/wikipedia/commons/7/73/Lion_waiting_in_Namibia.jpg", | |
"https://i1.wp.com/www.whoneedssalad.com/wp-content/uploads/2018/07/mangoes.jpg?resize=1080%2C1616&ssl=1", | |
"http://www.birdsandblooms.com/wp-content/uploads/2017/05/pexabay_nest.jpg", | |
"https://upload.wikimedia.org/wikipedia/commons/4/43/Ambersweet_oranges.jpg", | |
"https://www.pitara.com/wordpress/wp-content/uploads/2000/09/exotic-peacock.jpg", | |
"https://peopledotcom.files.wordpress.com/2016/08/queen-elizabeth-c-435-3.jpg", | |
"https://i.pinimg.com/originals/8a/1a/8d/8a1a8d5111189b144dd3591841f84409.jpg", | |
"https://images.fineartamerica.com/images-medium-large-5/swam-kimberley-anglesey.jpg", | |
"https://images.assettype.com/thequint%2F2015-05%2Fb960a0cf-eb84-43d1-93c0-67cf7c769261%2FiStock_000064980767_Small.jpg?q=35&auto=format%2Ccompress&w=1200", | |
"https://images.unsplash.com/photo-1532135468830-e51699205b70?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80", | |
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQmrd5BlRIs2rjDAROM87N4t2MjtvXPDDLZmrc3owh16AOPXVnA", | |
"https://cdn1.ethoswatches.com/the-watch-guide/wp-content/uploads/2018/10/Ethos-Watch-Awards-25-Best-Luxury-Mens-Watches-2018-Rolex-Omega-Rado-TAG-Heuer-Breitling-mens-mobile-masthead-lifestyle-optimised.jpg", | |
"https://previews.123rf.com/images/djmilic/djmilic1506/djmilic150600243/41125671-xylophone-with-rainbow-colored-keys-and-with-two-wood-drum-sticks-3d-render-isolated-on-white-backgr.jpg", | |
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSCUccF316xfYC_UPtCGXxdhH_c8NYhTPT-XjGD4DBBUu-GQh-S", | |
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRe2BWrlb4hEzjAlK28Hp2h7sOs0iy9-X9pzr7uR2Ds8uBnIu3S", | |
]; | |
return Scaffold( | |
appBar: AppBar( | |
backgroundColor: Colors.red, | |
title: Text("ALPHABETS"), | |
), | |
body: ListView.builder( | |
itemCount: str.length, | |
itemBuilder: (context, index) { | |
return Container( | |
decoration: new BoxDecoration( | |
gradient: LinearGradient( | |
begin: Alignment.topRight, | |
end: Alignment.bottomLeft, | |
colors: [Colors.greenAccent, Colors.white], | |
), | |
boxShadow: [ | |
new BoxShadow( | |
color: Colors.black26, | |
blurRadius: 8.0, | |
), | |
]), | |
margin: EdgeInsets.only(left: 16, right: 16, top: 10), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: <Widget>[ | |
Padding( | |
padding: const EdgeInsets.all(20.0), | |
child: Column( | |
children: <Widget>[ | |
Text( | |
str[index].substring(0, 1), | |
style: TextStyle( | |
fontSize: 120, fontWeight: FontWeight.bold), | |
), | |
Text(str[index]), | |
], | |
), | |
), | |
Container( | |
padding: EdgeInsets.all(10), | |
height: 200, | |
width: 200, | |
child: ClipRRect( | |
borderRadius: BorderRadius.circular(20.0), | |
child: Image.network( | |
images[index], | |
fit: BoxFit.cover, | |
), | |
)), | |
], | |
), | |
); | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment