BusinessAppFlutter/openclosenew/lib/07_addbusiness.dart
2022-06-03 23:11:07 +05:30

379 lines
14 KiB
Dart

import 'package:flutter/material.dart';
import 'package:openclosenew/businessaddedsuccess.dart';
import 'FontFamily.dart';
import 'colors.dart';
import 'fontsize.dart';
class addbusiness extends StatefulWidget {
addbusiness({Key? key}) : super(key: key);
@override
State<addbusiness> createState() => _addbusinessState();
}
class _addbusinessState extends State<addbusiness> {
List<DropdownMenuItem<String>> listDrop = [];
String? selected = null;
void loadData() {
listDrop = [];
listDrop.add(new DropdownMenuItem(
child: new Text('Item No.1'),
value: 'val-1',
));
listDrop.add(new DropdownMenuItem(
child: new Text('Item No.2'),
value: 'val-2',
));
listDrop.add(new DropdownMenuItem(
child: new Text('Item No.3'),
value: 'val-3',
));
}
List<DropdownMenuItem<String>> listDrop1 = [];
String? selected1 = null;
void loadData1() {
listDrop1 = [];
listDrop1.add(new DropdownMenuItem(
child: new Text('Item No.1'),
value: 'val-1',
));
listDrop1.add(new DropdownMenuItem(
child: new Text('Item No.2'),
value: 'val-2',
));
listDrop1.add(new DropdownMenuItem(
child: new Text('Item No.3'),
value: 'val-3',
));
}
@override
Widget build(BuildContext context) {
loadData();
loadData1();
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: SingleChildScrollView(
reverse: true,
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 15, right: 24),
child: Row(
children: [
IconButton(
icon: Icon(Icons.arrow_back, size: 24),
onPressed: () {
Navigator.pop(context);
},
),
SizedBox(
width: 20,
),
Text(
'Add Business',
style: TextStyle(
fontSize: HeadText,
color: DarkGray,
fontFamily: Font,
),
),
],
),
),
Container(
child: Column(
children: [
Image.asset(
'assets/images/gallery-icon.png',
color: primaryColor,
),
SizedBox(
height: 10,
),
Text(
'Uploading Logo',
style: TextStyle(
color: Gray,
fontSize: HeadText,
fontWeight: FontWeight.w400,
fontFamily: Font,
),
),
],
),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
margin: EdgeInsets.all(15),
padding: EdgeInsets.all(30),
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(
left: 24,
right: 24,
),
child: Text(
'Business Name',
style: TextStyle(
fontFamily: Font,
fontSize: HeadText,
color: DarkGray,
),
),
),
Padding(
padding:
const EdgeInsets.only(left: 24, right: 24, top: 5),
child: TextField(
decoration: InputDecoration(
contentPadding:
EdgeInsets.only(left: 10, top: 5, bottom: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
hintText: 'Type here...',
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 24,
top: 15,
right: 24,
),
child: Text(
'Contact Number',
style: TextStyle(
fontFamily: Font,
fontSize: HeadText,
color: DarkGray,
),
),
),
Padding(
padding:
const EdgeInsets.only(left: 24, right: 24, top: 5),
child: TextField(
decoration: InputDecoration(
contentPadding:
EdgeInsets.only(left: 10, top: 5, bottom: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
hintText: 'Type here...',
),
keyboardType: TextInputType.number,
),
),
Padding(
padding:
const EdgeInsets.only(left: 24, top: 15, right: 24),
child: Text(
'Tell about your business...',
style: TextStyle(
fontFamily: Font,
fontSize: HeadText,
color: DarkGray,
),
),
),
Padding(
padding:
const EdgeInsets.only(left: 24, right: 24, top: 5),
child: TextField(
maxLines: 4,
keyboardType: TextInputType.multiline,
decoration: InputDecoration(
contentPadding:
EdgeInsets.only(left: 10, top: 5, bottom: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
hintText: 'Type here...',
),
),
),
Padding(
padding: const EdgeInsets.only(top: 15),
child: Row(
children: [
SizedBox(
width: 28,
),
Text(
'Industry',
style: TextStyle(
color: DarkGray,
fontSize: HeadText,
fontFamily: Font,
),
),
SizedBox(
width: 120,
),
Text(
'Category',
style: TextStyle(
color: DarkGray,
fontFamily: Font,
fontSize: HeadText),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 5, right: 24),
child: Row(
children: [
SizedBox(
width: 28,
),
Expanded(
child: InputDecorator(
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
left: 10, top: 1, bottom: 1, right: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(5),
bottomLeft: Radius.circular(5),
),
),
),
child: DropdownButtonHideUnderline(
child: new DropdownButton(
borderRadius: BorderRadius.circular(10),
value: selected,
items: listDrop,
icon:
Icon(Icons.keyboard_arrow_down, size: 24),
hint: new Text('Choose...'),
onChanged: (value) {
selected = value as String?;
setState(() {});
},
),
),
),
),
Expanded(
child: InputDecorator(
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
left: 10, top: 1, bottom: 1, right: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(5),
bottomRight: Radius.circular(5),
),
),
),
child: DropdownButtonHideUnderline(
child: new DropdownButton(
borderRadius: BorderRadius.circular(10),
value: selected1,
items: listDrop1,
icon:
Icon(Icons.keyboard_arrow_down, size: 24),
hint: new Text('Choose...'),
onChanged: (value) {
selected1 = value as String?;
setState(() {});
},
),
),
),
),
],
),
),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(left: 28, top: 15),
child: Text(
'Address',
style: TextStyle(
fontFamily: Font,
fontSize: HeadText,
color: DarkGray,
),
),
),
SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.only(left: 28, right: 24),
child: TextField(
decoration: InputDecoration(
contentPadding:
EdgeInsets.only(left: 10, top: 5, bottom: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
hintText: 'Type here...',
suffixIcon: Icon(
Icons.location_on_outlined,
color: primaryColor,
),
),
),
),
],
),
],
),
),
SizedBox(
height: 45,
),
MaterialButton(
height: 50,
minWidth: double.infinity,
color: primaryColor,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => businessaddedsuccess()));
},
child: Text(
'Save',
style: TextStyle(
color: White,
fontSize: HeadText,
fontFamily: Font,
),
),
),
],
),
),
),
);
}
}