there two small issues: you are using cos() for X and sin() for Y, that gives a 90 degrees rotation reading on the needles. you can use sin() for X and -cos() for y another one: minHandY hourHandY and secHandY should use centerY not centerX... you only notice the bug when the canvas is not square... anyway, I loved the video!! thanks
I loved the fact you took your time to explain the mathematics things. Most tutorials lack on this part, but you did your best to let us understand the logic behind the clock. I would really love if you made explain mathematically how all this draw works! Can you??? Please??
This is one of the best tutorials I found out on yt. Super easy to follow through, explained briefly everything. Awesome man! You are seriously underrated. 🔥
@@Grewal0007 Hey Gurpreet. www.mathsisfun.com/polar-cartesian-coordinates.html This is a basic application of polar coordinates, I'm still in highschool, I searched it up. It's easily understandable, hope it helps
No body is gonna explain better than u 😍🔥......thanks a lot brother......... And plz make a vedio on that maths logic, Angle, offset..... Plz brother plzz
You would get better smooth movement of all three hands with something like this: void main() { var now = DateTime.now(); print(now); var midnight= DateTime(now.year, now.month, now.day); var diff = now.difference(midnight); print(diff); var secs = diff.inMilliseconds / 1000 ; print(secs); print(secs % 60); print(secs / 60 % 60); print(secs / 60 / 60 % 12); } It will need translation to turn those three values into radians, but they'll be much smoother, like a real analog clock.
Hello what should i remember from school math to master and to draw everything i want? Cause spend a lot of time and still no idea how to realize some things
Awesome. Please share how the Stateful widget code was added automatically to the code together with the State class code added to vs studio automatically fast?
Question: var centerX = size.width / 2; var centerY = size.height / 2; var radius = min(centerX, centerY); if width = 200 height = 400 min would return 200, making the radius 200. but isn't the radius supposed to be the length from the center of the circle to the edge? so the 'real' radius would be 50?
It will return radius as 100, centerX and CenterY are already half of width and height. This is to keep the circle ⭕️ of minimum size which can fit in screen
how to feed that class/widget from the homepage, how to add parameters to the class? Let's say I want to make several clocks with different time inputs.
I saw some bugs where Y coodinates are calculated based on centerX not centerY. I think a repo with branches or tags for different video stages would be better than a gist. But thanks for the video and code.
Hey is there something like erase with the help of which we can erase whatever we have drawn. I know about the complete removing/erase of the screen. I want to know about something with the help of which we can erase only a section of what we have drawn.
I made dashes outside of the circle from 2 to 16(which divides the circle into equal parts). Have point! how can we make it all divisions to start from 12? @Codex
Yes, and that may sound too much.. but in fact its very normal process! On Flutter we get at low level where we talk about rendering and painting, otherwise its just the process of widget update.
Hi, Codex It was a very nice video and content. I want to ask something. After making the design on Adobe XD and printing it out for flutter, do these clock settings come automatically or did you adjust it manually?
Thank you for this fun tutorial....too much Maths :( ....but I followed your tutorial and my clock is up and running....I wish I had good understanding of maths like you do....please provide some link if you could... so I can learn this maths from there.
Everything is fine but even after following along, my state is not updating. I don't what's the problem. Edit: It's working fine. I had to restart app instead of hot reload.
I need help. My project requires me to do custom painting On an image. Like basically an image of a map has to be the background, and upon that image I have to do custom painting like drawing circles, pointers and such. How can this be done?
Excuse me sir.. but your clock is rotated around 90 degrees to the right. 12 is on the clock I created at the point where usually 3 o clock would be... how can I fix this... but still an amazing video:)
double dot (..) is called cascade operator. It's used to access the object without specifying name. So, on same object you can perform multiple operation with cascade operator.
@@_haptic_shorts This logic, some of the times even experienced codes don't know all this that's why they try to master mathematics in university or they all question in stack overflow. www.mathsisfun.com/polar-cartesian-coordinates.html This is the logic CodeX used, he found it on stack overflow too, don't worry
sir can you help me and explain the part of draw dashes,I am really thankfull to you .i can not understand why we callculate the outer Circle Radius and inner circle Radius .kindly help me plz and explain this part. var outerCircleRadius=radius; var innerCircleRadius =radius-14; for(double i=0;i
⭕️ look at this emoji or think of donut 🍩 , if you want dash lines between thickness of donut.. you need two points p1 from center to inner radius, p2 from center to outer radius... thats the funda used here. To draw a dash line we need x1,y1 and x2,y2 which are of 2 different radius 👍🏼
The video isn't working properly.. and not because my internet connection or device, other videos on RU-vid are working fine except this video Anyone else noticed something like that?