Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flutter or React Native

Avatar for keinuma keinuma
November 17, 2020

Flutter or React Native

Avatar for keinuma

keinuma

November 17, 2020
Tweet

More Decks by keinuma

Other Decks in Programming

Transcript

  1. 回のお カミナシではReact Native + Expo を利⽤してる Flutter はReact Native と

    すると何が しいか知りた い 開発・ ⽤ 点でまとめてみた 2 / 32
  2. React Native パッケージ 理は npm or yarn Lint + Formatter

    は ESLint + Prettier ホットリロード 開発、リリースはExpo CLI が便利 9 / 32
  3. pubspec.yaml の例 name: flutter_sample environment: # Flutter SDK のバージョンを指 sdk:

    ">=2.7.0 <3.0.0" dependencies: # flutter: sdk: flutter dev_dependencies: flutter_test: sdk: flutter flutter: # アプリの基 Theme 、フォントの情 を できる uses-material-design: true 11 / 32
  4. React Native React のコア を利⽤してレンダリング React Native のコンポーネントがネイティブ のUI と⼀

    している React Native のView は Android の android.view であり iOS の UIView 14 / 32
  5. Flutter Flutter は FW のAPI を担うflutter/flutter と描 周りの flutter/engine がある

    flutter/engine は独⾃のレンダリングエンジ ンになっている 15 / 32
  6. React Native JSX を使ってHTML Like にかける Style を使ってCSS Like にレイアウト、⾒た

    ⽬を えられる 的な React Native ⾃体は のコンポーネント のみ UI ライブラリを利⽤することが い 18 / 32
  7. class MyAppBar extends StatelessWidget { MyAppBar({this.title}); final Widget title; @override

    Widget build(BuildContext context) { return Container( height: 56.0, padding: const EdgeInsets.symmetric(horizontal: 8.0), decoration: BoxDecoration(color: Colors.blue[500]), child: Row( children: <Widget>[ IconButton( icon: Icon(Icons.menu), tooltip: 'Navigation menu', onPressed: null ), Expanded( child: title, ), IconButton( icon: Icon(Icons.search), tooltip: 'Search', onPressed: null, ) ], ) ); } } 20 / 32
  8. UI React Native, Flutter 共に 的UI で す ることは⼀ UI

    コンポーネントの 度はFlutter が上 21 / 32
  9. React Native ローカルはhooks を利⽤ Global にはRedux, Mobx, Recoil, Rx が

    択 に 上がる Store を⼀つ持って各コンポーネントが 照、更 する 23 / 32
  10. 状 理 React Native, Flutter 共に の⼿ がある Flutter はまだまだメインの

    を い って いる mono さんは の Riverpod + Freezed + state_notifier をおすす めしてる 25 / 32
  11. React Native Unit Test: Jest Integration Test: Jest snapshot test

    or Storybook E2E Test: Cypress, Selenium 27 / 32
  12. React Native との み けは エコシステムの 点だとFlutter に 配が上がりそ う

    JavaScript をWeb と共有したい場 はReact Native が良さそう Flutter for web に期待 30 / 32