diff --git a/lib/bloc/profile/other_information/hobbies/hoobies_bloc.dart b/lib/bloc/profile/other_information/hobbies/hoobies_bloc.dart index 3ad0c7e..b612e61 100644 --- a/lib/bloc/profile/other_information/hobbies/hoobies_bloc.dart +++ b/lib/bloc/profile/other_information/hobbies/hoobies_bloc.dart @@ -10,15 +10,106 @@ part 'hoobies_state.dart'; class HoobiesBloc extends Bloc { HoobiesBloc() : super(HoobiesInitial()) { List skillsAndHobbies = []; - on((event, emit)async { - emit(HobbiesLoadingState()); - try{ - List hobbies = await SkillsHobbiesServices.instance.getSkillsHobbies(event.profileId, event.token); - skillsAndHobbies = hobbies; - emit(HobbiesLoadedState(skillsAndHobbies: skillsAndHobbies)); - }catch(e){ - emit(HobbiesErrorState(message: e.toString())); - } + List allSkillsAndHobbies = []; + List mySkillsAndHobbies = []; + on((event, emit) async { + emit(HobbiesLoadingState()); + try { + List hobbies = await SkillsHobbiesServices.instance + .getSkillsHobbies(event.profileId, event.token); + skillsAndHobbies = hobbies; + emit(HobbiesLoadedState(skillsAndHobbies: skillsAndHobbies)); + } catch (e) { + emit(HobbiesErrorState(message: e.toString())); + } + }); + on((event,emit){ + skillsAndHobbies = event.skillsHobbies; + emit(HobbiesLoadedState(skillsAndHobbies: skillsAndHobbies)); + }); + ////SHOW ADD FORM + on((event, emit) async { + emit(HobbiesLoadingState()); + try { + if (allSkillsAndHobbies.isEmpty) { + allSkillsAndHobbies = + await SkillsHobbiesServices.instance.getAllSkillsHobbies(); + } + for (var element in skillsAndHobbies) { + mySkillsAndHobbies.add(element.name!); + } + allSkillsAndHobbies.sort((a, b) => a.name!.compareTo(b.name!)); + emit(AddHobbySkillState( + mySkillsAndHobbiesString: mySkillsAndHobbies, + allSkillsAndHobbies: allSkillsAndHobbies, + mySkillsAndHobbiesObject: skillsAndHobbies)); + } catch (e) { + emit(HobbiesErrorState(message: e.toString())); + } + }); + ////GET ADDED SKILLS HOBBIES + on((event, emit) { + emit(HobbiesLoadingState()); + List added = event.addedHobbiesSkills.split(","); + + for (var element in added) { + if (element.isNotEmpty) { + SkillsHobbies newSkillsHobbies = + SkillsHobbies(id: null, name: element.toUpperCase()); + skillsAndHobbies.add(newSkillsHobbies); + allSkillsAndHobbies.add(newSkillsHobbies); + } + } + for (var element in skillsAndHobbies) { + mySkillsAndHobbies.add(element.name!); + } + allSkillsAndHobbies.sort((a, b) => a.name!.compareTo(b.name!)); + emit(AddHobbySkillState( + mySkillsAndHobbiesString: mySkillsAndHobbies, + allSkillsAndHobbies: allSkillsAndHobbies, + mySkillsAndHobbiesObject: skillsAndHobbies)); + }); + ////SHOW ADD MODAL + on((event, emit) { + emit(ShowAddModalState()); + }); + + //// ADD + on((event, emit) async { + emit(HobbiesLoadingState()); + Map response = await SkillsHobbiesServices.instance.add( + skillsHobbies: event.skillsHobbies, + profileId: event.profileId, + token: event.token); + List newSkillsHobbies = []; + if (response['success']) { + if (response['data']['skill_hobby'] != null) { + for (var element in response['data']['skill_hobby']) { + newSkillsHobbies.add(SkillsHobbies.fromJson(element)); + } + } + skillsAndHobbies = newSkillsHobbies; + emit(HobbiesAndSkillsAddedState( + mySkillsAndHobbies: skillsAndHobbies, status: response)); + } else { + emit(HobbiesAndSkillsAddedState( + mySkillsAndHobbies: skillsAndHobbies, status: response)); + } + }); + ////DELETE + on((event,emit)async{ + emit(HobbiesLoadingState()); + try{ + bool success = await SkillsHobbiesServices.instance.delete(profileId: event.profileId, token: event.token, skillsHobbies: event.skillsHobbies); + if(success){ + skillsAndHobbies.removeWhere((element) => element.id == event.skillsHobbies[0].id); + emit(HobbiesAndSkillsDeletedState(skillsHobbies: skillsAndHobbies, success: success)); + }else{ + emit(HobbiesAndSkillsDeletedState(skillsHobbies: skillsAndHobbies, success: success)); + } + }catch(e){ + emit (HobbiesErrorState(message: e.toString())); + } }); } } diff --git a/lib/bloc/profile/other_information/hobbies/hoobies_event.dart b/lib/bloc/profile/other_information/hobbies/hoobies_event.dart index a78f0f9..5a718af 100644 --- a/lib/bloc/profile/other_information/hobbies/hoobies_event.dart +++ b/lib/bloc/profile/other_information/hobbies/hoobies_event.dart @@ -13,4 +13,40 @@ class GetSkillsHobbies extends HobbiesEvent{ const GetSkillsHobbies({required this.profileId, required this.token}); @override List get props => [profileId,token]; +} +class ShowHobbySkillAddForm extends HobbiesEvent{ + final List mySkillsAndHobbies; + const ShowHobbySkillAddForm({required this.mySkillsAndHobbies}); + +} +class AddHobbyAndSkills extends HobbiesEvent{ + final int profileId; + final String token; + final List skillsHobbies; + const AddHobbyAndSkills({required this.profileId,required this.token, required this.skillsHobbies}); + @override + List get props => [profileId,token]; +} + +class GetAddedHobbiesSkills extends HobbiesEvent{ + final String addedHobbiesSkills; + + + const GetAddedHobbiesSkills({required this.addedHobbiesSkills}); + @override + List get props => [addedHobbiesSkills]; +} +class ShowAddModal extends HobbiesEvent{ + +} + +class LoadHobbiesSkills extends HobbiesEvent{ + final List skillsHobbies; + const LoadHobbiesSkills({required this.skillsHobbies}); +} +class DeleteSkillHobbies extends HobbiesEvent{ + final int profileId; + final String token; + final List skillsHobbies; + const DeleteSkillHobbies({required this.profileId, required this.skillsHobbies, required this.token}); } \ No newline at end of file diff --git a/lib/bloc/profile/other_information/hobbies/hoobies_state.dart b/lib/bloc/profile/other_information/hobbies/hoobies_state.dart index c374892..a2d39ac 100644 --- a/lib/bloc/profile/other_information/hobbies/hoobies_state.dart +++ b/lib/bloc/profile/other_information/hobbies/hoobies_state.dart @@ -23,7 +23,33 @@ class HobbiesErrorState extends HobbiesState{ List get props => [message]; } +class AddHobbySkillState extends HobbiesState{ + final List mySkillsAndHobbiesString; + final List allSkillsAndHobbies; + final List mySkillsAndHobbiesObject; + + const AddHobbySkillState({required this.mySkillsAndHobbiesString,required this.allSkillsAndHobbies,required this.mySkillsAndHobbiesObject}); + @override + List get props => [mySkillsAndHobbiesString,allSkillsAndHobbies,mySkillsAndHobbiesObject]; +} class HobbiesLoadingState extends HobbiesState{ } +class ShowAddModalState extends HobbiesState{ + +} +class HobbiesAndSkillsAddedState extends HobbiesState{ + final List mySkillsAndHobbies; + final Map status; + const HobbiesAndSkillsAddedState({required this.mySkillsAndHobbies, required this.status}); + @override + List get props => [mySkillsAndHobbies,status]; +} +class HobbiesAndSkillsDeletedState extends HobbiesState{ + final bool success; + final List skillsHobbies; + const HobbiesAndSkillsDeletedState({required this.skillsHobbies,required this.success}); +} + + diff --git a/lib/screens/profile/components/other_information/skills_and_hobbies_screen.dart b/lib/screens/profile/components/other_information/skills_and_hobbies_screen.dart index 1ea1de4..7096b37 100644 --- a/lib/screens/profile/components/other_information/skills_and_hobbies_screen.dart +++ b/lib/screens/profile/components/other_information/skills_and_hobbies_screen.dart @@ -4,9 +4,12 @@ import 'package:flutter/src/widgets/placeholder.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_progress_hud/flutter_progress_hud.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:simple_chips_input/simple_chips_input.dart'; import 'package:unit2/bloc/profile/profile_bloc.dart'; import 'package:unit2/bloc/user/user_bloc.dart'; import 'package:unit2/model/profile/other_information/skills_and_hobbies.dart'; +import 'package:unit2/screens/profile/components/other_information/skills_hobbies/add_modal.dart'; +import 'package:unit2/theme-data.dart/box_shadow.dart'; import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/text_container.dart'; @@ -14,19 +17,35 @@ import 'package:unit2/widgets/Leadings/add_leading.dart'; import 'package:unit2/widgets/empty_data.dart'; import '../../../../bloc/profile/other_information/hobbies/hoobies_bloc.dart'; +import '../../../../theme-data.dart/btn-style.dart'; +import '../../../../utils/alerts.dart'; class SkillHobbiesScreen extends StatelessWidget { const SkillHobbiesScreen({super.key}); @override Widget build(BuildContext context) { + String token; + int profileId; + final bloc = BlocProvider.of(context); + List? mySkillsAndHobbies; return Scaffold( appBar: AppBar( - title: const Text(skillAndHobbiesTitle), - backgroundColor: primary, - centerTitle: true, - actions: [AddLeading(onPressed: () {})], - ), + title: const Text(skillAndHobbiesTitle), + backgroundColor: primary, + centerTitle: true, + actions: context.watch().state is AddHobbySkillState + ? [ + AddLeading(onPressed: () { + context.read().add(ShowAddModal()); + }) + ] + : [ + AddLeading(onPressed: () { + context.read().add(ShowHobbySkillAddForm( + mySkillsAndHobbies: mySkillsAndHobbies!)); + }) + ]), body: ProgressHUD( padding: const EdgeInsets.all(24), backgroundColor: Colors.black87, @@ -34,6 +53,8 @@ class SkillHobbiesScreen extends StatelessWidget { child: BlocBuilder( builder: (context, state) { if (state is UserLoggedIn) { + token = state.userData!.user!.login!.token!; + profileId = state.userData!.user!.login!.user!.profileId!; return BlocBuilder( builder: (context, state) { if (state is ProfileLoaded) { @@ -42,16 +63,65 @@ class SkillHobbiesScreen extends StatelessWidget { if (state is HobbiesLoadingState) { final progress = ProgressHUD.of(context); progress!.showWithText("Please wait..."); - }if(state is HobbiesLoadedState || state is HobbiesErrorState){ - final progress = ProgressHUD.of(context); - progress!.dismiss(); + } + if (state is HobbiesLoadedState || + state is HobbiesErrorState || + state is AddHobbySkillState) { + final progress = ProgressHUD.of(context); + progress!.dismiss(); + } + ////ADDED STATE + if (state is HobbiesAndSkillsAddedState) { + if (state.status['success']) { + successAlert(context, "Adding Successfull!", + state.status['message'], () { + Navigator.of(context).pop(); + context.read().add( + LoadHobbiesSkills( + skillsHobbies: + state.mySkillsAndHobbies)); + }); + } else { + errorAlert(context, "Adding Failed", + "Something went wrong. Please try again.", + () { + Navigator.of(context).pop(); + context.read().add( + LoadHobbiesSkills( + skillsHobbies: + state.mySkillsAndHobbies)); + }); + } + } + //// DELETED STATE + + if (state is HobbiesAndSkillsDeletedState) { + if (state.success) { + successAlert(context, "Delete Successfull!", + "Skill/Hobby Deleted Successfully", () { + Navigator.of(context).pop(); + context.read().add( + LoadHobbiesSkills( + skillsHobbies: state.skillsHobbies)); + }); + } else { + errorAlert(context, "Deletion Failed", + "Something went wrong. Please try again.", + () { + Navigator.of(context).pop(); + context.read().add( + LoadHobbiesSkills( + skillsHobbies: state.skillsHobbies)); + }); + } } }, builder: (context, state) { if (state is HobbiesLoadedState) { + mySkillsAndHobbies = state.skillsAndHobbies; if (state.skillsAndHobbies.isNotEmpty) { return Padding( - padding: const EdgeInsets.all(24), + padding: const EdgeInsets.all(12), child: Wrap( spacing: 8, runSpacing: 8, @@ -61,17 +131,51 @@ class SkillHobbiesScreen extends StatelessWidget { crossAxisAlignment: WrapCrossAlignment.start, direction: Axis.horizontal, - children: - state.skillsAndHobbies.map((SkillsHobbies sh) { - return FittedBox( - child: Row( - children: [ - Text(sh.name!), - IconButton( - onPressed: () {}, - icon: const Icon(Icons.close)), - ], - ), + children: state.skillsAndHobbies + .map((SkillsHobbies sh) { + return Wrap( + children: [ + Container( + padding: const EdgeInsets.only( + left: 6), + + child: Wrap( + clipBehavior: Clip.antiAlias, + alignment: WrapAlignment.center, + crossAxisAlignment: + WrapCrossAlignment.center, + runAlignment: WrapAlignment.center, + children: [ + Text( + sh.name!, + style: Theme.of(context) + .textTheme + .labelMedium, + ), + IconButton( + onPressed: () { + confirmAlert( + context, + () => context.read().add(DeleteSkillHobbies( + profileId: + profileId, + skillsHobbies: [ + sh + ], + token: + token)), + "Delete", + "Confirm Delete"); + + }, + icon:const Icon( + Icons.delete, + size: 16, + color: second, + )) + ]), + ) + ], ); }).toList()), ); @@ -81,6 +185,15 @@ class SkillHobbiesScreen extends StatelessWidget { "You don't have any Skills and Hobbies added. Please click + to add"); } } + if (state is AddHobbySkillState) { + return AddHobbiesAndSkillsScreen( + profileId: profileId, + token: token, + ); + } + if (state is ShowAddModalState) { + return AddModal(bloc: bloc); + } return Container(); }, ); @@ -95,3 +208,84 @@ class SkillHobbiesScreen extends StatelessWidget { )); } } + +class AddModal extends StatefulWidget { + final HoobiesBloc bloc; + const AddModal({super.key, required this.bloc}); + + @override + State createState() => _AddModalState(); +} + +String output = ''; +String? deletedChip, deletedChipIndex; +final keySimpleChipsInput = GlobalKey(); +final FocusNode focusNode = FocusNode(); + +class _AddModalState extends State { + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + return AlertDialog( + title: const Text("Add Skills and Hobbies"), + content: SimpleChipsInput( + separatorCharacter: ",", + createCharacter: ",", + focusNode: focusNode, + validateInput: true, + autoFocus: true, + formKey: keySimpleChipsInput, + onSubmitted: (p0) { + setState(() { + output = p0; + }); + }, + onChipDeleted: (p0, p1) { + setState(() { + deletedChip = p0; + deletedChipIndex = p1.toString(); + }); + }, + onSaved: ((p0) { + setState(() { + output = p0; + }); + }), + chipTextStyle: const TextStyle( + color: Colors.white, + fontSize: 16, + ), + deleteIcon: const Icon( + Icons.delete, + size: 14.0, + color: second, + ), + widgetContainerDecoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.0), + border: Border.all(color: Colors.blue[100]!), + ), + chipContainerDecoration: BoxDecoration( + color: second, + borderRadius: BorderRadius.circular(50), + ), + placeChipsSectionAbove: false, + ), + actions: [ + ElevatedButton( + onPressed: () { + keySimpleChipsInput.currentState!.save(); + context + .read() + .add(GetAddedHobbiesSkills(addedHobbiesSkills: output)); + }, + style: mainBtnStyle(primary, Colors.transparent, second), + child: const Text(submit), + ) + ], + ); + }, + ); + } +} diff --git a/lib/screens/profile/components/other_information/skills_hobbies/add_modal.dart b/lib/screens/profile/components/other_information/skills_hobbies/add_modal.dart new file mode 100644 index 0000000..cbcdc47 --- /dev/null +++ b/lib/screens/profile/components/other_information/skills_hobbies/add_modal.dart @@ -0,0 +1,73 @@ +import 'dart:math'; + +import 'package:filter_list/filter_list.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:unit2/bloc/profile/other_information/hobbies/hoobies_bloc.dart'; +import 'package:unit2/model/profile/other_information/skills_and_hobbies.dart'; +import 'package:unit2/theme-data.dart/colors.dart'; + +class AddHobbiesAndSkillsScreen extends StatefulWidget { +final int profileId; +final String token; + const AddHobbiesAndSkillsScreen({super.key,required this.profileId, required this.token}); + + @override + State createState() => + _AddHobbiesAndSkillsScreenState(); +} + +class _AddHobbiesAndSkillsScreenState extends State { + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + if(state is AddHobbySkillState){ + final List selectedList= state.mySkillsAndHobbiesString.map((var element){ + return state.allSkillsAndHobbies.firstWhere((var data) => data.name == element ); + }).toList(); + return FilterListWidget( + themeData: FilterListThemeData(context,choiceChipTheme: const ChoiceChipThemeData(selectedBackgroundColor: primary)), + hideSelectedTextCount: true, + listData: state.allSkillsAndHobbies, + selectedListData: selectedList, + onApplyButtonClick: (list) { + // Navigator.pop(context, list); + context.read().add(AddHobbyAndSkills(profileId: widget.profileId, token: widget.token, skillsHobbies: selectedList)); + }, + choiceChipLabel: (item) { + + return item!.name; + }, + // choiceChipBuilder: (context, item, isSelected) { + // return Container( + // padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12), + // margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10), + // decoration: BoxDecoration( + // border: Border.all( + // color: isSelected! ? Colors.blue[300]! : Colors.grey[300]!, + // )), + // child: Text(item.name), + // ); + // }, + validateSelectedItem: (list, val) { + /// identify if item is selected or not + return list!.contains(val); + }, + onItemSearch: (user, query) { + /// When search query change in search bar then this method will be called + /// + /// Check if items contains query + return user.name!.toLowerCase().contains(query.toLowerCase()); + }, + + ); + } + return Container(); + }, + ); + } +} diff --git a/lib/sevices/profile/work_history_services.dart b/lib/sevices/profile/work_history_services.dart index bd0f595..8e45820 100644 --- a/lib/sevices/profile/work_history_services.dart +++ b/lib/sevices/profile/work_history_services.dart @@ -43,7 +43,7 @@ class WorkHistoryService { } -//delete workhistory +////delete workhistory Future delete( {required int profileId, required String token, @@ -84,7 +84,7 @@ class WorkHistoryService { } - //edit work history + ////edit work history Future> update({required WorkHistory oldWorkHistory, required WorkHistory newWorkHistory, required String token, required String profileId})async{ Map? statusResponse={}; String authtoken = "Token $token"; @@ -111,7 +111,7 @@ class WorkHistoryService { "_oldAgencyId":oldWorkHistory.agency!.id, "oldFromDate":oldWorkHistory.fromDate?.toString(), }; - // try{ + try{ http.Response response = await Request.instance.putRequest(path: path, headers: headers, body: body, param: {}); if(response.statusCode == 200 ){ Map data = jsonDecode(response.body); @@ -120,12 +120,12 @@ class WorkHistoryService { statusResponse.addAll({'success':false}); } return statusResponse; - // }catch(e){ - // throw e.toString(); - // } + }catch(e){ + throw e.toString(); + } } - //Add work history + ////Add work history Future>add({required WorkHistory workHistory, required String token, required int profileId , required bool isPrivate})async{ String authtoken = "Token $token"; String path = '${Url.instance.workhistory()}$profileId/'; diff --git a/lib/sevices/skillshobbies_services.dart b/lib/sevices/skillshobbies_services.dart index 2666033..c09d67f 100644 --- a/lib/sevices/skillshobbies_services.dart +++ b/lib/sevices/skillshobbies_services.dart @@ -1,5 +1,3 @@ - - import 'dart:convert'; import 'package:unit2/utils/request.dart'; @@ -7,34 +5,120 @@ import 'package:unit2/utils/request.dart'; import '../model/profile/other_information/skills_and_hobbies.dart'; import '../utils/urls.dart'; import 'package:http/http.dart' as http; -class SkillsHobbiesServices{ + +class SkillsHobbiesServices { static final SkillsHobbiesServices _instance = SkillsHobbiesServices(); static SkillsHobbiesServices get instance => _instance; - - Future> getSkillsHobbies(int profileId, String token)async{ - - List skillsAndHobbies = []; - String authToken = "Token $token"; - String path = "${Url.instance.getSkillsHobbies()}$profileId/"; +////GET + Future> getSkillsHobbies( + int profileId, String token) async { + List skillsAndHobbies = []; + String authToken = "Token $token"; + String path = "${Url.instance.skillsHobbies()}$profileId/"; Map headers = { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': authToken }; - try{ - http.Response response = await Request.instance.getRequest(path: path,param: {},headers: headers); - if(response.statusCode == 200){ - Map data = jsonDecode(response.body); - if(data['data']['skill_hobby'] != null){ - data['data']['skill_hobby'].forEach((var hobby){ - SkillsHobbies skillsHobby = SkillsHobbies.fromJson(hobby); - skillsAndHobbies.add(skillsHobby); - }); + try { + http.Response response = await Request.instance + .getRequest(path: path, param: {}, headers: headers); + if (response.statusCode == 200) { + Map data = jsonDecode(response.body); + if (data['data']['skill_hobby'] != null) { + data['data']['skill_hobby'].forEach((var hobby) { + SkillsHobbies skillsHobby = SkillsHobbies.fromJson(hobby); + skillsAndHobbies.add(skillsHobby); + }); + } } + } catch (e) { + throw e.toString(); } - }catch(e){ - throw e.toString(); + return skillsAndHobbies; } - return skillsAndHobbies; + +////ADD + Future> add( + {required List skillsHobbies, + required int profileId, + required String token}) async { + String authToken = "Token $token"; + String path = "${Url.instance.skillsHobbies()}$profileId/"; + Map headers = { + 'Content-Type': 'application/json; charset=UTF-8', + 'Authorization': authToken + }; + Map body = {"skill_hobby": skillsHobbies}; + Map statusResponse = {}; + try { + http.Response response = await Request.instance + .postRequest(path: path, param: {}, headers: headers, body: body); + if (response.statusCode == 201) { + Map data = jsonDecode(response.body); + statusResponse = data; + } else { + statusResponse.addAll({'success': false}); + } + } catch (e) { + throw e.toString(); + } + return statusResponse; + } + + Future delete( + {required int profileId, + required String token, + required List skillsHobbies}) async { + String authToken = "Token $token"; + bool success = false; + String path = "${Url.instance.skillsHobbies()}$profileId/"; + Map headers = { + 'Content-Type': 'application/json; charset=UTF-8', + 'Authorization': authToken + }; + + + Map body = { + "skill_hobby": [skillsHobbies] + }; + try { + http.Response response = await Request.instance.deleteRequest( + path: path, headers: headers, body: body, param: {}); + if (response.statusCode == 200) { + Map data = jsonDecode(response.body); + success = data['success']; + } + } catch (e) { + throw e.toString(); + } + return success; + } + + ////GET ALL + Future> getAllSkillsHobbies() async { + List skillsAndHobbies = []; + String path = Url.instance.getAllSkillsHobbies(); + Map headers = { + 'Content-Type': 'application/json; charset=UTF-8', + }; + try { + http.Response response = await Request.instance.getRequest( + param: {}, + path: path, + headers: headers, + ); + if (response.statusCode == 200) { + Map data = jsonDecode(response.body); + if (data['data'] != null) { + data['data'].forEach((var element) { + SkillsHobbies skillsHobbies = SkillsHobbies.fromJson(element); + skillsAndHobbies.add(skillsHobbies); + }); + } + } + } catch (e) { + throw e.toString(); + } + return skillsAndHobbies; } } - diff --git a/lib/utils/urls.dart b/lib/utils/urls.dart index 578ab1b..ef2d994 100644 --- a/lib/utils/urls.dart +++ b/lib/utils/urls.dart @@ -5,9 +5,9 @@ class Url { String host() { // return '192.168.10.221:3003'; // return 'agusandelnorte.gov.ph'; - // return "192.168.10.219:3000"; + return "192.168.10.219:3000"; // return "devweb.agusandelnorte.gov.ph"; - return 'devapi.agusandelnorte.gov.ph:3004'; + // return 'devapi.agusandelnorte.gov.ph:3004'; } String authentication() { @@ -82,9 +82,12 @@ String getVoluntaryWorks(){ } //// skills hobbies -String getSkillsHobbies(){ +String skillsHobbies(){ return "/api/jobnet_app/profile/pds/other/skill_hobby/"; } +String getAllSkillsHobbies(){ + return "/api/jobnet_app/skill_hobby/"; +} //// orgmemberships String getOrgMemberShips(){ return "/api/jobnet_app/profile/pds/other/org_membership/"; diff --git a/pubspec.lock b/pubspec.lock index e2e4eda..f35808f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -853,6 +853,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.3.0" + simple_chips_input: + dependency: "direct main" + description: + name: simple_chips_input + sha256: "522b2e715fe67f325693e003acfd09fc0b8ab25a2c0c87fb8e5ce5b23a8a2ec1" + url: "https://pub.dev" + source: hosted + version: "1.0.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index ddcc03c..bc3e3a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,6 +72,7 @@ dependencies: modal_progress_hud_nsn: ^0.3.0 searchfield: ^0.7.5 filter_list: ^1.0.2 + simple_chips_input: ^1.0.0 dev_dependencies: