import 'package:flutter/material.dart';
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
final nameList = [
'Ram',
'Pukar',
'Hari',
'Rajesh',
'Kishna',
'Anil',
'Suresh',
'Ritesh',
'Laxmi'
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: Icon(Icons.menu),
title: Text('Over Lapping'),
centerTitle: true,
elevation: 0.0,
actions: [
IconButton(
icon: Icon(
Icons.search,
color: Colors.white,
),
onPressed: null,
),
IconButton(
icon: Icon(
Icons.notifications,
color: Colors.white,
),
onPressed: null,
),
],
),
body: ListView.builder(
itemCount: nameList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.only(bottom: 5.0),
color: Colors.pink[100],
child: Stack(
children: [
Container(
margin: EdgeInsets.only(top: 50.0),
height: 150.0,
// color: Colors.yellow,
decoration: BoxDecoration(
color: Colors.yellow,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15.0),
topRight: Radius.circular(15.0),
),
),
),
Positioned(
top: 10.0,
left: 180.0,
child: Container(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(index.toString()),
),
height: 80.0,
width: 80.0,
decoration: BoxDecoration(
color: Colors.blue,
border: Border.all(
color: Colors.white,
width: 1.0,
),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
),
),
),
Positioned(
top: 10.0,
left: 270.0,
child: Container(
height: 80.0,
width: 80.0,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
nameList[index],
style: TextStyle(
color: Colors.white,
),
),
),
decoration: BoxDecoration(
color: Colors.black,
border: Border.all(
color: Colors.white,
width: 1.0,
),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
),
),
),
],
),
);
},
),
);
}
}
Output:
0 comments:
Post a Comment