Look at the stars to know what is small, look at the cells to know what is vast, I am a giant, but also a grain of sand, lofty and humble ---- zhang Feng jie strong


I wrote this series for the following reasons:
2. I have been wanting to express my attitude when encountering new technology, so as to analyze my process of understanding a new thing. 3. As an authentic Javaer +Androider, I hope to pave a path for anyone who wants to get into the pit Flutter 5. The whole 7 articles run through my heart + thought of learning, basically knock out a test code, write a paragraph of article. My learning style is also a record and precipitationCopy the code

The seven articles are as follows:
  • Day 1 — Initial analysis +Dart Dialect +Canvas Sketch
  • Day 2 –Animation + Particle Motion
  • Flutter Day 3 — Basic Control (1)
  • Day 4 — Basic Control (2)+Flex layout detailed
  • Flutter day 5 — Layout instance + Operation interaction
  • Day 6 — Asynchronous — IO+ Network access + JSON
  • Day 7 — Font icon + Comprehensive sample +Android Code interaction

Here is the widget tree drawn as you learn

Although from the full version is still less than half, but the introduction is enough, the basic commonly used involves when you use these skilled, other controls to see the properties will be self-taught (recommended to see the original picture, more clear)

Day 1 and Insights:
The environment building of Flutter does not take many detours. There are a lot of tutorials online. I created a new project and found something wrong with the code. I knew that Flutter was a cross-platform framework, but where was the code written? Shouldn't there be a separate SRC? I've played with Libgdx before, and I think it's about right. Then I'll do a full-text search for the words on the interface and find them in the lib package main.dartCopy the code

I'm going to write code in Lib, right? It's not so weird, is it? Then I took an object-oriented look at Main. dart and it was just as weird as the first analysis. And the syntax and Java,c++,Python,Js are different, ok, again to learn dialect, since Js Es6 play, I am not afraid of language, Kotlin,Python, these personality"Unruly"Some of them are pretty much the same as ES6. Once you get the grammar right, then it's just a matter of ability, so Dart is pretty quick to get started, and it takes half a day to get pretty good at itCopy the code

[Passion] : share some mood ————-
I always think of programming as a sword. I have been refining the sword of Java, and I use the scabscabar of Android to put Python, C++, and Js in the scabscabar of Android. Whether I'm just playing with it or not, I think of it as an aura to attach to the sword of Java. To expand the field of vision, little effect upon the death of, remember the second bottleneck is fettered by network unable to step forward, then a grind, suspend the android, after go to look for the books and materials to look, also therefore had set up their website Then parallel, before and after the two big ring blessing, also launched my personal website, Both sides of the basic knowledge is basically in mind.Copy the code

Due to the construction of my personal website, I have some understanding of the server side, network requests, upload and download also know what is going on, and have a testing channel, if an Androider is not aware of the front and back end, the concept of data flow on the bottleneck of the network will be initially formed, in my eyes, Interface display, upload, download, everything on the network is a flow of bytes and then back to Android, the front and back end has been like a line through,Android and the server interaction is smooth, the second bottleneck has passed"The day the broken sword was reforged, the feeling of the knight returning."", the specific details, the plan to write a 2018 year-end summary to recordCopy the code
[External] : by ————-
How to receive a new thing (new knowledge) quickly? For example, if you are an astronomy fan, if you want to learn English, it is more beneficial to read astronomy books, because you have this knowledge reserve, even if the knowledge reserve is In Chinese, so what? Can the English earth come out of the solar system? Language and knowledge are two different things. Language expresses knowledge without changing knowledge itself. So knowledge docking, the interlocking of the two languages, will allow you to accept the language itself more quickly, but also strengthen the knowledgeCopy the code

Therefore, I did not start the control at the beginning, but drew based on the Canvas I was most familiar with. I was familiar with Dart syntax, otherwise it would not be easy to carry out the subsequent work. The rich knowledge of Canvas in Android enabled me to have a good docking with the Canvas in the Flutter. The coordinate system and n-angle star can be shown again. The old knowledge is transformed into new knowledge by changing the Java code into Dart code, which also makes me more clear about the similarities and differences between the two, and makes it easy to write in the futureCopy the code

All in all, the first day was fun and relaxing.


Day 2 and Experience:
The second day was a risky move. I planned to talk about the basic controls (there are a lot of controls I have heard about Flutter), but after the first day, I wanted to play animation very much. If I put it in the back, I felt inconsistent, but I did not know how to write the animation well. Let's challenge it, and then we'll do the animationCopy the code
The second day was the most successful I felt in the last seven days, the animation and particle motion were all copied onto the particle clock, which was quite exciting, and then I took the bai and thought, "Well, the Flutter is good." This was definitely the first particle clock of the Flutter (except for me, Maybe no one would be so bored doing this kind of special effects.)Copy the code
Dart's time handling and 3d arrays are a little different than Java's, and the clock's particle motion, which I almost gave up because the effect never came out. Thought, make a clock calculate, not also good. But really very unwilling, all to this step. Then output the number of ball set, the position of the first ball, the data is good ah, but why not to effect... Finally, the radius of the small ball is not set... The devil is out thereCopy the code
Someone asked me if I have any experience, experience this thing said out all understand, but it is not easy to do, if you think a person's learning style is very good, you should observe him, and then learn from each other. Everyone's circumstances are different. Other people's learning methods may not work for you. You don't have to be the same as others. For example, I like to write poetry in college, and then read all the great books, constantly thinking about the world, if you do not have these foundations, my experience may not be suitable for you. Everyone has different values. I am more inclined to improve myself and do not seek much material. Experience this thing, others are nonsense, if you need to pick their own online chicken soup, the average person's rhetoric, mostly just self-deception. Recently, I saw eight words quite true:"Life and death, do not accept.".Copy the code

Overall, the next day was a good one.


Day 3, Day 4 and Experience:
I like to draw a tree diagram of the system, because it looks clear and helps to organize my thoughts. I like cards, which are derived from Yu-Gi-oh. For various things, I feel it is interesting to record them with cardsCopy the code

On the third day, I read the source code more, basically I went in to see the control properties, and tested the code through the layout experience of Android and HTML + CSS. The basic routines were all the same and the Flex layout of Flutter and CSS happened to be the same, so it was much easier to get started. New things are often associated with old things, learning new things is best to quickly find the connection between it and the old things in your knowledge base, the number of connections depends on the amount of content in your knowledge base, the more connections, the faster you will be or the more you can master the old thingsCopy the code

I thought that the fourth day can finish the rest of the control, and then write a few small cases, never thought: The layout of the Flutter so much, plus a little card small shell, only managed to control settlement (and indeed many not covered) Flutter in 29 kinds of composite model is scaring me, this is also analyzed about how the situation analysis of the way My passion burn on the third day, the fourth day, the three controls a group, a total of 6 groups of 18, Finally, Flex layout is explained in detailCopy the code

These two days is not so difficult, it is a bit of trouble, drawing, with a card of what, just knock on the code estimate a day is enough, but it will and boring, the fourth day is not what I want to write finally in fact there are still many controls not involved, but the feeling is that Know that point, in a control can attribute is basically the, You don't have to list all of them when you meet new ones. That's it"Fish and Fishing"Fish is not caught, you can not put downCopy the code

Much more frequently, two source code is a little small feeling: there is a problem to solve, even out of ten new implications, the problem of stack you imagine, had a problem into the stack, solve the out of the stack, it won't mess, you is just for the stack, one by one, it will relative to 11 questions before you find it easier to accept. When to stackover is up to your determination and stamina. Of course, when the novice feels unable to hold, you can take a deep breath, bite your teeth and hold on. If that doesn't work, document the problem and quit. Maybe you now level is not enough, you can not fight this boss, then go to brush blame upgrade. The day the dagger was reforged, the knight returned. Now look back and see what was bothering me, and it's nothing, so you can feel grown upCopy the code

The third and fourth days were generally grueling, but it was a rite of passage


Day 5, 6, 7 and Experience:
After the first four days, basically the syntax, controls are familiar, next unified to say: Day 5 was very informative, there are very few examples of detailed analysis of the layout of Flutter on the Internet in Chinese. It's a little bit complicated, so I'm going to start with the simplest items and work my way up to the most interesting ones. There seems to be a lot of interoperations, but there are only a few that are commonly used. It's interesting that actions are widgetsCopy the code
Day 6 Dart IO, network and JSON processing, it's a language foundation Java and Python and NODE IO, so it's not a problem for Dart. 'path_provider' then permissions, of course, there is a corresponding dependency library 'simple_permissions', the network library is relatively simple to use, basically the same as the front-end network library operationCopy the code
The seventh day is the integration of the first six days and a little bit of a brush up on the other little things. The original interaction with Android gives me a feeling that Flutter is pretty good. It's a bit of a hassle but cross platform, only Android is half the battle, ios is not so good. You need one person to be both Android and ios, so there's a price to be paid for cross-platform. You might say, "Well, there's a plug-in package, but the plug-in package can only solve part of the problem. Different businesses vary"Make do"The Flutter is a good UI framework, but it's a little bit less maneuverableCopy the code

conclusion
People who are good React players may feel a lot more comfortable with Flutter because the thoughts are very similar and everyone has deficiencies and it is not possible to know everything about the world, that is"There is a specialty."But that doesn't mean that we have to shut ourselves off. There is nothing for a programmer to read poetry or look at history but to see the stars to know what is small, and to see the cells to know what is huge. You are both giant and sand, noble and humble. The program comes from the knowledge of the world. Learning is endless, do not drift, down-to-earth, step by step, the same road, new is the distance, think it will come.Copy the code

A final insight: I often think about the relationship between tools and their users:
The difference between 'using a tool' and 'knowing how to use a tool' is that the use of tools reflects the skills of a 'crafter'. "Paoding Takes care of cattle" is my favorite ancient article, how to do anything: It is my thinking that the eight characters in the text become the law for me to touch new things: according to heaven, because it is true. With its principle, party, is ` artisan ` and ` craftsman ` differences If you don't understand the structure of the bovine principle, a knife is one can kill cows for meat, but my [to the god meet but not to the visual, officer check and god wants] [carry knives, healthy, ambitious, good sword and hide] feeling is not with you, and this was an artisan's pride. Writing a program is like creating a piece of art. The process of manufacturing is' ox solution '. IDE, API and operating environment are swords in my hands. Life has its limit, and knowledge is infinite. May you do your best and cherish it.Copy the code