r/FlutterDev • u/kherel • Oct 06 '20
Example I've implemented design from dribble
I've made my version of https://dribbble.com/shots/6315218-IoT-Humidity-App-Slider
The result: https://github.com/kherel/flutter_fun/blob/master/gifs/humidity_app_res.gif
The code: https://github.com/kherel/flutter_fun
Maybe it could be interesting for someone. I hope you'll like it.
4
u/pickleback11 Oct 06 '20
while I can't give you props for the overall design, the implementation is cool and impressive in flutter. good work!
1
2
2
2
2
0
u/erwinodyssey Oct 06 '20
Let's say when i found out u did it in flutter i got horny... no homo :) great work keep it up
-8
Oct 06 '20
I'm always torn when seeing excellent execution in code like this, but somehow people manage to mess up spelling even with today's IDEs (built-in spellcheck) & even simply reusing words:
"_SliderCliper extends CustomClipper<Path>" and many more - how does one get good at coding without at least not butchering stuff *this obvious*?
This isn't supposed to disrespect the level of people's second or n-th language, but it makes my brain trip when reading such code and frequently causes me to lose time/focus when working with other's code :-/
5
u/kherel Oct 06 '20
Sorry. I've change the name of CustomClipper to _MovingCurvedCliper, is it more clear?
Feel free to rename and make a pull request, when you have free time.
3
u/CuriousCursor Oct 06 '20
Some people just care more about implementing stuff than spellings, especially when it's just a proof of concept.
0
Oct 06 '20
[deleted]
2
u/kherel Oct 06 '20
I'm doing the same thing: I've made a screenshot of the video, add screenshot in Figma and measure sizes.
When I need to do it more responsible of the size of the screen, I'm using LayoutBuilder and set sizes in percentage of the widget size.
0
Oct 06 '20
[deleted]
1
u/kherel Oct 06 '20
Make sure that the size of the screenshot in Figma is the same size of design mock. For example here they used iPhone X in design. I know that the size of screen for iPhone X is 812pt. So if I sized the screenshot to 812 px. I could easily get to know which font size they used.
0
Oct 06 '20
[deleted]
2
u/kherel Oct 06 '20
Another method that I used. Is to add the screenshot as background image, to check if there are any mistakes in sizes.
3
Oct 07 '20
[removed] — view removed comment
4
u/kherel Oct 07 '20 edited Oct 08 '20
How I got these numbers.
Part I.
I put a screenshot of the design in Figma
Drawn a curved line , added a width.
Converted the line to path(outline stroke).
Set height for 100px.
Copied as svg, took path from svg.
Part II.
Added path_parsing package.
Create my own PathPrinter, you can find example of PathPrinter in example of the package (https://pub.dev/packages/path_parsing/example)
Print the lines in terminal.
Manually added it in the getPath method.
Because I know that the maximum height is 100px, I used size.height/100 as a basic step.
Because I know know that PathPrinter used cubicTo method to describe curved lined, and only cureved lines are moving in my widget, I added deltaY to all cubicTo Y points.
2
5
u/Doroc0 Oct 06 '20
Very good. This is incredible.
Also, how do you manage to find this design?
Some feedback: In humidty_screen.dart line17 to 24 use a multiprovider https://pub.dev/documentation/provider/latest/provider/MultiProvider-class.html