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,30 +359,35 @@ 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, foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.all( color: status ? null : Colors.grey,
Radius.circular(5), backgroundBlendMode:
status ? null : BlendMode.saturation,
), ),
child: Stack(
children: [
Image.asset(
'assets/images/bg.png',
height: 250,
), ),
child: Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
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( child: RichText(
text: TextSpan( text: TextSpan(
text: "Barbeque Nation ", text: "Barbeque Nation ",
@ -417,10 +421,7 @@ class _businesshomeState extends State<businesshome> {
), ),
), ),
Spacer(), Spacer(),
Padding( FlutterSwitch(
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105, width: 105,
height: 40, height: 40,
valueFontSize: 15, valueFontSize: 15,
@ -432,13 +433,6 @@ class _businesshomeState extends State<businesshome> {
onToggle: (val) { onToggle: (val) {
setState(() { setState(() {
status = val; status = val;
if (val) {
_imageColor =
Color.fromRGBO(22, 27, 34, 1);
} else {
_imageColor =
Color.fromRGBO(36, 41, 46, 1);
}
}); });
}, },
activeText: "OPEN", activeText: "OPEN",
@ -450,9 +444,9 @@ class _businesshomeState extends State<businesshome> {
inactiveTextFontWeight: FontWeight.w600, inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C), inactiveColor: Color(0xFFFF4B4C),
), ),
),
], ],
), ),
),
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 10, left: 10,
@ -483,37 +477,49 @@ class _businesshomeState extends State<businesshome> {
), ),
], ],
), ),
],
), ),
), ),
), ),
),
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( foregroundDecoration: BoxDecoration(
Radius.circular(5), color: status1 ? null : Colors.grey,
backgroundBlendMode:
status1 ? null : BlendMode.saturation,
), ),
child: Stack(
children: [
Image.asset(
'assets/images/bg.png',
height: 250,
), ),
child: Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
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( child: RichText(
text: TextSpan( text: TextSpan(
text: "Barbeque Nation ", text: "Barbeque Nation ",
@ -547,10 +553,7 @@ class _businesshomeState extends State<businesshome> {
), ),
), ),
Spacer(), Spacer(),
Padding( FlutterSwitch(
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105, width: 105,
height: 40, height: 40,
valueFontSize: 15, valueFontSize: 15,
@ -573,9 +576,9 @@ class _businesshomeState extends State<businesshome> {
inactiveTextFontWeight: FontWeight.w600, inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C), inactiveColor: Color(0xFFFF4B4C),
), ),
),
], ],
), ),
),
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 10, left: 10,
@ -606,37 +609,49 @@ class _businesshomeState extends State<businesshome> {
), ),
], ],
), ),
],
), ),
), ),
), ),
),
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( foregroundDecoration: BoxDecoration(
Radius.circular(5), color: status2 ? null : Colors.grey,
backgroundBlendMode:
status2 ? null : BlendMode.saturation,
), ),
child: Stack(
children: [
Image.asset(
'assets/images/bg.png',
height: 250,
), ),
child: Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
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( child: RichText(
text: TextSpan( text: TextSpan(
text: "Barbeque Nation ", text: "Barbeque Nation ",
@ -670,10 +685,7 @@ class _businesshomeState extends State<businesshome> {
), ),
), ),
Spacer(), Spacer(),
Padding( FlutterSwitch(
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105, width: 105,
height: 40, height: 40,
valueFontSize: 15, valueFontSize: 15,
@ -696,9 +708,9 @@ class _businesshomeState extends State<businesshome> {
inactiveTextFontWeight: FontWeight.w600, inactiveTextFontWeight: FontWeight.w600,
inactiveColor: Color(0xFFFF4B4C), inactiveColor: Color(0xFFFF4B4C),
), ),
),
], ],
), ),
),
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 10, left: 10,
@ -729,6 +741,8 @@ class _businesshomeState extends State<businesshome> {
), ),
], ],
), ),
],
),
), ),
), ),
), ),