business details offer slide finished

This commit is contained in:
vignesh 2022-05-22 00:13:07 +05:30
parent 4741190db6
commit 88ba07bf5a

View File

@ -1,6 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_switch/flutter_switch.dart'; import 'package:flutter_switch/flutter_switch.dart';
class PageViewModel {
String title;
String body;
String image;
PageViewModel({required this.title, required this.body, required this.image});
}
class businessdetail extends StatefulWidget { class businessdetail extends StatefulWidget {
const businessdetail({Key? key}) : super(key: key); const businessdetail({Key? key}) : super(key: key);
@ -10,6 +18,26 @@ class businessdetail extends StatefulWidget {
class _businessdetailState extends State<businessdetail> { class _businessdetailState extends State<businessdetail> {
bool status = true; bool status = true;
int pageIndex = 0;
PageController pageController = PageController();
final List<PageViewModel> pages = [
PageViewModel(
title: '',
body: 'Best Hotels and Restaurants around you...',
image: 'assets/images/onboarding_image_1.png',
),
PageViewModel(
title: '',
body: 'Best Medicals, Clinics and Hospitals around you...',
image: 'assets/images/onboarding_image_2.png',
),
PageViewModel(
title: '',
body: 'Best Grocery and all Other Shops around you...',
image: "assets/images/onboarding_image_3.png",
)
];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -88,8 +116,8 @@ class _businessdetailState extends State<businessdetail> {
alignment: Alignment.center, alignment: Alignment.center,
child: Container( child: Container(
margin: EdgeInsets.only(right: 20, left: 20, top: 60), margin: EdgeInsets.only(right: 20, left: 20, top: 60),
padding: EdgeInsets.all(15), padding: EdgeInsets.all(12),
height: 300, height: 270,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -241,7 +269,7 @@ class _businessdetailState extends State<businessdetail> {
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 13, fontSize: 12,
color: Color(0xFF5C5C5C), color: Color(0xFF5C5C5C),
), ),
), ),
@ -270,7 +298,7 @@ class _businessdetailState extends State<businessdetail> {
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 13, fontSize: 12,
color: Color(0xFF5C5C5C), color: Color(0xFF5C5C5C),
), ),
), ),
@ -296,7 +324,7 @@ class _businessdetailState extends State<businessdetail> {
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 13, fontSize: 12,
color: Color(0xFF5C5C5C), color: Color(0xFF5C5C5C),
), ),
), ),
@ -323,7 +351,7 @@ class _businessdetailState extends State<businessdetail> {
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 13, fontSize: 12,
color: Color(0xFF5C5C5C), color: Color(0xFF5C5C5C),
), ),
), ),
@ -349,7 +377,7 @@ class _businessdetailState extends State<businessdetail> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(left: 22), padding: const EdgeInsets.only(left: 22, right: 10),
child: InkWell( child: InkWell(
onTap: () {}, onTap: () {},
child: Container( child: Container(
@ -399,6 +427,7 @@ class _businessdetailState extends State<businessdetail> {
), ),
), ),
), ),
Spacer(),
Padding( Padding(
padding: const EdgeInsets.only(left: 22), padding: const EdgeInsets.only(left: 22),
child: InkWell( child: InkWell(
@ -453,6 +482,75 @@ class _businessdetailState extends State<businessdetail> {
], ],
), ),
), ),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
for (int i = 0; i < pages.length; i++)
Container(
height: 8,
width: (pageIndex == i) ? 20 : 8,
margin: EdgeInsets.only(right: 8),
decoration: BoxDecoration(
color: (pageIndex == i)
? Colors.green
: Colors.green.shade100,
borderRadius: BorderRadius.circular(8)),
),
],
),
Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 24),
child: Text(
'Photos',
style: TextStyle(
fontSize: 16,
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
),
),
),
Spacer(),
Padding(
padding: const EdgeInsets.only(right: 10),
child: IconButton(
icon: Icon(
Icons.arrow_forward,
size: 25,
color: Color(0xFF5C5C5C),
),
onPressed: () {},
),
),
],
),
Spacer(),
Container(
height: 50,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
Container(
width: 150,
decoration: BoxDecoration(
image: const DecorationImage(
alignment: Alignment.centerLeft,
image: AssetImage(
'assets/images/offer.png',
),
scale: 2,
),
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
),
],
),
),
], ],
), ),
); );