This commit is contained in:
Drake Marino 2024-06-23 18:56:22 -05:00
parent b860ae52f6
commit c65e225291
8 changed files with 75 additions and 26 deletions

View File

@ -264,7 +264,6 @@ void main() async {
} }
} }
// await Future.delayed(Duration(seconds: 5));
return Response.ok( return Response.ok(
json.encode(output), json.encode(output),
headers: { headers: {

View File

@ -75,6 +75,7 @@ class _MainAppState extends State<MainApp> {
primary: Colors.blue.shade700, primary: Colors.blue.shade700,
onPrimary: Colors.white, onPrimary: Colors.white,
secondary: Colors.blue.shade900, secondary: Colors.blue.shade900,
onSecondary: Colors.white,
surface: const Color.fromARGB(255, 31, 31, 31), surface: const Color.fromARGB(255, 31, 31, 31),
surfaceContainer: const Color.fromARGB(255, 46, 46, 46), surfaceContainer: const Color.fromARGB(255, 46, 46, 46),
tertiary: Colors.green.shade900, tertiary: Colors.green.shade900,
@ -100,6 +101,7 @@ class _MainAppState extends State<MainApp> {
primary: Colors.blue.shade700, primary: Colors.blue.shade700,
onPrimary: Colors.white, onPrimary: Colors.white,
secondary: Colors.blue.shade300, secondary: Colors.blue.shade300,
onSecondary: Colors.black,
surface: Colors.grey.shade100, surface: Colors.grey.shade100,
surfaceContainer: Colors.grey.shade200, surfaceContainer: Colors.grey.shade200,
tertiary: Colors.green, tertiary: Colors.green,

View File

@ -228,10 +228,21 @@ class _BusinessesOverviewState extends State<BusinessesOverview> {
List<Widget> chips = []; List<Widget> chips = [];
for (var type in BusinessType.values) { for (var type in BusinessType.values) {
chips.add(FilterChip( chips.add(FilterChip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
showCheckmark: false, showCheckmark: false,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)), borderRadius: BorderRadius.circular(20),
label: Text(getNameFromBusinessType(type)), side: BorderSide(
color:
Theme.of(context).colorScheme.secondary)),
selectedColor: Theme.of(context).colorScheme.secondary,
label: Text(
getNameFromBusinessType(type),
style: TextStyle(
color: selectedChips.contains(type)
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).colorScheme.onSurface),
),
selected: selectedChips.contains(type), selected: selectedChips.contains(type),
onSelected: (bool selected) { onSelected: (bool selected) {
if (selected) { if (selected) {
@ -248,8 +259,8 @@ class _BusinessesOverviewState extends State<BusinessesOverview> {
content: SizedBox( content: SizedBox(
width: 400, width: 400,
child: Wrap( child: Wrap(
spacing: 6, spacing: 8,
runSpacing: 6, runSpacing: 8,
children: chips, children: chips,
), ),
), ),

View File

@ -93,8 +93,9 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
? FloatingActionButton.extended( ? FloatingActionButton.extended(
label: const Text('Save'), label: const Text('Save'),
icon: _isLoading icon: _isLoading
? const Padding( ? const SizedBox(
padding: EdgeInsets.all(16.0), width: 24,
height: 24,
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Colors.white, color: Colors.white,
strokeWidth: 3.0, strokeWidth: 3.0,
@ -126,7 +127,7 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
leading: ClipRRect( leading: ClipRRect(
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
child: Image.network( child: Image.network(
'$apiAddress/logos/${business.id}', 'https://logo.clearbit.com/${business.website}',
width: 48, width: 48,
height: 48, errorBuilder: (BuildContext context, height: 48, errorBuilder: (BuildContext context,
Object exception, StackTrace? stackTrace) { Object exception, StackTrace? stackTrace) {

View File

@ -82,8 +82,9 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
? FloatingActionButton.extended( ? FloatingActionButton.extended(
label: const Text('Save'), label: const Text('Save'),
icon: _isLoading icon: _isLoading
? const Padding( ? const SizedBox(
padding: EdgeInsets.all(16.0), width: 24,
height: 24,
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Colors.white, color: Colors.white,
strokeWidth: 3.0, strokeWidth: 3.0,
@ -146,7 +147,8 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
getNameFromJobType(listing.type!), getNameFromJobType(
listing.type ?? JobType.other),
style: const TextStyle(fontSize: 18), style: const TextStyle(fontSize: 18),
), ),
Text( Text(
@ -154,8 +156,8 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
), ),
], ],
), ),
contentPadding: const EdgeInsets.only( contentPadding:
bottom: 8, left: 16), const EdgeInsets.only(left: 16),
leading: ClipRRect( leading: ClipRRect(
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
child: Image.network( child: Image.network(

View File

@ -245,10 +245,21 @@ class _JobsOverviewState extends State<JobsOverview> {
List<Widget> jobTypeChips = []; List<Widget> jobTypeChips = [];
for (JobType type in JobType.values) { for (JobType type in JobType.values) {
jobTypeChips.add(FilterChip( jobTypeChips.add(FilterChip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
showCheckmark: false, showCheckmark: false,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)), borderRadius: BorderRadius.circular(20),
label: Text(getNameFromJobType(type)), side: BorderSide(
color:
Theme.of(context).colorScheme.secondary)),
selectedColor: Theme.of(context).colorScheme.secondary,
label: Text(
getNameFromJobType(type),
style: TextStyle(
color: selectedJobTypeChips.contains(type)
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).colorScheme.onSurface),
),
selected: selectedJobTypeChips.contains(type), selected: selectedJobTypeChips.contains(type),
onSelected: (bool selected) { onSelected: (bool selected) {
if (selected) { if (selected) {
@ -263,10 +274,21 @@ class _JobsOverviewState extends State<JobsOverview> {
List<Widget> offerTypeChips = []; List<Widget> offerTypeChips = [];
for (OfferType type in OfferType.values) { for (OfferType type in OfferType.values) {
offerTypeChips.add(FilterChip( offerTypeChips.add(FilterChip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
showCheckmark: false, showCheckmark: false,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)), borderRadius: BorderRadius.circular(20),
label: Text(getNameFromOfferType(type)), side: BorderSide(
color:
Theme.of(context).colorScheme.secondary)),
selectedColor: Theme.of(context).colorScheme.secondary,
label: Text(
getNameFromOfferType(type),
style: TextStyle(
color: selectedOfferTypeChips.contains(type)
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).colorScheme.onSurface),
),
selected: selectedOfferTypeChips.contains(type), selected: selectedOfferTypeChips.contains(type),
onSelected: (bool selected) { onSelected: (bool selected) {
if (selected) { if (selected) {
@ -283,14 +305,15 @@ class _JobsOverviewState extends State<JobsOverview> {
content: SizedBox( content: SizedBox(
width: 400, width: 400,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text('Job Type Filters:'), const Text('Job Type Filters:'),
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Wrap( child: Wrap(
spacing: 6, spacing: 8,
runSpacing: 6, runSpacing: 8,
children: jobTypeChips, children: jobTypeChips,
), ),
), ),
@ -298,8 +321,8 @@ class _JobsOverviewState extends State<JobsOverview> {
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Wrap( child: Wrap(
spacing: 6, spacing: 8,
runSpacing: 6, runSpacing: 8,
children: offerTypeChips, children: offerTypeChips,
), ),
), ),
@ -512,7 +535,11 @@ class _JobHeaderState extends State<_JobHeader> {
style: const TextStyle(fontSize: 16), style: const TextStyle(fontSize: 16),
), ),
largeSize: 26, largeSize: 26,
offset: const Offset(15, -5), padding: business.listings![0].offerType! ==
OfferType.internship
? const EdgeInsets.symmetric(horizontal: 5)
: null,
offset: const Offset(13, -2),
textColor: Colors.white, textColor: Colors.white,
backgroundColor: getColorFromOfferType( backgroundColor: getColorFromOfferType(
business.listings![0].offerType!), business.listings![0].offerType!),
@ -629,9 +656,15 @@ class _JobHeaderState extends State<_JobHeader> {
child: ListTile( child: ListTile(
leading: Badge( leading: Badge(
label: Text(getLetterFromOfferType(business.listings![0].offerType!)), label: Text(getLetterFromOfferType(business.listings![0].offerType!)),
textColor: Theme.of(context).colorScheme.onPrimary, textColor: Colors.white,
isLabelVisible: true, isLabelVisible: true,
backgroundColor: Theme.of(context).colorScheme.primary, offset: const Offset(7, -5),
alignment: Alignment.topRight,
padding: business.listings![0].offerType! == OfferType.internship
? const EdgeInsets.symmetric(horizontal: 5)
: null,
backgroundColor:
getColorFromOfferType(business.listings![0].offerType!),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(3.0), borderRadius: BorderRadius.circular(3.0),
child: Image.network('$apiAddress/logos/${business.id}', child: Image.network('$apiAddress/logos/${business.id}',

View File

@ -6,8 +6,8 @@ import 'package:fbla_ui/shared/global_vars.dart';
import 'package:fbla_ui/shared/utils.dart'; import 'package:fbla_ui/shared/utils.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
var apiAddress = 'https://homelab.marinodev.com/fbla-api'; // var apiAddress = 'https://homelab.marinodev.com/fbla-api';
// var apiAddress = 'http://192.168.0.114:8000/fbla-api'; var apiAddress = 'http://192.168.0.114:8000/fbla-api';
var client = http.Client(); var client = http.Client();

View File

@ -133,6 +133,7 @@ class _FilterJobDataTypeChipsState extends State<_FilterJobDataTypeChips> {
padding: padding:
const EdgeInsets.only(left: 3.0, right: 3.0, bottom: 3.0, top: 3.0), const EdgeInsets.only(left: 3.0, right: 3.0, bottom: 3.0, top: 3.0),
child: FilterChip( child: FilterChip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
side: side: