import 'package:flutter/material.dart'; import 'package:flutter_switch/flutter_switch.dart'; import '07_addbusiness.dart'; import 'businessdetail.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; int _selectedIndex = 0; static const TextStyle optionStyle = TextStyle( fontFamily: 'Manrope', fontSize: 10, fontWeight: FontWeight.w400, fontStyle: FontStyle.normal, ); static const List _widgetOptions = [ Text( 'Index 0: Home', style: optionStyle, ), Text( 'Index 1: Business', style: optionStyle, ), Text( 'Index 2: School', style: optionStyle, ), ]; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Column( children: [ SafeArea( child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( height: 50, width: 50, margin: EdgeInsets.all(20), decoration: BoxDecoration( borderRadius: BorderRadius.circular(50), color: Colors.grey, ), ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 25, ), Text( 'Hi, Sudharsan', style: TextStyle( color: Colors.black, fontSize: 16, fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, ), ), Text( 'Mon, 02 May 2022', style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w500, fontSize: 11, ), ), ], ), Spacer(), Padding( padding: const EdgeInsets.only(top: 20), child: IconButton( icon: Image.asset('assets/images/bell.png'), onPressed: () { Navigator.pop(context); }, ), ), ], ), ), Spacer(), Container( height: 100, child: ListView( scrollDirection: Axis.horizontal, children: [ Padding( padding: const EdgeInsets.only(left: 22), child: InkWell( onTap: () {}, child: Container( width: 350, 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: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 14, color: Colors.white, ), ), Text( "42", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 26, color: Colors.white, ), ), Text( "Visitors viewed Barbeque Nation", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 12, color: Colors.white, ), ), ], ), ), ), ), ), Padding( padding: const EdgeInsets.only(left: 10), child: InkWell( onTap: () {}, child: Container( alignment: Alignment.center, width: 350, margin: EdgeInsets.only(right: 10), decoration: BoxDecoration( image: const DecorationImage( alignment: Alignment.centerRight, image: AssetImage('assets/images/status.png'), ), color: Color(0xFF09CD99), 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: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 14, color: Colors.white, ), ), Text( "43", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 26, color: Colors.white, ), ), Text( "Visitors viewed Barbeque Nation", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 12, color: Colors.white, ), ), ], ), ), ), ), ), Padding( padding: const EdgeInsets.only(left: 10), child: InkWell( onTap: () {}, child: Container( width: 350, margin: EdgeInsets.only(right: 10), decoration: BoxDecoration( image: const DecorationImage( alignment: Alignment.centerRight, image: AssetImage('assets/images/status.png'), ), color: Color(0xFF09CD99), 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: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 14, color: Colors.white, ), ), Text( "44", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 26, color: Colors.white, ), ), Text( "Visitors viewed Barbeque Nation", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w400, fontSize: 12, color: Colors.white, ), ), ], ), ), ), ), ), ], ), ), Spacer(), Row( children: [ Padding( padding: const EdgeInsets.only(left: 24), child: Text( 'My Businesses', style: TextStyle( fontSize: 16, fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, ), ), ), Spacer(), Padding( padding: const EdgeInsets.only(right: 15), child: TextButton.icon( icon: Icon( Icons.add, color: Color(0xFF09CD99), ), label: Text( "Add Business", style: TextStyle( fontFamily: 'Manrope', fontStyle: FontStyle.normal, fontWeight: FontWeight.w600, fontSize: 12, color: Color(0xFF09CD99), ), ), 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: 180, margin: EdgeInsets.only(right: 15), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), ), foregroundDecoration: BoxDecoration( color: status ? null : Colors.grey, backgroundBlendMode: status ? null : BlendMode.saturation, ), child: Stack( children: [ Image.asset( 'assets/images/bg.png', height: 250, ), 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: '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( 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: const EdgeInsets.only(left: 15), child: InkWell( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (_) => businessdetail())); }, child: Container( height: 185, margin: EdgeInsets.only(right: 15, top: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), ), foregroundDecoration: BoxDecoration( color: status1 ? null : Colors.grey, backgroundBlendMode: status1 ? null : BlendMode.saturation, ), child: Stack( children: [ Image.asset( 'assets/images/bg.png', height: 250, ), 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: '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( 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: const EdgeInsets.only(left: 15), child: InkWell( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (_) => businessdetail())); }, child: Container( height: 180, margin: EdgeInsets.only(right: 15, top: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), ), foregroundDecoration: BoxDecoration( color: status2 ? null : Colors.grey, backgroundBlendMode: status2 ? null : BlendMode.saturation, ), child: Stack( children: [ Image.asset( 'assets/images/bg.png', height: 250, ), 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: '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( 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(), BottomNavigationBar( iconSize: 20, unselectedFontSize: 12, selectedFontSize: 12, type: BottomNavigationBarType.fixed, items: const [ BottomNavigationBarItem( icon: ImageIcon( AssetImage('assets/images/store.png'), ), label: 'Business', ), BottomNavigationBarItem( icon: ImageIcon( AssetImage('assets/images/messages.png'), ), label: 'Chat', ), BottomNavigationBarItem( icon: ImageIcon( AssetImage('assets/images/discount.png'), ), label: 'Offer', ), BottomNavigationBarItem( icon: ImageIcon( AssetImage('assets/images/profile.png'), ), label: 'Profile', ), BottomNavigationBarItem( icon: ImageIcon( AssetImage('assets/images/setting.png'), ), label: 'Settings', ), ], currentIndex: _selectedIndex, selectedItemColor: Color(0xff09CD99), onTap: _onItemTapped, ), ], ), ); } }