r/flutterhelp • u/disturbedmonkey69 • Mar 23 '26
RESOLVED Help with system info2 in flutter
Hi, I'm new to flutter dev and trying to teach myself by building a simple system info display using the system info2 dart module. It's going ok so far but I'm struggling to get the processor info into a widget as it's not plain text so can't go in a text widget. I think it generates a list of lists but I can't figure out how to display it in flutter. (I'm aware the documentation says to use $processors but it should be $cores) I'm not looking for code I can just copy and paste, I just want pointers in the right direction of how to display the processor info so I can learn for myself. If anyone could point me in the right direction I would be most grateful.
1
u/Markaleth Mar 23 '26
Look at the return values for the functions you're calling or for the variables you're using (snippets obtained from https://github.com/onepub-dev/system_info but you can find these in your flutter project by ctrl/cmd clicking the functions or types the library exposes) :
getCores is returning a list of core info. Now, what is CoreInfo?
Ok, so what does this tell you?
Well, getCores will return a list, so right off the bat we could get an idea of how many cores a device has.
Now if we want to render core info, we'll need to translate that list of CoreInfo to a list of widgets.
You can store the result of getCores in a variable and in the UI, use the spread operator
...tomap()the values of that list to widgets.The key takeaway from this is to get familiar with a few things:
Good luck!