more fixes and features

This commit is contained in:
2024-06-23 17:02:19 -05:00
parent 03abc1191d
commit b860ae52f6
7 changed files with 205 additions and 152 deletions
+21 -22
View File
@@ -87,31 +87,28 @@ class _FilterBusinessDataTypeChipsState
extends State<_FilterBusinessDataTypeChips> {
@override
Widget build(BuildContext context) {
List<Padding> chips = [];
List<Widget> chips = [];
for (var type in DataTypeBusiness.values) {
chips.add(Padding(
padding:
const EdgeInsets.only(left: 3.0, right: 3.0, bottom: 3.0, top: 3.0),
child: FilterChip(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side:
BorderSide(color: Theme.of(context).colorScheme.secondary)),
label: Text(dataTypeFriendlyBusiness[type]!),
showCheckmark: false,
selected: widget.selectedDataTypesBusiness.contains(type),
onSelected: (bool selected) {
setState(() {
if (selected) {
widget.selectedDataTypesBusiness.add(type);
} else {
widget.selectedDataTypesBusiness.remove(type);
}
});
}),
));
chips.add(FilterChip(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: BorderSide(color: Theme.of(context).colorScheme.secondary)),
label: Text(dataTypeFriendlyBusiness[type]!),
showCheckmark: false,
selected: widget.selectedDataTypesBusiness.contains(type),
onSelected: (bool selected) {
setState(() {
if (selected) {
widget.selectedDataTypesBusiness.add(type);
} else {
widget.selectedDataTypesBusiness.remove(type);
}
});
}));
}
return Wrap(
spacing: 6,
runSpacing: 6,
children: chips,
);
}
@@ -155,6 +152,8 @@ class _FilterJobDataTypeChipsState extends State<_FilterJobDataTypeChips> {
));
}
return Wrap(
spacing: 6,
runSpacing: 6,
children: chips,
);
}
+24 -12
View File
@@ -5,12 +5,12 @@ enum DataTypeBusiness {
logo,
name,
description,
type,
website,
contactName,
contactEmail,
contactPhone,
notes,
type,
}
enum DataTypeJob {
@@ -42,19 +42,20 @@ class JobListing {
String name;
String description;
JobType? type;
OfferType? offerType;
String? wage;
String? link;
OfferType? offerType;
JobListing(
{this.id,
this.businessId,
required this.name,
required this.description,
this.type,
this.wage,
this.link,
this.offerType});
JobListing({
this.id,
this.businessId,
required this.name,
required this.description,
this.type,
this.offerType,
this.wage,
this.link,
});
factory JobListing.copy(JobListing input) {
return JobListing(
@@ -63,9 +64,9 @@ class JobListing {
name: input.name,
description: input.description,
type: input.type,
offerType: input.offerType,
wage: input.wage,
link: input.link,
offerType: input.offerType,
);
}
}
@@ -261,6 +262,17 @@ String getLetterFromOfferType(OfferType type) {
}
}
Color getColorFromOfferType(OfferType type) {
switch (type) {
case OfferType.job:
return Colors.blue;
case OfferType.internship:
return Colors.green.shade800;
case OfferType.apprenticeship:
return Colors.red;
}
}
IconData getIconFromThemeMode(ThemeMode theme) {
switch (theme) {
case ThemeMode.dark: