diff --git a/fbla-api/lib/fbla_api.dart b/fbla-api/lib/fbla_api.dart index 083ae73..f023d5d 100644 --- a/fbla-api/lib/fbla_api.dart +++ b/fbla-api/lib/fbla_api.dart @@ -264,7 +264,6 @@ void main() async { } } - // await Future.delayed(Duration(seconds: 5)); return Response.ok( json.encode(output), headers: { diff --git a/fbla_ui/lib/main.dart b/fbla_ui/lib/main.dart index f5bb597..8daadd0 100644 --- a/fbla_ui/lib/main.dart +++ b/fbla_ui/lib/main.dart @@ -75,6 +75,7 @@ class _MainAppState extends State { primary: Colors.blue.shade700, onPrimary: Colors.white, secondary: Colors.blue.shade900, + onSecondary: Colors.white, surface: const Color.fromARGB(255, 31, 31, 31), surfaceContainer: const Color.fromARGB(255, 46, 46, 46), tertiary: Colors.green.shade900, @@ -100,6 +101,7 @@ class _MainAppState extends State { primary: Colors.blue.shade700, onPrimary: Colors.white, secondary: Colors.blue.shade300, + onSecondary: Colors.black, surface: Colors.grey.shade100, surfaceContainer: Colors.grey.shade200, tertiary: Colors.green, diff --git a/fbla_ui/lib/pages/businesses_overview.dart b/fbla_ui/lib/pages/businesses_overview.dart index 0c93094..6bf3d93 100644 --- a/fbla_ui/lib/pages/businesses_overview.dart +++ b/fbla_ui/lib/pages/businesses_overview.dart @@ -228,10 +228,21 @@ class _BusinessesOverviewState extends State { List chips = []; for (var type in BusinessType.values) { chips.add(FilterChip( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, showCheckmark: false, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20)), - label: Text(getNameFromBusinessType(type)), + borderRadius: BorderRadius.circular(20), + 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), onSelected: (bool selected) { if (selected) { @@ -248,8 +259,8 @@ class _BusinessesOverviewState extends State { content: SizedBox( width: 400, child: Wrap( - spacing: 6, - runSpacing: 6, + spacing: 8, + runSpacing: 8, children: chips, ), ), diff --git a/fbla_ui/lib/pages/create_edit_business.dart b/fbla_ui/lib/pages/create_edit_business.dart index 112f4be..68f92d8 100644 --- a/fbla_ui/lib/pages/create_edit_business.dart +++ b/fbla_ui/lib/pages/create_edit_business.dart @@ -93,8 +93,9 @@ class _CreateEditBusinessState extends State { ? FloatingActionButton.extended( label: const Text('Save'), icon: _isLoading - ? const Padding( - padding: EdgeInsets.all(16.0), + ? const SizedBox( + width: 24, + height: 24, child: CircularProgressIndicator( color: Colors.white, strokeWidth: 3.0, @@ -126,7 +127,7 @@ class _CreateEditBusinessState extends State { leading: ClipRRect( borderRadius: BorderRadius.circular(6.0), child: Image.network( - '$apiAddress/logos/${business.id}', + 'https://logo.clearbit.com/${business.website}', width: 48, height: 48, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { diff --git a/fbla_ui/lib/pages/create_edit_listing.dart b/fbla_ui/lib/pages/create_edit_listing.dart index 164649c..9490c66 100644 --- a/fbla_ui/lib/pages/create_edit_listing.dart +++ b/fbla_ui/lib/pages/create_edit_listing.dart @@ -82,8 +82,9 @@ class _CreateEditJobListingState extends State { ? FloatingActionButton.extended( label: const Text('Save'), icon: _isLoading - ? const Padding( - padding: EdgeInsets.all(16.0), + ? const SizedBox( + width: 24, + height: 24, child: CircularProgressIndicator( color: Colors.white, strokeWidth: 3.0, @@ -146,7 +147,8 @@ class _CreateEditJobListingState extends State { CrossAxisAlignment.start, children: [ Text( - getNameFromJobType(listing.type!), + getNameFromJobType( + listing.type ?? JobType.other), style: const TextStyle(fontSize: 18), ), Text( @@ -154,8 +156,8 @@ class _CreateEditJobListingState extends State { ), ], ), - contentPadding: const EdgeInsets.only( - bottom: 8, left: 16), + contentPadding: + const EdgeInsets.only(left: 16), leading: ClipRRect( borderRadius: BorderRadius.circular(6.0), child: Image.network( diff --git a/fbla_ui/lib/pages/listings_overview.dart b/fbla_ui/lib/pages/listings_overview.dart index 097db9d..087fe88 100644 --- a/fbla_ui/lib/pages/listings_overview.dart +++ b/fbla_ui/lib/pages/listings_overview.dart @@ -245,10 +245,21 @@ class _JobsOverviewState extends State { List jobTypeChips = []; for (JobType type in JobType.values) { jobTypeChips.add(FilterChip( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, showCheckmark: false, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20)), - label: Text(getNameFromJobType(type)), + borderRadius: BorderRadius.circular(20), + 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), onSelected: (bool selected) { if (selected) { @@ -263,10 +274,21 @@ class _JobsOverviewState extends State { List offerTypeChips = []; for (OfferType type in OfferType.values) { offerTypeChips.add(FilterChip( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, showCheckmark: false, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20)), - label: Text(getNameFromOfferType(type)), + borderRadius: BorderRadius.circular(20), + 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), onSelected: (bool selected) { if (selected) { @@ -283,14 +305,15 @@ class _JobsOverviewState extends State { content: SizedBox( width: 400, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ const Text('Job Type Filters:'), Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Wrap( - spacing: 6, - runSpacing: 6, + spacing: 8, + runSpacing: 8, children: jobTypeChips, ), ), @@ -298,8 +321,8 @@ class _JobsOverviewState extends State { Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Wrap( - spacing: 6, - runSpacing: 6, + spacing: 8, + runSpacing: 8, children: offerTypeChips, ), ), @@ -512,7 +535,11 @@ class _JobHeaderState extends State<_JobHeader> { style: const TextStyle(fontSize: 16), ), 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, backgroundColor: getColorFromOfferType( business.listings![0].offerType!), @@ -629,9 +656,15 @@ class _JobHeaderState extends State<_JobHeader> { child: ListTile( leading: Badge( label: Text(getLetterFromOfferType(business.listings![0].offerType!)), - textColor: Theme.of(context).colorScheme.onPrimary, + textColor: Colors.white, 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( borderRadius: BorderRadius.circular(3.0), child: Image.network('$apiAddress/logos/${business.id}', diff --git a/fbla_ui/lib/shared/api_logic.dart b/fbla_ui/lib/shared/api_logic.dart index ff7eecc..3a9a20a 100644 --- a/fbla_ui/lib/shared/api_logic.dart +++ b/fbla_ui/lib/shared/api_logic.dart @@ -6,8 +6,8 @@ import 'package:fbla_ui/shared/global_vars.dart'; import 'package:fbla_ui/shared/utils.dart'; import 'package:http/http.dart' as http; -var apiAddress = 'https://homelab.marinodev.com/fbla-api'; -// var apiAddress = 'http://192.168.0.114:8000/fbla-api'; +// var apiAddress = 'https://homelab.marinodev.com/fbla-api'; +var apiAddress = 'http://192.168.0.114:8000/fbla-api'; var client = http.Client(); diff --git a/fbla_ui/lib/shared/export.dart b/fbla_ui/lib/shared/export.dart index 38f4a92..f64ac75 100644 --- a/fbla_ui/lib/shared/export.dart +++ b/fbla_ui/lib/shared/export.dart @@ -133,6 +133,7 @@ class _FilterJobDataTypeChipsState extends State<_FilterJobDataTypeChips> { padding: const EdgeInsets.only(left: 3.0, right: 3.0, bottom: 3.0, top: 3.0), child: FilterChip( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), side: