Flutter framework of technical research

 

1 . Brief: Flutter is released google for creating cross-platform, high-performance mobile application framework, currently available on Android, iOS, Web and even desktop applications.
2 . Prospects:
Cordova: Apache project, its implementation principle is encapsulated inside a WebView, then write mobile applications through web technology, performance is very low.
Weex or React Native: using Web technology stack, the native UI controls rendered. The disadvantage is the need for communication between JavaScript and native when rendering, and JavaScript is a scripting language that requires JIT (Just In Time) are performed efficiently and AOT (Ahead Of Time) code that gap.
Flutter: do not use the native rendering, but their own implements a rendering engine. Dart and use language such as AOT language development language, the efficiency is not as JavaScript. And Google are working to promote Flutter, high activity on the github.
3 . Flutter related
Development Language: Dart
Official website: HTTPS: // flutter.dev/ 
development tools: Android Studio / VS code by installing associated plug
 4 . Dart language Introduction:
Built-in types:
numbers: int (depending on the platform)、double(64 bit)
String : utf-16
Booleans : bool b = true;
Lists: it is more arrays, var List = [ . 1 , 2 , . 3 ];
Maps: var gifts = {"fist": "partridge", "second": "golden rings};
Runes: utf-32的string
Symbols 
Dart language is a true object-oriented language, is also seen as a function of an object, and the same type and Function
Use the class keyword to define classes for the interface, the interface keyword is not defined. So how is it embodied? Indeed, each class will implicitly define an interface.
Asynchronous Programming: using async and await and Future work together to achieve asynchronous programming so as to achieve the same synchronization code to write asynchronous programming

Future<AMapLocation> _getLocation() async {
  await AMapLocationClient.startup(new AMapLocationOption(
      desiredAccuracy: CLLocationAccuracy.kCLLocationAccuracyHundredMeters));
  return await AMapLocationClient.getLocation(false);
}
.........
. 5 . Flutter application mode frame:
Flutter used as the base frame, providing native plugin (because some functions such as acquiring positioning, and to achieve the required native inform Flutter) to build an application mode. This model applies to a newly created App
As the base frame using native, the new function, a new page is achieved by Flutter, then added to the native code to dependent manner. This model is suitable for existing App,
6 . Flutter operating modes:
debug mode: for development and debugging, and the use of hot reload technology, build fast, but some Caton
release mode: release mode, run smoothly, comparable to native applications, even more smoothly than the native
7 . Build Mode Flutter of UI:
Using mvvm, a declarative UI
Compared to the traditional command-style UI programming (either Android, iOS or the Web, if we want to change the ui shows that we all need some form to locate the control, and then by providing a control method of the control command Explicit modified), so that you are more focused Flutter build the UI, data changes implemented by direct setState (() {}) method, resulting in a change in the UI:
setState(() {
  windDir = data?.condition?.windDir;
  windLevel = data?.condition?.windLevel;
  humidity = data?.condition?.humidity;
  temperature = data?.condition?.temp;
  tempDay = date? temp? .tempDay;
  tempNight = data?.temp?.tempNight;
  condition = data?.condition?.condition;
});

Text('${windDir ?? "-"}  ${windLevel ?? "-"}级',
    style: TextStyle(color: Colors.white,
       fontWeight: FontWeight.w300,
       fontSize: 18),
     ),

8 . Learn to use packages
When we needed some plugin development process or package, we can HTTPS: // on pub.flutter-io.cn/packages/ site search to meet the development needs of their own plugin, and then use in the project. How to select the package, repository of address we can offer in the package, to see the number of star to decide whether to choose. 
9 . Development Information:
dart:https://dart.dev/    《Mastering Dart》
Flutter:https://flutter.dev/    https://book.flutterchina.club/chapter1/

 

Guess you like

Origin www.cnblogs.com/sea-stream/p/12192841.html