import 'package:flutter/material.dart'; import 'package:flutter_switch/flutter_switch.dart'; import '07_addbusiness.dart'; import 'FontFamily.dart'; import 'businessdetail.dart'; import 'colors.dart'; import 'fontsize.dart'; class businesshome extends StatefulWidget { const businesshome({Key? key}) : super(key: key); @override State createState() => _businesshomeState(); } class _businesshomeState extends State { bool status = true; bool status1 = true; bool status2 = true; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Column( children: [ SafeArea( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( height: 50, width: 50, margin: EdgeInsets.all(20), decoration: BoxDecoration( borderRadius: BorderRadius.circular(50), color: Colors.grey, ), ), Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'Hi, Sudharsan', style: TextStyle( color: DarkGray, fontSize: HeadText, fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, ), ), Text( 'Mon, 02 May 2022', style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w500, fontSize: SubText, color: Gray, ), ), ], ), Spacer(), IconButton( padding: EdgeInsets.only(right: 15), icon: Image.asset('assets/images/bell.png'), onPressed: () { Navigator.pop(context); }, ), ], ), ), SizedBox( height: 20, ), Container( height: 100, child: ListView( scrollDirection: Axis.horizontal, children: [ Padding( padding: const EdgeInsets.only(left: 18), child: InkWell( onTap: () {}, child: Container( width: 360, margin: EdgeInsets.only(right: 10), decoration: BoxDecoration( image: const DecorationImage( alignment: Alignment.centerRight, image: AssetImage('assets/images/status.png'), ), borderRadius: BorderRadius.all( Radius.circular(10), ), gradient: LinearGradient( colors: [ Color(0xFF09CD99), Color(0xFF09B5CD), ], ), ), child: Padding( padding: const EdgeInsets.all(14), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Today", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: HeadText, color: Colors.white, ), ), Text( "42", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: TitleText, color: Colors.white, ), ), Text( "Visitors viewed Barbeque Nation", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: SubText, color: Colors.white, ), ), ], ), ), ), ), ), Padding( padding: const EdgeInsets.only(left: 18), child: InkWell( onTap: () {}, child: Container( width: 360, margin: EdgeInsets.only(right: 10), decoration: BoxDecoration( image: const DecorationImage( alignment: Alignment.centerRight, image: AssetImage('assets/images/status.png'), ), borderRadius: BorderRadius.all( Radius.circular(10), ), gradient: LinearGradient( colors: [ Color(0xFF09CD99), Color(0xFF09B5CD), ], ), ), child: Padding( padding: const EdgeInsets.all(14), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Today", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: HeadText, color: Colors.white, ), ), Text( "42", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: TitleText, color: Colors.white, ), ), Text( "Visitors viewed Barbeque Nation", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: SubText, color: Colors.white, ), ), ], ), ), ), ), ), Padding( padding: const EdgeInsets.only(left: 18), child: InkWell( onTap: () {}, child: Container( width: 360, margin: EdgeInsets.only(right: 10), decoration: BoxDecoration( image: const DecorationImage( alignment: Alignment.centerRight, image: AssetImage('assets/images/status.png'), ), borderRadius: BorderRadius.all( Radius.circular(10), ), gradient: LinearGradient( colors: [ Color(0xFF09CD99), Color(0xFF09B5CD), ], ), ), child: Padding( padding: const EdgeInsets.all(14), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Today", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: HeadText, color: Colors.white, ), ), Text( "42", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: TitleText, color: Colors.white, ), ), Text( "Visitors viewed Barbeque Nation", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: SubText, color: Colors.white, ), ), ], ), ), ), ), ), ], ), ), Row( children: [ Padding( padding: const EdgeInsets.only(left: 24), child: Text( 'My Businesses', style: TextStyle( fontSize: HeadText, fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, color: DarkGray, ), ), ), Spacer(), Padding( padding: const EdgeInsets.only(right: 15, top: 10, bottom: 15), child: TextButton.icon( icon: Icon( Icons.add, color: primaryColor, ), label: Text( "Add Business", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, fontSize: HeadText, color: primaryColor, ), ), onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (_) => addbusiness())); }, ), ), ], ), Container( height: 400, child: ListView( scrollDirection: Axis.vertical, children: [ Padding( padding: const EdgeInsets.only(left: 15), child: InkWell( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (_) => businessdetail())); }, child: Container( height: 150, width: double.infinity, margin: EdgeInsets.only(right: 15), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), image: new DecorationImage( image: ExactAssetImage( 'assets/images/bg.png', ), fit: BoxFit.cover, ), ), foregroundDecoration: BoxDecoration( color: status ? null : Colors.white, backgroundBlendMode: status ? null : BlendMode.saturation, ), child: Stack( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.only( left: 15, right: 10, top: 75), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(), child: RichText( text: TextSpan( text: "Barbeque Nation ", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, fontSize: 16, color: Colors.white, ), children: [ TextSpan( text: "4.2 ", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: SubText, color: Color(0xFFFFBE3F), ), ), WidgetSpan( child: Icon( Icons.star, color: Color(0xFFFFBE3F), size: 18, ), ), ], ), ), ), Spacer(), FlutterSwitch( width: 105, height: 40, valueFontSize: HeadText, 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( text: TextSpan( children: [ WidgetSpan( child: Icon( Icons.location_on_outlined, color: Colors.white, size: 20, ), ), TextSpan( text: "Town Hall, Coimbatore", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: HeadText, color: Colors.white, ), ), ], ), ), ), ], ), ], ), ), ), ), Padding( padding: const EdgeInsets.only(left: 15), child: InkWell( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (_) => businessdetail())); }, child: Container( height: 150, width: double.infinity, margin: EdgeInsets.only(right: 15, top: 10), decoration: BoxDecoration( image: new DecorationImage( image: ExactAssetImage( 'assets/images/bg.png', ), fit: BoxFit.cover, ), borderRadius: BorderRadius.all(Radius.circular(5)), ), foregroundDecoration: BoxDecoration( color: status1 ? null : Colors.grey, backgroundBlendMode: status1 ? null : BlendMode.saturation, ), child: Stack( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.only( left: 15, right: 10, top: 75), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(), child: RichText( text: TextSpan( text: "Barbeque Nation ", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, fontSize: 15, color: Colors.white, ), children: [ TextSpan( text: "4.2 ", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 12, color: Color(0xFFFFBE3F), ), ), WidgetSpan( child: Icon( Icons.star, color: Color(0xFFFFBE3F), size: 18, ), ), ], ), ), ), Spacer(), FlutterSwitch( width: 105, height: 40, valueFontSize: HeadText, 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: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: HeadText, color: Colors.white, ), ), ], ), ), ), ], ), ], ), ), ), ), Padding( padding: const EdgeInsets.only(left: 15), child: InkWell( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (_) => businessdetail())); }, child: Container( height: 150, width: double.infinity, margin: EdgeInsets.only(right: 15, top: 10), decoration: BoxDecoration( image: new DecorationImage( image: ExactAssetImage( 'assets/images/bg.png', ), fit: BoxFit.cover, ), borderRadius: BorderRadius.all(Radius.circular(5)), ), foregroundDecoration: BoxDecoration( color: status2 ? null : Colors.grey, backgroundBlendMode: status2 ? null : BlendMode.saturation, ), child: Stack( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.only( left: 15, right: 10, top: 75), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(), child: RichText( text: TextSpan( text: "Barbeque Nation ", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, fontSize: 15, color: Colors.white, ), children: [ TextSpan( text: "4.2 ", style: TextStyle( fontFamily: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 12, color: Color(0xFFFFBE3F), ), ), WidgetSpan( child: Icon( Icons.star, color: Color(0xFFFFBE3F), size: 18, ), ), ], ), ), ), Spacer(), FlutterSwitch( width: 105, height: 40, valueFontSize: HeadText, 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: Font, fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: HeadText, color: Colors.white, ), ), ], ), ), ), ], ), ], ), ), ), ), ], ), ), ], ), ); } }