'AssetImage' is not a subtype of string 'image' [closed] - flutter

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
this is the class for creating category cards
and this is where am i trying to pass AssetImage parameter but shows error
Can someone tell me how to pass image address as argument if possible

Hello using your reference https://i.stack.imgur.com/DHQZm.png
I suggest in line number 91 instead of passing AssetImage pass the argument in a String type which contains the path of your image file
Example :
CategoryCard(
image : "image_path",
"title" : "Free",
"press" : (){},
"key" : null
)

Related

validator does not work when trying to login and the field is empty [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Codes Link Github
I don't have any problems in the editor but the validator does not work when trying to login and the field is empty
So the issue I fouded is that the validate argument in your defaultFormField is not working.
In your components.dart file :
You are declaring the following argument: (Line 28)
required Function validate,
You are calling this argument like this: (Line 43 to 45)
validator: (value){
validate(value);
},
The issue is that the value of your callback in the validator function is not returned. So the validator cannot work. So you need to do the following :
Return the value of the callback
validator: (value){
return validate(value);
},
Modify the declaration of your argument
required String? Function(String?) validate,

Convert array into comma separated value of String [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have an array and I want to convert it into String but separated each element by '","
List<String> list = ["India","China","USA"];
var string = list.join(',');
print(string); //output = "India,China,USA"

How do I sort an array of an array in Swift 5 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
For example I have
[
["A",1]
["B",5]
["C",3]
]
How do i sort it so that it returns in Highest to lowest value B, C, A
You can do in following way:
a.sort {
return $0.last as! Int > $1.last as! Int
}
Don't forget to add additional checks while using this code, case where the last item is not an integer or there is an array not in the expected format. Otherwise, it will lead to a crash.

Drop Down GUI matlab [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
function DoneButtonPushed(app, event)
assignin('base','roll_no_GUI1',app.StudentInfoDropDown.Value);
assignin('base','projname_GUI1',app.ProjectInfoDropDown.Value);
assignin('base','roll_no_GUI2',app.StudentInfoDropDown_2.Value);
assignin('base','projname_GUI2',app.ProjectInfoDropDown_2.Value);
assignin('base','roll_no_GUI3',app.StudentInfoDropDown_3.Value);
assignin('base','projname_GUI3',app.ProjectInfoDropDown_3.Value);
assignin('base','roll_no_GUI4',app.StudentInfoDropDown_4.Value);
assignin('base','projname_GUI4',app.ProjectInfoDropDown_4.Value);
assignin('base','roll_no_GUI5',app.StudentInfoDropDown_5.Value);
assignin('base','projname_GUI5',app.ProjectInfoDropDown_5.Value);
closereq
end
Hi, I am creating a GUI which contains DropDowns. They are 10 dropdowns as you can see from the code. And I am using assignin to save each one of them into base workspace. But I would like to club all of them into a 2 char array's or 2 cell array's and send only two variables into the base workspace viz, Roll_nos and Projnames_GUI
Create two cell arrays and assign them in the base workspace:
roll_nos = {
app.StudentInfoDropDown.Value,
app.StudentInfoDropDown_2.Value,
app.StudentInfoDropDown_3.Value,
app.StudentInfoDropDown_4.Value,
app.StudentInfoDropDown_5.Value
};
projnames_gui = {
app.ProjectInfoDropDown.Value,
app.ProjectInfoDropDown_2.Value,
app.ProjectInfoDropDown_3.Value,
app.ProjectInfoDropDown_4.Value,
app.ProjectInfoDropDown_5.Value
};
assignin('base','Roll_nos',roll_nos)
assignin('base','Projnames_GUI',projnames_gui)

Getting weirdly formatted NSDictionary value [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
var nsarray:[NSMutableDictionary] = [["object":["uid":["age":"26","gender":"male"]]]]
print(nsarray[0]["object"])
That is how it looks. I want to get the value "uid", so when it prints it is just "uid". Currently it is printing:
"uid":["age":"26","gender":"male"]
I want to get the "uid" value. Meaning when it prints it is just "uid". "uid" is a placeholder for a unique ID so I won't know what the uid is.
It looks like "object" key contains another dictionary, which has exactly one element. To get the first key, call allKeys to get keys, convert them to Array, and pick the the initial element:
let d = nsarray[0]["object"] as! NSDictionary
print(Array(d.allKeys)[0])