business home switch button updated

This commit is contained in:
vignesh 2022-05-17 23:28:13 +05:30
parent 3299bc4217
commit b15062c31a
2 changed files with 302 additions and 288 deletions

View File

@ -323,7 +323,7 @@ class _addbusinessState extends State<addbusiness> {
), ),
), ),
SizedBox( SizedBox(
height: 50, height: 33,
), ),
MaterialButton( MaterialButton(
height: 50, height: 50,

View File

@ -12,10 +12,9 @@ class businesshome extends StatefulWidget {
} }
class _businesshomeState extends State<businesshome> { class _businesshomeState extends State<businesshome> {
bool status = false; bool status = true;
bool status1 = false; bool status1 = true;
bool status2 = false; bool status2 = true;
Color _imageColor = Color.fromRGBO(2989, 5870, 1140, 1);
int _selectedIndex = 0; int _selectedIndex = 0;
static const TextStyle optionStyle = TextStyle( static const TextStyle optionStyle = TextStyle(
@ -244,7 +243,7 @@ class _businesshomeState extends State<businesshome> {
child: InkWell( child: InkWell(
onTap: () {}, onTap: () {},
child: Container( child: Container(
width: 330, width: 350,
margin: EdgeInsets.only(right: 10), margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
image: const DecorationImage( image: const DecorationImage(
@ -348,7 +347,7 @@ class _businesshomeState extends State<businesshome> {
], ],
), ),
Container( Container(
height: 420, height: 400,
child: ListView( child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
children: [ children: [
@ -360,373 +359,388 @@ class _businesshomeState extends State<businesshome> {
MaterialPageRoute(builder: (_) => businessdetail())); MaterialPageRoute(builder: (_) => businessdetail()));
}, },
child: Container( child: Container(
width: 170, height: 180,
height: 200,
margin: EdgeInsets.only(right: 15), margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
image: const DecorationImage( borderRadius: BorderRadius.all(Radius.circular(5)),
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
color: _imageColor,
borderRadius: BorderRadius.all(
Radius.circular(5),
),
), ),
child: Column( foregroundDecoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.start, color: status ? null : Colors.grey,
mainAxisAlignment: MainAxisAlignment.center, backgroundBlendMode:
status ? null : BlendMode.saturation,
),
child: Stack(
children: [ children: [
Row( Image.asset(
'assets/images/bg.png',
height: 250,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 15, left: 15, right: 10, top: 75),
top: 100, child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(),
child: RichText(
text: TextSpan(
text: "Barbeque Nation ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
children: [
TextSpan(
text: "42 ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFFFFBE3F),
),
),
WidgetSpan(
child: Icon(
Icons.star,
color: Color(0xFFFFBE3F),
size: 18,
),
),
],
),
),
),
Spacer(),
FlutterSwitch(
width: 105,
height: 40,
valueFontSize: 15,
toggleSize: 25,
value: status,
borderRadius: 30.0,
padding: 8.0,
showOnOff: true,
onToggle: (val) {
setState(() {
status = val;
});
},
activeText: "OPEN",
activeTextColor: Colors.white,
activeTextFontWeight: FontWeight.w600,
activeColor: Color(0xFF09CD99),
inactiveText: "CLOSED",
inactiveTextColor: Colors.white,
inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C),
),
],
),
),
Padding(
padding: const EdgeInsets.only(
left: 10,
), ),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: "Barbeque Nation ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
children: [ children: [
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan( TextSpan(
text: "42 ", text: "Town Hall, Coimbatore",
style: TextStyle( style: TextStyle(
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 14,
color: Color(0xFFFFBE3F), color: Colors.white,
),
),
WidgetSpan(
child: Icon(
Icons.star,
color: Color(0xFFFFBE3F),
size: 18,
), ),
), ),
], ],
), ),
), ),
), ),
Spacer(),
Padding(
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105,
height: 40,
valueFontSize: 15,
toggleSize: 25,
value: status,
borderRadius: 30.0,
padding: 8.0,
showOnOff: true,
onToggle: (val) {
setState(() {
status = val;
if (val) {
_imageColor =
Color.fromRGBO(22, 27, 34, 1);
} else {
_imageColor =
Color.fromRGBO(36, 41, 46, 1);
}
});
},
activeText: "OPEN",
activeTextColor: Colors.white,
activeTextFontWeight: FontWeight.w600,
activeColor: Color(0xFF09CD99),
inactiveText: "CLOSED",
inactiveTextColor: Colors.white,
inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C),
),
),
], ],
), ),
Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan(
text: "Town Hall, Coimbatore",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.white,
),
),
],
),
),
),
], ],
), ),
), ),
), ),
), ),
Spacer(),
Padding( Padding(
padding: const EdgeInsets.only(left: 15, top: 10), padding: const EdgeInsets.only(left: 15),
child: InkWell( child: InkWell(
onTap: () {}, onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessdetail()));
},
child: Container( child: Container(
width: 170, height: 185,
height: 200, margin: EdgeInsets.only(right: 15, top: 10),
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
image: const DecorationImage( borderRadius: BorderRadius.all(Radius.circular(5)),
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
), ),
child: Column( foregroundDecoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.start, color: status1 ? null : Colors.grey,
mainAxisAlignment: MainAxisAlignment.center, backgroundBlendMode:
status1 ? null : BlendMode.saturation,
),
child: Stack(
children: [ children: [
Row( Image.asset(
'assets/images/bg.png',
height: 250,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 15, left: 15, right: 10, top: 75),
top: 100, child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(),
child: RichText(
text: TextSpan(
text: "Barbeque Nation ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
children: [
TextSpan(
text: "42 ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFFFFBE3F),
),
),
WidgetSpan(
child: Icon(
Icons.star,
color: Color(0xFFFFBE3F),
size: 18,
),
),
],
),
),
),
Spacer(),
FlutterSwitch(
width: 105,
height: 40,
valueFontSize: 15,
toggleSize: 25,
value: status1,
borderRadius: 30.0,
padding: 8.0,
showOnOff: true,
onToggle: (val) {
setState(() {
status1 = val;
});
},
activeText: "OPEN",
activeTextColor: Colors.white,
activeTextFontWeight: FontWeight.w600,
activeColor: Color(0xFF09CD99),
inactiveText: "CLOSED",
inactiveTextColor: Colors.white,
inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C),
),
],
),
),
Padding(
padding: const EdgeInsets.only(
left: 10,
), ),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: "Barbeque Nation ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
children: [ children: [
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan( TextSpan(
text: "42 ", text: "Town Hall, Coimbatore",
style: TextStyle( style: TextStyle(
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 14,
color: Color(0xFFFFBE3F), color: Colors.white,
),
),
WidgetSpan(
child: Icon(
Icons.star,
color: Color(0xFFFFBE3F),
size: 18,
), ),
), ),
], ],
), ),
), ),
), ),
Spacer(),
Padding(
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105,
height: 40,
valueFontSize: 15,
toggleSize: 25,
value: status1,
borderRadius: 30.0,
padding: 8.0,
showOnOff: true,
onToggle: (val) {
setState(() {
status1 = val;
});
},
activeText: "OPEN",
activeTextColor: Colors.white,
activeTextFontWeight: FontWeight.w600,
activeColor: Color(0xFF09CD99),
inactiveText: "CLOSED",
inactiveTextColor: Colors.white,
inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C),
),
),
], ],
), ),
Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan(
text: "Town Hall, Coimbatore",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.white,
),
),
],
),
),
),
], ],
), ),
), ),
), ),
), ),
Spacer(),
Padding( Padding(
padding: const EdgeInsets.only(left: 15, top: 10), padding: const EdgeInsets.only(left: 15),
child: InkWell( child: InkWell(
onTap: () {}, onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessdetail()));
},
child: Container( child: Container(
width: 170, height: 180,
height: 200, margin: EdgeInsets.only(right: 15, top: 10),
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
image: const DecorationImage( borderRadius: BorderRadius.all(Radius.circular(5)),
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
), ),
child: Column( foregroundDecoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.start, color: status2 ? null : Colors.grey,
mainAxisAlignment: MainAxisAlignment.center, backgroundBlendMode:
status2 ? null : BlendMode.saturation,
),
child: Stack(
children: [ children: [
Row( Image.asset(
'assets/images/bg.png',
height: 250,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 15, left: 15, right: 10, top: 75),
top: 100, child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(),
child: RichText(
text: TextSpan(
text: "Barbeque Nation ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
children: [
TextSpan(
text: "42 ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFFFFBE3F),
),
),
WidgetSpan(
child: Icon(
Icons.star,
color: Color(0xFFFFBE3F),
size: 18,
),
),
],
),
),
),
Spacer(),
FlutterSwitch(
width: 105,
height: 40,
valueFontSize: 15,
toggleSize: 25,
value: status2,
borderRadius: 30.0,
padding: 8.0,
showOnOff: true,
onToggle: (val) {
setState(() {
status2 = val;
});
},
activeText: "OPEN",
activeTextColor: Colors.white,
activeTextFontWeight: FontWeight.w600,
activeColor: Color(0xFF09CD99),
inactiveText: "CLOSED",
inactiveTextColor: Colors.white,
inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C),
),
],
),
),
Padding(
padding: const EdgeInsets.only(
left: 10,
), ),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: "Barbeque Nation ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
children: [ children: [
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan( TextSpan(
text: "42 ", text: "Town Hall, Coimbatore",
style: TextStyle( style: TextStyle(
fontFamily: 'Manrope', fontFamily: 'Manrope',
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 14,
color: Color(0xFFFFBE3F), color: Colors.white,
),
),
WidgetSpan(
child: Icon(
Icons.star,
color: Color(0xFFFFBE3F),
size: 18,
), ),
), ),
], ],
), ),
), ),
), ),
Spacer(),
Padding(
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105,
height: 40,
valueFontSize: 15,
toggleSize: 25,
value: status2,
borderRadius: 30.0,
padding: 8.0,
showOnOff: true,
onToggle: (val) {
setState(() {
status2 = val;
});
},
activeText: "OPEN",
activeTextColor: Colors.white,
activeTextFontWeight: FontWeight.w600,
activeColor: Color(0xFF09CD99),
inactiveText: "CLOSED",
inactiveTextColor: Colors.white,
inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C),
),
),
], ],
), ),
Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan(
text: "Town Hall, Coimbatore",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.white,
),
),
],
),
),
),
], ],
), ),
), ),