Open yahu1031 opened 2 years ago
Make use of ScaffoldMessenger and make custom toasts.
I see them in
at_theme_flutter
at_events_flutter
at_location_flutter
at_contacts_group_flutter
I see you raised an issue on the fluttertoast repo. Let's wait to hear back from the fluttertoast maintainer if they can resolve the issue. Alternatively, if you know how to resolve the issue, you could do the fix and test it and submit a PR to FlutterToast
@gkc Yes, I did raise it in the rest of the repos that were being blocked by this package. Sadly I don't know the solution cause no traces were being found. So need to wait. And also this is a blocker for all the apps that use the above packages I mentioned. They can't move forward. They will get stuck on onboarding itself. I will wait for it and need to be discussed what to do in this scenario. Thanks.
What's latest on this @yahu1031 ?
@gkc Currently, no work is seen on that ticket. And also no activity was found. There was a solution that needs to be done from our side. That is, Remove the fluttertoast from the packages and create our own custom toasts with ScaffoldMessanger. We can create a package and use it.
@yahu1031 I'm reassigning priority to high, so we can add to PR43 or PR44
@sonle-geekyants @sachins-geekyants @nitesh2599 Any idea or updates?
void showToast(BuildContext? context, String msg,
{double? width, bool isError = false}) =>
ScaffoldMessenger.of(context!).showSnackBar(
SnackBar(
content: Text(
msg,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
color: isError ? Colors.white : Colors.black,
),
),
duration: const Duration(milliseconds: 3000),
elevation: 0,
margin: width != null
? null
: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.2),
backgroundColor: isError
? Colors.red[700]
: Colors.white,
padding: const EdgeInsets.all(10),
width: width,
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: Platform.isAndroid
? BorderRadius.circular(50)
: BorderRadius.circular(10),
),
),
);
This code block will show the toast same as now. So we can get rid of flutter toast package. LMK what do you think.
@yahu1031 Are we replacing toast message with snackbar ?
May be. I suggest to do so.
@Pritam-deb please test this branch by Minnu : https://github.com/atsign-foundation/at_widgets/tree/toast_fix
Where flutter toast is replaced by snackbar.
Moving this ticket requires validation
The text can be a bit bigger. The toast could also pop a bit higher.
@Pritam-deb can you share screenshots of both the UI? it will be easier to compare.
@Pritam-deb Toast has fontSize
and gravity
properties now.
minnu customToast.webm This is branch on which @yahu1031 worked in. flutterToast.webm Here, I have used FlutterToast here
Hence, looks good enough.
@Pritam-deb This issue from the fluttertoast seems fixed, Cross check this with fluttertoast package, If it works, use it. https://github.com/ponnamkarthik/FlutterToast/issues/391#event-7594635351
Which at_widget package you find issue with?
at_location_flutter
On what platforms did you experience the issue?
iOS
What version are you using?
at_location_flutter: ^3.1.6
What happened?
Because of the
fluttertoast
used inat_location_flutter
, we cannot pick any file from iCloud. Either thefluttertoast
can be a direct dependency or a transitive dependency the issue exists. I have raised a ticket regarding this issue. https://github.com/miguelpruivo/flutter_file_picker/issues/1003, https://github.com/flutter/flutter/issues/105919Steps to reproduce
flutter pub get
andcd ios && pod install
.flutter run
Additional info
fluttertoast
is the culprit. Happened in the new Buzz application.Relevant log output
Flutter analyze output
No response
Flutter doctor output
No response