BusinessAppFlutter/openclosenew/lib/11_busiesshome.dart

785 lines
32 KiB
Dart

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<businesshome> createState() => _businesshomeState();
}
class _businesshomeState extends State<businesshome> {
bool status = false;
bool status1 = false;
bool status2 = false;
Color _imageColor = Color.fromRGBO(2989, 5870, 1140, 1);
int _selectedIndex = 0;
static const TextStyle optionStyle = TextStyle(
fontFamily: 'Manrope',
fontSize: 10,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
);
static const List<Widget> _widgetOptions = <Widget>[
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: 330,
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: 420,
child: ListView(
scrollDirection: Axis.vertical,
children: [
Padding(
padding: const EdgeInsets.only(left: 15),
child: InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessdetail()));
},
child: Container(
width: 170,
height: 200,
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration(
image: const DecorationImage(
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
color: _imageColor,
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(
left: 15,
top: 100,
),
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(),
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,
),
),
],
),
),
),
],
),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 15, top: 10),
child: InkWell(
onTap: () {},
child: Container(
width: 170,
height: 200,
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration(
image: const DecorationImage(
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(
left: 15,
top: 100,
),
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(),
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,
),
),
],
),
),
),
],
),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 15, top: 10),
child: InkWell(
onTap: () {},
child: Container(
width: 170,
height: 200,
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration(
image: const DecorationImage(
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(
left: 15,
top: 100,
),
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(),
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,
),
),
],
),
),
),
],
),
),
),
),
],
),
),
Spacer(),
BottomNavigationBar(
iconSize: 20,
unselectedFontSize: 12,
selectedFontSize: 12,
type: BottomNavigationBarType.fixed,
items: const <BottomNavigationBarItem>[
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,
),
],
),
);
}
}