more fixes 2
This commit is contained in:
parent
5614888454
commit
02bce8318a
@ -86,7 +86,13 @@ class _MainAppState extends State<MainApp> {
|
|||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.grey.withOpacity(0.1),
|
fillColor: Colors.grey.withOpacity(0.1),
|
||||||
labelStyle: const TextStyle(color: Colors.grey),
|
labelStyle: const TextStyle(color: Colors.grey),
|
||||||
floatingLabelStyle: TextStyle(color: Colors.blue.shade700),
|
floatingLabelStyle: WidgetStateTextStyle.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.focused) &&
|
||||||
|
!states.contains(WidgetState.hovered)) {
|
||||||
|
return TextStyle(color: Colors.blue.shade700);
|
||||||
|
}
|
||||||
|
return const TextStyle(color: Colors.grey);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
dropdownMenuTheme: const DropdownMenuThemeData(
|
dropdownMenuTheme: const DropdownMenuThemeData(
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
@ -110,9 +116,15 @@ class _MainAppState extends State<MainApp> {
|
|||||||
inputDecorationTheme: InputDecorationTheme(
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
// border: OutlineInputBorder(),
|
// border: OutlineInputBorder(),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.blue.withOpacity(0.1),
|
fillColor: Colors.grey.withOpacity(0.25),
|
||||||
labelStyle: const TextStyle(color: Colors.grey),
|
labelStyle: TextStyle(color: Colors.grey.shade700),
|
||||||
floatingLabelStyle: TextStyle(color: Colors.blue.shade700),
|
floatingLabelStyle: WidgetStateTextStyle.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.focused) &&
|
||||||
|
!states.contains(WidgetState.hovered)) {
|
||||||
|
return TextStyle(color: Colors.blue.shade700);
|
||||||
|
}
|
||||||
|
return TextStyle(color: Colors.grey.shade700);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
dropdownMenuTheme: const DropdownMenuThemeData(
|
dropdownMenuTheme: const DropdownMenuThemeData(
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
|
|||||||
@ -175,7 +175,7 @@ class _CreateBusinessDetailState extends State<BusinessDetail> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Available positions
|
// Available positions
|
||||||
if (business.listings != null)
|
if (business.listings != null || loggedIn)
|
||||||
Card(
|
Card(
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -184,7 +184,32 @@ class _CreateBusinessDetailState extends State<BusinessDetail> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 16, top: 4),
|
padding: const EdgeInsets.only(left: 16, top: 4),
|
||||||
child: _GetListingsTitle(business)),
|
child: _GetListingsTitle(business)),
|
||||||
|
if (business.listings != null)
|
||||||
_JobList(business: business)
|
_JobList(business: business)
|
||||||
|
else
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(left: 16.0),
|
||||||
|
child: Text('No job listings exist.'),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: const Text('add one?'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
CreateEditJobListing(
|
||||||
|
inputBusiness: business,
|
||||||
|
)));
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
// Contact info
|
// Contact info
|
||||||
@ -210,7 +235,6 @@ class _CreateBusinessDetailState extends State<BusinessDetail> {
|
|||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.phone),
|
leading: const Icon(Icons.phone),
|
||||||
title: Text(business.contactPhone!),
|
title: Text(business.contactPhone!),
|
||||||
// maybe replace ! with ?? ''. same is true for below
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -421,14 +445,16 @@ class _GetListingsTitle extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (!loggedIn) {
|
if (!loggedIn) {
|
||||||
return const Text('Available Postitions',
|
return Text(
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold));
|
'Available Postitions (${fromBusiness.listings?.length ?? '0'})',
|
||||||
|
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold));
|
||||||
} else {
|
} else {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
const Text('Available Postitions',
|
Text('Available Postitions (${fromBusiness.listings?.length ?? '0'})',
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
style:
|
||||||
|
const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 24.0),
|
padding: const EdgeInsets.only(right: 24.0),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
|
|||||||
@ -216,7 +216,7 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
|||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 8.0,
|
left: 8.0,
|
||||||
right: 8.0,
|
right: 8.0,
|
||||||
bottom: 16.0,
|
bottom: 8.0,
|
||||||
top: 8.0),
|
top: 8.0),
|
||||||
child: DropdownMenu<int>(
|
child: DropdownMenu<int>(
|
||||||
menuHeight: 300,
|
menuHeight: 300,
|
||||||
@ -265,7 +265,7 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
|||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 8.0,
|
left: 8.0,
|
||||||
right: 8.0,
|
right: 8.0,
|
||||||
bottom: 8.0,
|
bottom: 16.0,
|
||||||
top: 8.0),
|
top: 8.0),
|
||||||
child: DropdownMenu<JobType>(
|
child: DropdownMenu<JobType>(
|
||||||
initialSelection:
|
initialSelection:
|
||||||
@ -338,7 +338,7 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
|||||||
bottom: 8.0),
|
bottom: 8.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _nameController,
|
controller: _nameController,
|
||||||
maxLength: 30,
|
maxLength: 40,
|
||||||
onChanged: (inputName) {
|
onChanged: (inputName) {
|
||||||
setState(() {
|
setState(() {
|
||||||
listing.name = inputName;
|
listing.name = inputName;
|
||||||
@ -432,8 +432,9 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
|||||||
listing.link =
|
listing.link =
|
||||||
'https://${listing.link}';
|
'https://${listing.link}';
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
listing.link = null;
|
listing.link = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value != null &&
|
if (value != null &&
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user