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

人気サービスをFlutter Webでリプレースするとどうなるのか

Koji Wakamiya
November 16, 2022

人気サービスをFlutter Webでリプレースするとどうなるのか

FlutterKaigi 2022 Day 1 17:45~18:15

Koji Wakamiya

November 16, 2022
Tweet

More Decks by Koji Wakamiya

Other Decks in Technology

Transcript

  1. ελσΟϓϥεגࣜձࣾ • Mission • ֶ ぶ ت び Λ͢ べ

    ͯͷਓ΁ • Value • Dive to Learn - ֶशऀͷͨΊʹ΍Ζ͏ • Fail Forward - ど Μ ど Μࣦഊ͠Α͏ • Far Together - ҧ͍ʹ׮༰ で ͋Ζ͏ 4
  2. ໨࣍ • Flutter Webͷ঺հ • Flutter Webͷ࠾༻ࣄྫ • Flutter Webͷಛ௃

    • ׆༻ͷͨΊͷ޻෉ • Flutter WebΛ࠾༻͢ΔͱͲ͏ͳΔ͔ 7
  3. Flutter Web • Flutter 2.0.0͔Βstable • fl utter build webίϚϯυʹΑΓSPAΛੜ੒

    • Dart੡ͷύοέʔδͰ͋Ε͹ར༻Մೳ • શͯͷύοέʔδ͕࢖͑ΔΘ͚Ͱ͸ͳ͍ • Windowؔ਺΍JSϥΠϒϥϦΛಡΈࠐΜͰར༻Ͱ͖Δ΋ͷ΋͋Δ 9
  4. https://docs. fl utter.dev/development/platform-integration/web/faq#search- engine-optimization-seo In general, Flutter is geared towards

    dynamic application experiences. Flutter’s web support is no exception. Flutter web prioritizes performance, fi delity, and consistency. This means application output does not align with what search engines need to properly index. For web content that is static or document-like, we recommend using HTML—just like we do on fl utter.dev, dart.dev, and pub.dev. You should also consider separating your primary application experience —created in Flutter—from your landing page, marketing content, and help content—created using search-engine optimized HTML. 11
  5. UIΛڞ༗͢ΔͨΊͷϦϙδτϦ෼ׂ 'MVUUFS8FCΞϓϦ " 'MVUUFS.PCJMFΞϓϦ 'MVUUFS8FCΞϓϦ # 6* .PEVMF 6* .PEVMF

    6* .PEVMF -PHJD .PEVMF -PHJD .PEVMF -PHJD .PEVMF 6* .PEVMF 6* .PEVMF -PHJD .PEVMF 6* .PEVMF
  6. Paddingͷௐ੔ class HogeWidget extends StatelessWidget { const HogeWidget({super.key}); @override Widget

    build(BuildContext context) { return const Padding( padding: EdgeInsets.symmetric( horizontal: 16, ), child: InnerWidget() ); } }
  7. Paddingͷௐ੔ class HogeWidget extends StatelessWidget { const HogeWidget({super.key}); @override Widget

    build(BuildContext context) { final margin = calculateMargin(context); return Padding( padding: EdgeInsets.symmetric( horizontal: margin, ), child: const InnerWidget() ); } double calculateMargin(BuildContext context) { if (MediaQuery.of(context).size.width < 600) { return 16; } else { return 32; } } } ը໘෯ʹΑΔmarginରԠ
  8. Paddingͷௐ੔ class HogeWidget extends StatelessWidget { const HogeWidget({super.key}); @override Widget

    build(BuildContext context) { final margin = calculateMargin(context); return InnerWidget( margin: margin, ); } double calculateMargin(BuildContext context) { if (MediaQuery.of(context).size.width < 600) { return 16; } else { return 32; } } } Widgetͷ಺෦Padding
  9. Paddingͷௐ੔ class InnerWidget extends StatelessWidget { const InnerWidget({ super.key, required

    this.margin, }); final double margin; @override Widget build(BuildContext context) { return ListView.builder( padding: EdgeInsets.symmetric( horizontal: margin, ), itemBuilder: (context, index) => ListTile( title: Text(‘$index’), ), ); } } ֎෦͔Βͷࢦఆ
  10. Paddingͷௐ੔ class InnerWidget extends StatelessWidget { const InnerWidget({ super.key, required

    this.margin, }); final double margin; @override Widget build(BuildContext context) { return ListView.builder( itemBuilder: (context, index) => ListTile( contentPadding: EdgeInsets.symmetric( horizontal: margin, ), title: Text(‘$index’), ), ); } } λονྖҬͷௐ੔