当前位置: 首页>后端>正文

一分钟带你了解Flutter

鍓嶈█

浣滀负2018涓栫晫绉诲姩澶т細鐨勫唴瀹逛箣涓€锛孏oogle鍙戝竷浜咶lutter鐨勭涓€涓?beta 鐗堟湰銆侳lutter 鏄?Google 鐢ㄤ互甯姪寮€鍙戣€呭湪 iOS 鍜?Android 涓や釜骞冲彴寮€鍙戦珮璐ㄩ噺鐨勫師鐢熷簲鐢ㄧ殑鍏ㄦ柊绉诲姩 UI 妗嗘灦銆傜幇鍦ㄥ氨鍙互鍘?flutter.io蹇€熶笂鎵嬪紑鍙戠簿缇庣殑鍘熺敓搴旂敤銆?/p>

浜屻€侀鍏堟垜浠鐞嗚В浠€涔堟槸璺ㄥ钩鍙般€?/h2>

浠€涔堟槸璺ㄥ钩鍙?/strong>锛熷鏋滀綘鏄Щ鍔ㄥ紑鍙戣€呯殑璇濓紝搴旇鐭ラ亾 Android 鏄娇鐢?Java\Kotlin 璇█鏉ュ紑鍙戣€?iOS 鍒欐槸 OC\Swift鏉ュ紑鍙戙€傚悇澶х鎶€鍦堝ぇ浣滑閮藉湪缁炲敖鑴戞眮鐨勬兂缁熶竴杩欎袱涓钩鍙帮紝鏃犺 Android 杩樻槸 iOS 閮芥槸绉诲姩绔紝鑻ヨ兘缁熶竴鐢ㄤ竴濂楄瑷€寮€鍙戝簲鐢ㄩ偅鏈€濂戒笉杩囩殑銆傝繖涔熸鏄法骞冲彴鐨勬剰鎬濓紝绠€鍗曠殑璇村氨鏄綘鍐欑殑鍚屼竴濂椾唬鐮佸彲浠ヨ繍琛屽湪涓嶅悓鐨勫钩鍙般€備笉浠呰兘澶熷ぇ澶у姞蹇紑鍙戠殑杩涘害锛屽悓鏃朵篃鑳藉噺灏戜汉鍔涙垚鏈殑鎶曞叆銆?/p>

Flutter灏辨槸鍦ㄨ繖绉嶇悊蹇典腑璇炵敓鍑虹殑璺ㄥ钩鍙版鏋躲€?/p>

Flutter 鐨勭洰鏍囨槸瑙e喅绉诲姩寮€鍙戜腑鐨勪袱涓噸瑕侀棶棰?/strong>锛?/p>

  1. 瀹炵幇鍘熺敓搴旂敤鐨勬€ц兘鍜屼笌骞冲彴鐨勯泦鎴?/li>
  2. 鎻愪緵涓€涓骞冲彴锛屽彲绉绘鐨?UI 宸ュ叿鍖呮潵鏀寔楂樻晥鐨勫簲鐢ㄥ紑鍙戙€?/li>

Flutter涓嶳eactNative鐨勫尯鍒紵

涓€涓槸 Facebook 鎺ㄥ嚭涓ゅ勾澶氱殑 ReactNative 锛屽彟涓€涓垯鏄?Google 杩欑椤剁骇绉戞妧鍏徃鐨勪骇鍝丗lutter銆傞偅涔堝畠浠湁浠€涔堝尯鍒憿锛?/p>

鐪嬭繃ReactNative婧愮爜鐨勬湅鍙嬮兘搴旇鐭ラ亾锛孯N涓殑缁勪欢閮界户鎵胯嚜Native View缁勪欢銆備緥濡傦細ReactNative 涓殑 ListView 鍦?Android 涓氨鏄户鎵胯嚜 ListView 锛岃繕鏈?RecycleView銆?/p>

鑰孎lutter鍒欎笉鍚岋紝瀹冪殑鎵€鏈?UI 缁勪欢閮芥槸涓€甯т竴甯х敾鍑烘潵鐨勩€傝繖鏍疯兘澶熷緢鍑嗙‘骞朵笖寰堢伒娲荤殑鍋氬嚭浣犳兂瑕佺殑 UI 銆?/p>

Flutter 浣跨敤 Dart璇█寮€鍙戣€?ReactNative 鍒欎娇鐢?JS 缁撳悎 XML 鏉ュ紑鍙戠殑銆?/p>

浼拌璇撮亾Dart璇█锛屽緢澶氭湅鍙嬮兘涓嶇煡閬撱€傚叾瀹烇紝鎴戜篃鏄垰鍒氱煡閬撱€傘€傘€?/p>

涓嬮潰灏辫閬撹閬揇art璇█銆?/p>

鍩轰簬Dart璇█寮€鍙戠殑Flutter妗嗘灦

dart璇█鏄敱璋锋瓕鍏徃寮€鍙戠殑缃戠粶缂栫▼璇█锛屼簬2011骞?0鏈?0鏃ュ彂甯冦€傝胺姝?010骞村唴閮ㄥ蹇樺綍鏄剧ず锛孌art鐨勭洰鏍囧氨鏄浠f浛JavaScript缃戠粶寮€鍙戦€氱敤璇█鐨勫湴浣嶃€?/p>

鐒惰€岋紝閭d箞澶氬勾杩囧幓浜嗐€傘€傘€備粖澶╁嵈浠ヨ繖绉嶆柟寮忓嚭鐜?/p>

鍏堟潵鐪嬫浠g爜

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(
              'You have pushed the button this many times:',
            ),
            new Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
            new Image.network(
              'https://raw.githubusercontent.com/flutter/website/master/_includes/code/layout/lakes/images/lake.jpg',
            )
          ],
        ),
      ),
      persistentFooterButtons: <Widget>[new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ) ]
      ,
      floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.

    );
  }
}

鏄笉鏄繕鍦ㄥ悇绉嶆嫭鍙峰拰宓屽涓瓊鐗垫ⅵ缁曞憿锛?/p>

鐩磋鎰熷彈灏辨槸娌℃湁RN鍐欒捣鏉ラ偅涔堢畝娲佹槑浜嗐€?/p>

鍦ㄧ煡涔庝笂鐪嬪埌鐨勪竴涓湡瀹炵殑娈靛瓙

涓轰粈涔團lutter 鐢?Dart 寮€鍙戝湪浼氬悗锛屾垜涔熶富鍔ㄧ殑鍘绘壘 Flutter 鐨勫紑鍙戜笓瀹?Divod 鑱婁簡浼氥€傛垜闂埌浠栦竴涓棶棰橈紝鎴戣涓轰粈涔堜綘浠細閫夋嫨鐢?Dart 璇█鏉ュ紑鍙戣€屼笉閫夋嫨鐢╔ML 鍜?JS 锛屼粠鍒氭墠鎮ㄧ殑浠g爜绀轰緥涓婃垜鐨勭涓€鎰熻灏辨槸娌℃湁 ReactNative 鐨勫彲璇绘€ч珮銆傚ぇ瀹朵篃璁歌寰楁垜澶ぇ鑳嗭紝鍦?Google 鐨勫満瀛愭彁 Facebook 鐨勪笢瑗裤€備絾鎶€鏈瘯绔熸槸鎶€鏈紝绋嬪簭鍛樹綍鑻︿负闅剧▼搴忓憳锛岃繖鏄竴鍦烘妧鏈殑浜ゆ祦銆傛渶鍚庯紝浠栦篃缁欎簡鎴戜竴涓弧鎰忓拰鏃犲姏鍙嶉┏鐨勭瓟妗堬紝鈥滃洜涓?Dart 鐨勫紑鍙戝洟闃熷氨鍦ㄤ粬浠梺杈癸紝浠栦滑鑳界粰鍒版垜浠緢蹇殑鏀寔銆傛垜浠兘寰堝揩娌熼€氬埌鈥濄€傛墍浠ユ垜涔熷氨榛樿浜?Flutter 娉ㄥ畾浼氫竴鐩翠娇鐢?Dart 杩欓棬璇█銆?/p>

涓夈€?Flutter鐨勪紭鐐?/h2>
  1. 璺ㄥ钩鍙扮殑浼樼偣涓嶅繀澶氳
  2. Flutter榛樿Meteria UI锛屽紑鍙戣捣鏉ヨ醇婧?/li>
  3. hot reload鐨勫紑鍙戞ā寮忛潪甯告柟渚匡紝鍩烘湰涓婂仛鍒板疄鏃舵煡鐪嬫敼鍙樼殑UI
  4. 灏嗘潵鍙戝竷鐨?Fuchsia OS 灏遍挦瀹氫簡 Flutter 浣滀负 UI Toolkit
  5. 浠庢€ц兘涓婃潵璁诧紝Flutter鏄姞鍒嗙殑銆?/li>

鍥涖€?Flutter鐨勭己鐐?/h2>
  1. 浣跨敤Dart寮€鍙戝鏄撻€犵伀绠煔€
  2. 鐩墠澶勪簬beta鐗堟湰锛屽晢涓氬寲鐨勮瘽杩橀渶瑕佸啀绛夌瓑銆傘€傘€傞鐭ラ亾浠€涔堟椂鍊?/li>
  3. 瀵逛簬IOS UIKit鏉ヨ锛孎lutter Meterial Design杩樹笉鑳藉彇浠d箣,鍙兘浣滀负涓€绉嶈ˉ鍏呫€?/li>
  4. 鍦ˋndroid 骞冲彴涓婏紝涓€涓灦鏋勭殑SO灞呯劧瑕?M宸﹀彸锛岀畝鐩翠笉鑳藉繊銆?/li>

瀵逛簬Flutter鎴戣繕鏄寔涔愯鎬佸害鐨勶紝浣嗘槸灏辩湅Google鍔姏鍚︿簡銆傚鏋滆兘鍍廡ensorflow鎴栬€匞olang閭f牱娴佽灏卞ソ浜嗐€傛兂鐜╃殑绔ラ瀷鍙互鎸佺画鍏虫敞Flutter鐨勫姩鍚戯紝濡傛灉鎯宠杩愮敤鍒板晢涓氶」鐩笂杩樻槸绛夌瓑鍚с€?/p>


https://www.xamrdz.com/backend/3xq1923351.html

相关文章: