Hello everyone in the dart community,
I've just started working with Dart, I'm exploring and trying to learn how
it works and so far it's been a great journey. However, I just run into a
problem which I haven't been able to figure out yet. I'm probably missing
something very simple.
I have the following html:
<div id="test"><a href="photos/photo12.jpg"><img
What I'm trying to do is get the width of both, the div and the img. So far
I have been able to get the width for the image but I can't find a way to
get the width of the div. This is the code that I have in place:
int imgWidth = query('#test').query('img').width;
int divWidth = query('#test').width;
The first line works like a charm, but the second one is raising an error.
I have been researching and I have found some sources saying that using the
dart:dom library is the way to go, but since that library has been
deprecated, I'm trying to find a way to accomplish this by just using
the dart:html library.
Thank you so much for any help or guidance, it's very appreciated. :)