Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hey am not sure if this is an issue or not can you check it out #4

Open
Amein-Eskinder opened this issue Aug 30, 2021 · 0 comments
Open

Comments

@Amein-Eskinder
Copy link

       Padding(
                  padding:   EdgeInsets.symmetric(horizontal: 20, vertical: 18),
                  child: Container(
                    height: 50,
                    child: SwipingButton(
                              // backgroundColor: Colors.white,
                              text: btnTitle,
                              backgroundColor: btnColor,
                              onSwipeCallback: () async {
                                if (status == "accepted") {
                              status = "arrived";
                              String rideRequestId =
                                  widget.rideDetails.ride_request_id;
                              newRequestsRef
                                  .child(rideRequestId)
                                  .child("status")
                                  .set(status);

                              setState(() {
                                btnTitle = "Start trip";
                                btnColor = Colors.green;
                              });
                              showDialog(
                                context: context,
                                barrierDismissible: false,
                                builder: (BuildContext context) =>
                                    ProgressDialogue(message: "Please wait..."),
                              );
                              await getPlaceDirection(widget.rideDetails.pickup,
                                  widget.rideDetails.dropoff);
                              Navigator.pop(context);
                            } else if (status == "arrived") {
                              status = "onride";
                              String rideRequestId =
                                  widget.rideDetails.ride_request_id;
                              newRequestsRef
                                  .child(rideRequestId)
                                  .child("status")
                                  .set(status);

                              setState(() {
                                btnTitle = "End trip";
                                btnColor = Colors.red;
                              });
                              initTimer();
                            } else if (status == "onride") {
                              endTheTrip();
                            }
                              }
                            ),
                  ),
                ),

If you read my code on each swipe I wanted to change the color and text of the button based on status which found online and when I do that nothing works still it sows me the color and the text that was earlier initialized with.
not sure but i think it not rebuilding,
but if I use a button it works fine
please bro enlighten me

@Amein-Eskinder Amein-Eskinder changed the title Hey am not sure if this is an issue or not Hey am not sure if this is an issue or not can you check it out Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant