111 lines
3.8 KiB
Dart
111 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
List<String> assetImage = [
|
|
"lib/assets/image_3.jpg",
|
|
"lib/assets/image_4.jpg",
|
|
"lib/assets/image_5.jpg",
|
|
];
|
|
List<String> assetImage1 = [
|
|
"lib/assets/Moules Marinieres .jpg",
|
|
"lib/assets/Pain Brie.jpg",
|
|
"lib/assets/Provence tomato soup.jpg",
|
|
];
|
|
|
|
|
|
class DetialCover extends StatefulWidget {
|
|
const DetialCover({super.key});
|
|
|
|
@override
|
|
State<DetialCover> createState() => _DetialCoverState();
|
|
}
|
|
|
|
class _DetialCoverState extends State<DetialCover> {
|
|
late PageController controller;
|
|
int index = 1;
|
|
bool ischeck =false;
|
|
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
controller = PageController(initialPage: index, viewportFraction: 0.8);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return PageView.builder(
|
|
itemCount: 3,
|
|
scrollDirection: Axis.horizontal,
|
|
controller: controller,
|
|
|
|
onPageChanged: (newindex) {
|
|
index = newindex;
|
|
setState(() {
|
|
|
|
});
|
|
},
|
|
itemBuilder: (c, i) {
|
|
return Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16,vertical: 32),
|
|
child: PhysicalModel(color: Colors.white, elevation: 4, borderRadius: BorderRadius.circular(16),child:Container(
|
|
child:Stack(
|
|
children: [
|
|
Positioned(left: 0,right: 0,top: 0,bottom: 0,
|
|
child: Column(
|
|
children: [
|
|
ClipRRect(borderRadius: BorderRadius.circular(16),child: Image.asset(assetImage1[i],fit: BoxFit.cover,height: 300,width: double.infinity,)),
|
|
SizedBox(height: 60,),
|
|
Text("Alain ducasse",style: TextStyle(fontSize: 18,fontWeight: FontWeight.w500,color: Colors.orange),),
|
|
SizedBox(height: 30,),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: List.generate(5, (index) => Icon(index==4?Icons.star_border:Icons.star,color:index==4?Colors.grey:Colors.amber,size: 15,))..add(Text("4.0")),
|
|
),
|
|
SizedBox(height: 30,),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text("His grasp of detail is outstanding, and every dish he cooks is like a meticulously crafted work of art, making people feel his love and dedication to cooking during the tasting process."),
|
|
)
|
|
],
|
|
)),
|
|
Positioned(
|
|
top: 200,
|
|
left: 0,
|
|
right: 0,
|
|
child: Center(
|
|
child: ClipOval(child: Image.asset(assetImage[i],height: 150,width: 150,fit: BoxFit.cover,))
|
|
)
|
|
),
|
|
Positioned(
|
|
top: 268,
|
|
right: 16,
|
|
child: GestureDetector(
|
|
onTap: (){
|
|
setState(() {
|
|
ischeck = !ischeck;
|
|
});
|
|
},
|
|
child: Container(
|
|
height: 50,
|
|
width: 50,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
shape: BoxShape.circle,
|
|
boxShadow: [BoxShadow(color: Colors.black87)]
|
|
),
|
|
child: Image.asset(ischeck?'lib/assets/icon_55.png':"lib/assets/icon_54.png",height: 30,
|
|
width: 30,)
|
|
),
|
|
)
|
|
)
|
|
|
|
],
|
|
)
|
|
)),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|