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

【東北TECH道場オンライン講座】Flutterアプリ開発入門

 【東北TECH道場オンライン講座】Flutterアプリ開発入門

【東北TECH道場オンライン講座】で発表させていただいた資料です。「Flutterアプリ開発入門」についてです。

#東北TECH道場 #flutterjp

Kenichi Kambara

August 18, 2020
Tweet

More Decks by Kenichi Kambara

Other Decks in Technology

Transcript

  1. About me •Mobile App Development •Technical Speeches •Technical Writings •[Official]

    Evangelist at NTT TechnoCross •[Private] iplatform.org Kenichi Kambara (@korodroid)
  2. ΫϩεϓϥοτϑΥʔϜΛऔΓר͘ঢ়گ Number of StackOverflow question views tagged with each of

    four popular UI frameworks over time (https://bit.ly/2A0tzuK) 
  3. 3.ݴޠ͸Dart Java/Java Scriptܦݧऀʹ͸ೃછΈ΍͍͢ݴޠ import 'package:flutter/material.dart'; void main() { runApp( Center(

    child: Text( '͜Μʹͪ͸ɺFlutter', textDirection: TextDirection.ltr, ), ), ); } 
  4. Android Studioฤ 1.Flutter SDKͷೖख $ git clone https://github.com/flutter/flutter.git 2. PATHͷ௥Ճ

    $ export PATH=`pwd`/flutter/bin:$PATH 3.ηοτΞοϓঢ়گͷνΣοΫ $ flutter doctor https://flutter.dev/get-started/install/ zip൛΋͋ΓɻࠔͬͨΒɺflutter doctor 
  5. [ิ଍]flutter doctor ରॲ๏΋ڭ͑ͯ͘ΕΔؾ͕ޮౕ͘ʂ $ flutter doctor Doctor summary (to see

    all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.3 17D47, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) [!] iOS toolchain - develop for iOS devices (Xcode 9.4) ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side. Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS. For more info, see https://flutter.io/platform-plugins To install: brew install cocoapods pod setup [✓] Android Studio ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] Android Studio (version 3.1) [✓] Connected devices (2 available) 
  6. Hello Flutter <project>/lib/main.dartΛˣʹॻ͖׵͑  import 'package:flutter/material.dart'; void main() => runApp(MyApp());

    class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Welcome to Flutter', home: Scaffold( appBar: AppBar( title: Text('͸͡ΊͯͷFlutter'), ), body: Center( child: Text('͜Μʹͪ͸ɺFlutter'), ), ), ); } }
  7. Hello Flutter ը໘ͷ։ൃ΋Dart(LayoutXML, StoryBoard)  import 'package:flutter/material.dart'; void main() =>

    runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Welcome to Flutter', home: Scaffold( appBar: AppBar( title: Text('͸͡ΊͯͷFlutter'), ), body: Center( child: Text('͜Μʹͪ͸ɺFlutter'), ), ), ); } }
  8. Hello Flutter ίʔυͱUIͷؔ܎ʹ஫໨  import 'package:flutter/material.dart'; void main() => runApp(MyApp());

    class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Welcome to Flutter', home: Scaffold( appBar: AppBar( title: Text('͸͡ΊͯͷFlutter'), ), body: Center( child: Text('͜Μʹͪ͸ɺFlutter'), ), ), ); } }
  9. StateΛར༻ͯ͠ঢ়ଶ؅ཧ [Ԡ༻]ಈతͳը໘ߋ৽ˠ(·ͣ͸)StatefulWidget  import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class

    MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: MyHomePage(title: 'Welcome to Flutter'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } …(লུ)…
  10. 1. DartݴޠΛ௚઀༻͍Δํࣜ ίʔυهड़ˠHot ReloadͰ֬ೝ  import 'package:flutter/material.dart'; void main() {

    runApp( Center( child: Text( '͜Μʹͪ͸ɺFlutter', textDirection: TextDirection.ltr, ), ), ); }
  11. c. ΢ΟδΣοτͷ૬ରൺ཰ࢦఆ  Expanded+flexଐੑ child: Container( child: Column( mainAxisSize: MainAxisSize.max,

    children: <Widget>[ Expanded( child: Container( child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[button1], ), ), flex: 1, ), Expanded( child: Container( child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[button2], ), ), flex: 2, ), ], ), ),
  12. Flutterೖ໳࣌ʹ͓͍͑ͨ͞Dartཁૉ  • _ (privateʹ૬౰) • https://dart.dev/guides/language/language-tour#libraries-and-visibility • .. (Χεέʔυه๏)

    • https://dart.dev/guides/language/language-tour#cascade-notation- • … (Spreadԋࢉࢠ) • https://dart.dev/guides/language/language-tour#spread-operator • Future / Stream (ඇಉظॲཧ) • https://dart.dev/tutorials/language/streams ref. Dart Official Site https://dart.dev/
  13. ςΩετϘοΫεͷ૷০ͷ৔߹  Padding( padding: EdgeInsets.all(8.0), child: TextField( controller: _controllerInput, decoration:

    InputDecoration( labelText: '຋༁͍ͨ͠จষ', border: OutlineInputBorder()), ), ),
  14. Please let me know if you have any requests such

    as technical speeches, technical writings and so on. Facebook:http://fb.com/kanbara.kenichi Twitter:@korodroid LinkedIn:http://www.linkedin.com/in/korodroid Thank you so much