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