skip to Main Content

How can I randomly order my elements in Flutter/Dart?

I'm trying to randomly order widgets that will appear in a column. Widget build(BuildContext context){ return Column( children: [ Question( questions[questionIndex]['singular'], ), ...(questions[questionIndex]['answers'] as List<Map<String, Object>>).map((answer) { return Answer(() => answerQuestion(answer['score']), answer['text']); }).toList() ], ); } I want to shuffle…

VIEW QUESTION

I want to extract only the numbers in this part of the URL.[Regular expressions] – Flutter

I want to extract this part. But I couldn't do it well. So I need you to tell me how to do it. Example) https://twitter.com/straw_berry0721/status/1596714080345415681?s=20&t=1nIbnSZ2YN2m5KZaOjO5GA 1596714080345415681 https://twitter.com/xxx/status/1595920708323999744 1595920708323999744 ・my code (failed) final result = _controller.text; t = s.lastIndexOf('status')); s.substring(t)

VIEW QUESTION

Flutter | Unhandled Exception: Bad state: No element using 'firstWhere' and 'orElse'

I am having trouble understanding how to return null using: orElse: () => null My method is the following: @override Future<People> searchPeople({required String email}) async { var user = auth.FirebaseAuth.instance.currentUser; final docs = await FirebaseFirestore.instance .collection('users') .doc(user!.email) .collection('people') .where('hunting', isEqualTo:…

VIEW QUESTION

return multiple values from dropdown in flutter

I have this custom dropDown button and I want to get two values when I select one value from the list. Here is the custom dropdown button Widget customJsonDropDown(List? jsonList, String? value, void onChange(val)) { return Container( decoration: BoxDecoration( borderRadius:…

VIEW QUESTION
Back To Top
Search