business home Screen button function completed

This commit is contained in:
vignesh 2022-05-17 00:35:03 +05:30
parent 70e4627c67
commit 9abcd2cde9
3 changed files with 531 additions and 308 deletions

View File

@ -50,9 +50,9 @@ class _addbusinessState extends State<addbusiness> {
loadData();
loadData1();
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.white,
body: SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
Padding(
@ -124,7 +124,8 @@ class _addbusinessState extends State<addbusiness> {
),
),
Padding(
padding: const EdgeInsets.only(left: 24, right: 24, top: 5),
padding:
const EdgeInsets.only(left: 24, right: 24, top: 5),
child: TextField(
decoration: InputDecoration(
contentPadding:
@ -154,7 +155,8 @@ class _addbusinessState extends State<addbusiness> {
),
),
Padding(
padding: const EdgeInsets.only(left: 24, right: 24, top: 5),
padding:
const EdgeInsets.only(left: 24, right: 24, top: 5),
child: TextField(
decoration: InputDecoration(
contentPadding:
@ -170,7 +172,8 @@ class _addbusinessState extends State<addbusiness> {
),
),
Padding(
padding: const EdgeInsets.only(left: 24, top: 5, right: 24),
padding:
const EdgeInsets.only(left: 24, top: 5, right: 24),
child: Text(
'Tell about your business...',
style: TextStyle(
@ -181,7 +184,8 @@ class _addbusinessState extends State<addbusiness> {
),
),
Padding(
padding: const EdgeInsets.only(left: 24, right: 24, top: 5),
padding:
const EdgeInsets.only(left: 24, right: 24, top: 5),
child: TextField(
maxLines: 4,
keyboardType: TextInputType.multiline,
@ -233,9 +237,11 @@ class _addbusinessState extends State<addbusiness> {
),
child: DropdownButtonHideUnderline(
child: new DropdownButton(
borderRadius: BorderRadius.circular(10),
value: selected,
items: listDrop,
icon: Icon(Icons.keyboard_arrow_down, size: 24),
icon:
Icon(Icons.keyboard_arrow_down, size: 24),
hint: new Text('Choose...'),
onChanged: (value) {
selected = value as String?;
@ -259,9 +265,11 @@ class _addbusinessState extends State<addbusiness> {
),
child: DropdownButtonHideUnderline(
child: new DropdownButton(
borderRadius: BorderRadius.circular(10),
value: selected1,
items: listDrop1,
icon: Icon(Icons.keyboard_arrow_down, size: 24),
icon:
Icon(Icons.keyboard_arrow_down, size: 24),
hint: new Text('Choose...'),
onChanged: (value) {
selected1 = value as String?;
@ -279,6 +287,7 @@ class _addbusinessState extends State<addbusiness> {
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(left: 28),
@ -313,19 +322,18 @@ class _addbusinessState extends State<addbusiness> {
),
),
),
],
SizedBox(
height: 50,
),
],
),
),
Spacer(),
MaterialButton(
height: 50,
minWidth: double.infinity,
color: Color(0xff12C193),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => businessaddedsuccess()));
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => businessaddedsuccess()));
},
child: Text(
'Save',
@ -334,6 +342,12 @@ class _addbusinessState extends State<addbusiness> {
),
],
),
],
),
),
],
),
),
),
);
}

View File

@ -1,9 +1,9 @@
import 'dart:ffi';
import 'package:flutter/material.dart';
import 'package:openclosenew/businessempty.dart';
import 'package:flutter_switch/flutter_switch.dart';
import '07_addbusiness.dart';
class businesshome extends StatefulWidget {
const businesshome({Key? key}) : super(key: key);
@ -12,9 +12,9 @@ class businesshome extends StatefulWidget {
}
class _businesshomeState extends State<businesshome> {
bool status = true;
static const Color newColor = Colors.black;
bool status = false;
bool status1 = false;
bool status2 = false;
int _selectedIndex = 0;
static const TextStyle optionStyle = TextStyle(
@ -115,16 +115,21 @@ class _businesshomeState extends State<businesshome> {
child: InkWell(
onTap: () {},
child: Container(
width: 320,
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(5),
Radius.circular(10),
),
gradient: LinearGradient(
colors: [
Color(0xFF09CD99),
Color(0xFF09B5CD),
],
),
),
child: Padding(
@ -173,7 +178,8 @@ class _businesshomeState extends State<businesshome> {
child: InkWell(
onTap: () {},
child: Container(
width: 320,
alignment: Alignment.center,
width: 350,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
image: const DecorationImage(
@ -182,7 +188,13 @@ class _businesshomeState extends State<businesshome> {
),
color: Color(0xFF09CD99),
borderRadius: BorderRadius.all(
Radius.circular(5),
Radius.circular(10),
),
gradient: LinearGradient(
colors: [
Color(0xFF09CD99),
Color(0xFF09B5CD),
],
),
),
child: Padding(
@ -231,7 +243,7 @@ class _businesshomeState extends State<businesshome> {
child: InkWell(
onTap: () {},
child: Container(
width: 320,
width: 330,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
image: const DecorationImage(
@ -240,7 +252,13 @@ class _businesshomeState extends State<businesshome> {
),
color: Color(0xFF09CD99),
borderRadius: BorderRadius.all(
Radius.circular(5),
Radius.circular(10),
),
gradient: LinearGradient(
colors: [
Color(0xFF09CD99),
Color(0xFF09B5CD),
],
),
),
child: Padding(
@ -320,7 +338,10 @@ class _businesshomeState extends State<businesshome> {
color: Color(0xFF09CD99),
),
),
onPressed: () {},
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (_) => addbusiness()));
},
),
),
],
@ -331,15 +352,14 @@ class _businesshomeState extends State<businesshome> {
scrollDirection: Axis.vertical,
children: [
Padding(
padding: const EdgeInsets.only(left: 24),
padding: const EdgeInsets.only(left: 15),
child: InkWell(
onTap: () {},
child: Container(
width: 165,
width: 170,
height: 200,
margin: EdgeInsets.only(right: 20),
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration(
color: newColor,
image: const DecorationImage(
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
@ -391,9 +411,10 @@ class _businesshomeState extends State<businesshome> {
),
),
),
Spacer(),
Padding(
padding:
const EdgeInsets.only(top: 100, left: 3),
padding: const EdgeInsets.only(
top: 100, left: 3, right: 3),
child: FlutterSwitch(
width: 105,
height: 40,
@ -454,30 +475,111 @@ class _businesshomeState extends State<businesshome> {
),
),
Padding(
padding: const EdgeInsets.only(left: 22),
padding: const EdgeInsets.only(left: 15, top: 10),
child: InkWell(
onTap: () {},
child: Container(
width: 160,
width: 170,
height: 200,
margin: EdgeInsets.only(right: 10, top: 10),
margin: EdgeInsets.only(right: 15),
decoration: BoxDecoration(
image: const DecorationImage(
alignment: Alignment.centerRight,
image: AssetImage('assets/images/status.png'),
image: AssetImage('assets/images/bg.png'),
fit: BoxFit.fitHeight,
),
color: Color(0xFF09CD99),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Padding(
padding: const EdgeInsets.all(14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Today",
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,
@ -486,23 +588,126 @@ class _businesshomeState extends State<businesshome> {
color: Colors.white,
),
),
Text(
"42",
],
),
),
),
],
),
),
),
),
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.w400,
fontSize: 26,
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.white,
),
),
Text(
"Visitors viewed Barbeque Nation",
children: [
TextSpan(
text: "42 ",
style: TextStyle(
fontFamily: 'Manrope',
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontSize: 12,
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,
),
),
@ -510,6 +715,9 @@ class _businesshomeState extends State<businesshome> {
),
),
),
],
),
),
),
),
],

View File

@ -12,8 +12,9 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
color: Colors.white,
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.green, fontFamily: 'Manrope'),
theme: ThemeData(fontFamily: 'Manrope'),
home: const Splash(),
);
}