BusinessAppFlutter/openclosenew/lib/11_busiesshome.dart

780 lines
34 KiB
Dart
Raw Normal View History

2022-05-14 20:28:31 +00:00
import 'package:flutter/material.dart';
2022-05-15 19:40:15 +00:00
import 'package:flutter_switch/flutter_switch.dart';
import '07_addbusiness.dart';
2022-05-17 07:00:55 +00:00
import 'businessdetail.dart';
2022-05-14 20:28:31 +00:00
class businesshome extends StatefulWidget {
const businesshome({Key? key}) : super(key: key);
@override
State<businesshome> createState() => _businesshomeState();
}
class _businesshomeState extends State<businesshome> {
2022-05-17 17:58:13 +00:00
bool status = true;
bool status1 = true;
bool status2 = true;
2022-05-15 19:40:15 +00:00
2022-05-14 20:28:31 +00:00
int _selectedIndex = 0;
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);
},
),
),
],
),
),
2022-05-25 19:47:31 +00:00
SizedBox(
height: 20,
),
2022-05-15 19:40:15 +00:00
Container(
height: 100,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
Padding(
2022-05-25 19:47:31 +00:00
padding: const EdgeInsets.only(left: 18),
2022-05-15 19:40:15 +00:00
child: InkWell(
onTap: () {},
child: Container(
2022-05-25 19:47:31 +00:00
width: 360,
2022-05-14 20:28:31 +00:00
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),
],
2022-05-14 20:28:31 +00:00
),
),
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,
),
),
],
),
),
),
2022-05-15 19:40:15 +00:00
),
),
Padding(
2022-05-25 19:47:31 +00:00
padding: const EdgeInsets.only(left: 18),
2022-05-15 19:40:15 +00:00
child: InkWell(
onTap: () {},
child: Container(
2022-05-25 19:47:31 +00:00
width: 360,
2022-05-14 20:28:31 +00:00
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
2022-05-15 19:40:15 +00:00
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),
],
2022-05-15 19:40:15 +00:00
),
),
2022-05-14 20:28:31 +00:00
child: Padding(
2022-05-15 19:40:15 +00:00
padding: const EdgeInsets.all(14),
2022-05-14 20:28:31 +00:00
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Today",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.white,
),
),
Text(
2022-05-25 19:47:31 +00:00
"42",
2022-05-14 20:28:31 +00:00
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,
),
),
],
),
),
),
2022-05-15 19:40:15 +00:00
),
),
Padding(
2022-05-25 19:47:31 +00:00
padding: const EdgeInsets.only(left: 18),
2022-05-15 19:40:15 +00:00
child: InkWell(
onTap: () {},
child: Container(
2022-05-25 19:47:31 +00:00
width: 360,
2022-05-14 20:28:31 +00:00
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
2022-05-15 19:40:15 +00:00
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),
],
2022-05-15 19:40:15 +00:00
),
),
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(
2022-05-25 19:47:31 +00:00
"42",
2022-05-15 19:40:15 +00:00
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,
),
),
],
),
),
),
),
),
],
),
),
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,
),
),
),
Padding(
padding: const EdgeInsets.only(right: 15, top: 10, bottom: 15),
2022-05-15 19:40:15 +00:00
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()));
},
2022-05-15 19:40:15 +00:00
),
),
],
),
Container(
height: 400,
2022-05-15 19:40:15 +00:00
child: ListView(
scrollDirection: Axis.vertical,
children: [
Padding(
padding: const EdgeInsets.only(left: 15),
2022-05-15 19:40:15 +00:00
child: InkWell(
2022-05-17 07:00:55 +00:00
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessdetail()));
},
2022-05-15 19:40:15 +00:00
child: Container(
height: 200,
width: double.infinity,
margin: EdgeInsets.only(right: 15),
2022-05-15 19:40:15 +00:00
decoration: BoxDecoration(
2022-05-17 17:58:13 +00:00
borderRadius: BorderRadius.all(Radius.circular(5)),
),
foregroundDecoration: BoxDecoration(
2022-05-25 19:47:31 +00:00
color: status ? null : Colors.white,
2022-05-17 17:58:13 +00:00
backgroundBlendMode:
status ? null : BlendMode.saturation,
2022-05-15 19:40:15 +00:00
),
2022-05-17 17:58:13 +00:00
child: Stack(
2022-05-15 19:40:15 +00:00
children: [
2022-05-17 17:58:13 +00:00
Image.asset(
'assets/images/bg.png',
height: 250,
2022-05-17 17:58:13 +00:00
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
2022-05-15 19:40:15 +00:00
children: [
Padding(
padding: const EdgeInsets.only(
2022-05-17 17:58:13 +00:00
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(
2022-05-19 19:49:37 +00:00
text: "4.2 ",
2022-05-17 17:58:13 +00:00
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,
),
),
],
),
),
),
2022-05-25 19:47:31 +00:00
SizedBox(
width: 35,
2022-05-25 19:47:31 +00:00
),
2022-05-17 17:58:13 +00:00
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,
2022-05-15 19:40:15 +00:00
),
child: RichText(
text: TextSpan(
children: [
2022-05-17 17:58:13 +00:00
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
2022-05-15 19:40:15 +00:00
TextSpan(
2022-05-17 17:58:13 +00:00
text: "Town Hall, Coimbatore",
2022-05-15 19:40:15 +00:00
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
2022-05-17 17:58:13 +00:00
fontSize: 14,
color: Colors.white,
2022-05-15 19:40:15 +00:00
),
),
],
),
),
),
],
2022-05-14 20:28:31 +00:00
),
2022-05-15 19:40:15 +00:00
],
),
),
),
),
Padding(
2022-05-17 17:58:13 +00:00
padding: const EdgeInsets.only(left: 15),
2022-05-15 19:40:15 +00:00
child: InkWell(
2022-05-17 17:58:13 +00:00
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessdetail()));
},
2022-05-15 19:40:15 +00:00
child: Container(
height: 200,
margin: EdgeInsets.only(right: 15, top: 10),
2022-05-15 19:40:15 +00:00
decoration: BoxDecoration(
2022-05-17 17:58:13 +00:00
borderRadius: BorderRadius.all(Radius.circular(5)),
2022-05-15 19:40:15 +00:00
),
2022-05-17 17:58:13 +00:00
foregroundDecoration: BoxDecoration(
color: status1 ? null : Colors.grey,
backgroundBlendMode:
status1 ? null : BlendMode.saturation,
),
child: Stack(
children: [
2022-05-17 17:58:13 +00:00
Image.asset(
'assets/images/bg.png',
height: 250,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(
2022-05-17 17:58:13 +00:00
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(
2022-05-19 19:49:37 +00:00
text: "4.2 ",
2022-05-17 17:58:13 +00:00
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,
),
),
],
),
),
),
2022-05-25 19:47:31 +00:00
SizedBox(
width: 35,
2022-05-25 19:47:31 +00:00
),
2022-05-17 17:58:13 +00:00
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: [
2022-05-17 17:58:13 +00:00
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan(
2022-05-17 17:58:13 +00:00
text: "Town Hall, Coimbatore",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
2022-05-17 17:58:13 +00:00
fontSize: 14,
color: Colors.white,
),
),
],
),
),
2022-05-14 20:28:31 +00:00
),
],
),
],
),
),
),
),
Padding(
2022-05-17 17:58:13 +00:00
padding: const EdgeInsets.only(left: 15),
child: InkWell(
2022-05-17 17:58:13 +00:00
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessdetail()));
},
child: Container(
height: 200,
margin: EdgeInsets.only(right: 15, top: 10),
decoration: BoxDecoration(
2022-05-17 17:58:13 +00:00
borderRadius: BorderRadius.all(Radius.circular(5)),
),
foregroundDecoration: BoxDecoration(
color: status2 ? null : Colors.grey,
backgroundBlendMode:
status2 ? null : BlendMode.saturation,
2022-05-14 20:28:31 +00:00
),
2022-05-17 17:58:13 +00:00
child: Stack(
children: [
2022-05-17 17:58:13 +00:00
Image.asset(
'assets/images/bg.png',
height: 250,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(
2022-05-17 17:58:13 +00:00
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(
2022-05-19 19:49:37 +00:00
text: "4.2 ",
2022-05-17 17:58:13 +00:00
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,
),
),
],
),
),
),
2022-05-25 19:47:31 +00:00
SizedBox(
width: 35,
2022-05-25 19:47:31 +00:00
),
2022-05-17 17:58:13 +00:00
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: [
2022-05-17 17:58:13 +00:00
WidgetSpan(
child: Icon(
Icons.location_on_outlined,
color: Colors.white,
size: 20,
),
),
TextSpan(
2022-05-17 17:58:13 +00:00
text: "Town Hall, Coimbatore",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
2022-05-17 17:58:13 +00:00
fontSize: 14,
color: Colors.white,
),
),
],
),
),
),
],
),
],
),
2022-05-14 20:28:31 +00:00
),
2022-05-15 19:40:15 +00:00
),
2022-05-14 20:28:31 +00:00
),
2022-05-15 19:40:15 +00:00
],
2022-05-14 20:28:31 +00:00
),
),
2022-05-25 19:47:31 +00:00
Spacer(),
2022-05-14 20:28:31 +00:00
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,
),
],
),
);
}
}