|
|
@@ -2,6 +2,7 @@ import '/backend/api_requests/api_calls.dart';
|
|
|
import '/backend/api_requests/api_streaming.dart';
|
|
|
import '/backend/schema/structs/index.dart';
|
|
|
import '/flutter_flow/flutter_flow_drop_down.dart';
|
|
|
+import '/flutter_flow/flutter_flow_icon_button.dart';
|
|
|
import '/flutter_flow/flutter_flow_theme.dart';
|
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
|
|
@@ -321,6 +322,62 @@ class _SelectStateDropDownComponentWidgetState
|
|
|
isSearchable: false,
|
|
|
isMultiSelect: false,
|
|
|
),
|
|
|
+ Builder(
|
|
|
+ builder: (context) {
|
|
|
+ if (FFAppState()
|
|
|
+ .favorieteGemeenteIds
|
|
|
+ .contains(FFAppState().gemeenteSelectId) ==
|
|
|
+ true) {
|
|
|
+ return FlutterFlowIconButton(
|
|
|
+ borderRadius: 8.0,
|
|
|
+ buttonSize: 40.0,
|
|
|
+ fillColor: Color(0xFFB50808),
|
|
|
+ icon: Icon(
|
|
|
+ Icons.favorite,
|
|
|
+ color: Colors.white,
|
|
|
+ size: 24.0,
|
|
|
+ ),
|
|
|
+ onPressed: () async {
|
|
|
+ await actions.drupalRequest(
|
|
|
+ 'POST',
|
|
|
+ 'https://uitgaanskrant.com/nl/flutterdrup/favorieten/unflag.json',
|
|
|
+ FFAppState().userSessionname,
|
|
|
+ FFAppState().userSessionid,
|
|
|
+ FFAppState().userToken,
|
|
|
+ '{\"entity_id\": ${FFAppState().gemeenteSelectId}, \"entity_type\": \"taxonomy_term\"}',
|
|
|
+ );
|
|
|
+ FFAppState().removeFromFavorieteGemeenteIds(
|
|
|
+ FFAppState().gemeenteSelectId);
|
|
|
+ safeSetState(() {});
|
|
|
+ },
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return FlutterFlowIconButton(
|
|
|
+ borderRadius: 8.0,
|
|
|
+ buttonSize: 40.0,
|
|
|
+ fillColor: Color(0xFFB50808),
|
|
|
+ icon: Icon(
|
|
|
+ Icons.favorite_border,
|
|
|
+ color: Colors.white,
|
|
|
+ size: 24.0,
|
|
|
+ ),
|
|
|
+ onPressed: () async {
|
|
|
+ await actions.drupalRequest(
|
|
|
+ 'POST',
|
|
|
+ 'https://uitgaanskrant.com/nl/flutterdrup/favorieten/flag.json',
|
|
|
+ FFAppState().userSessionname,
|
|
|
+ FFAppState().userSessionid,
|
|
|
+ FFAppState().userToken,
|
|
|
+ '{\"entity_id\": ${FFAppState().gemeenteSelectId}, \"entity_type\": \"taxonomy_term\"}',
|
|
|
+ );
|
|
|
+ FFAppState().addToFavorieteGemeenteIds(
|
|
|
+ FFAppState().gemeenteSelectId);
|
|
|
+ safeSetState(() {});
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ),
|
|
|
FFButtonWidget(
|
|
|
onPressed: () async {
|
|
|
context.pushNamed(HomeWidget.routeName);
|