Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a...

23
2cldflutter Documentation Release 0.0.1 Chris Trees Apr 25, 2018

Transcript of Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a...

Page 1: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter DocumentationRelease 0.0.1

Chris Trees

Apr 25, 2018

Page 2: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material
Page 3: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

Contents

1 Guide 11.1 Flutter Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Flutter dev smoke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Smoke Test App augmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 GNU Lesser General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.5 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2 Indices and tables 19

i

Page 4: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

ii

Page 5: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

CHAPTER 1

Guide

1.1 Flutter Install

1.1.1 Create new app

The below command creates a Flutter project directory called myapp that contains a simple demo app that uses MaterialComponents:

macci:flutter cat$ flutter create smoketest_appCreating project smoketest_app......smoketest_app/test/widget_test.dart (created)Wrote 65 files.

Running "flutter packages get" in smoketest_app... 10.2s

[X] Flutter is fully installed. (Channel beta, v0.2.3, on Mac OS X 10.13.3 17D47,→˓locale en-US)[X] Android toolchain - develop for Android devices is fully installed. (Android SDK→˓27.0.3)[X] iOS toolchain - develop for iOS devices is fully installed. (Xcode 9.2)[X] Android Studio is fully installed. (version 3.1)[X] VS Code is fully installed. (version 1.21.1)[X] Connected devices is fully installed. (1 available)

All done! In order to run your application, type:

$ cd smoketest_app$ flutter run

Your main program file is lib/main.dart in the smoketest_app directory.

macci:flutter cat$ cd smoketest_app/macci:smoketest_app cat$ flutter run

1

Page 6: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

Launching lib/main.dart on PH 1 in debug mode...Initializing gradle... 40.3sResolving dependencies... 87.0sRunning 'gradlew assembleDebug'... 36.1sBuilt build/app/outputs/apk/debug/app-debug.apk (25.6MB).Installing build/app/outputs/apk/app.apk... 8.4sI/FlutterActivityDelegate(18711): onResume setting current activity to thisSyncing files to device PH 1... 2.3s

To hot reload your app on the fly, press "r". To restart the app entirely, press "R→˓".An Observatory debugger and profiler on PH 1 is available at: http://127.0.0.1:8100/For a more detailed help message, press "h". To quit, press "q".D/EssentialLetterbox(18711): setting letterbox insets Handler (android.view.→˓ViewRootImpl$ViewRootHandler) {b3e007f}

In the project directory, the code for your app is in lib/main.dart.

1.1.2 Run the app

1. Make sure a target device is selected in the lower, right-hand corner of VS Code

2. Press the F5 button on the keyboard, or invoke Debug>Start Debugging

3. Wait for the app to launch

If everything works, after the app has been built, you should see your starter app on your device.

1.1.3 Mod the app

Edit lib/main.dart change “Flutter Demo Home Page” to “Flutter Smoke Test”. Go to terminal and press “r” to reload.The smoketest_app should update.

Check Flutter

Should run the following and get the same results:

macci:~ cat$ flutter doctorDoctor summary (to see all details, run flutter doctor -v):[X] Flutter (Channel beta, v0.2.3, on Mac OS X 10.13.3 17D47, locale en-US)[X] Android toolchain - develop for Android devices (Android SDK 27.0.3)[X] iOS toolchain - develop for iOS devices (Xcode 9.2)[X] Android Studio (version 3.1)[X] VS Code (version 1.21.1)[X] Connected devices (1 available)

• No issues found!macci:~ cat$

Get Flutter SDK

To get Flutter, use git to clone the repository and then add the flutter tool to your path. Running flutter doctor showsany remaining dependencies you may need to install:

2 Chapter 1. Guide

Page 7: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

macci:Code cat$ pwd/Users/cat/Codemacci:Code cat$ git clone -b beta https://github.com/flutter/flutter.gitCloning into 'flutter'...remote: Counting objects: 117816, done.remote: Compressing objects: 100% (53/53), done.remote: Total 117816 (delta 20), reused 21 (delta 11), pack-reused 117752Receiving objects: 100% (117816/117816), 35.29 MiB | 3.29 MiB/s, done.Resolving deltas: 100% (88269/88269), done.macci:Code cat$ export PATH=`pwd`/flutter/bin:$PATHmacci:Code cat$ flutter doctorDownloading Dart SDK from Flutter engine e61bb9ac3a3fd789754e2e54220bcfc27076a857...% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed100 44.3M 100 44.3M 0 0 3218k 0 0:00:14 0:00:14 --:--:-- 3264kBuilding flutter tool...

Welcome to Flutter! - https://flutter.io

The Flutter tool anonymously reports feature usage statistics and crashreports to Google in order to help Google contribute improvements toFlutter over time.

Read about data we send with crash reports:https://github.com/flutter/flutter/wiki/Flutter-CLI-crash-reporting

See Google's privacy policy:https://www.google.com/intl/en/policies/privacy/

Use "flutter config --no-analytics" to disable analytics and crashreporting.

Downloading Material fonts... 0.8sDownloading package sky_engine... 0.5sDownloading common tools... 1.9sDownloading darwin-x64 tools... 8.6sDownloading android-arm-profile/darwin-x64 tools... 1.3sDownloading android-arm-release/darwin-x64 tools... 1.1sDownloading android-arm64-profile/darwin-x64 tools... 1.3sDownloading android-arm64-release/darwin-x64 tools... 1.2sDownloading android-x86 tools... 5.1sDownloading android-x64 tools... 5.4sDownloading android-arm tools... 2.7sDownloading android-arm-profile tools... 2.3sDownloading android-arm-release tools... 2.0sDownloading android-arm64 tools... 2.9sDownloading android-arm64-profile tools... 2.4sDownloading android-arm64-release tools... 2.2sDownloading ios tools... 7.1sDownloading ios-profile tools... 6.7sDownloading ios-release tools... 6.3sDownloading Gradle Wrapper... 0.2sDoctor summary (to see all details, run flutter doctor -v):[X] Flutter (Channel beta, v0.2.3, on Mac OS X 10.13.3 17D47, locale en-US)[] Android toolchain - develop for Android devices

Unable to locate Android SDK.

1.1. Flutter Install 3

Page 8: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

Install Android Studio from: https://developer.android.com/studio/index.htmlOn first launch it will assist you in installing the Android SDK components.(or visit https://flutter.io/setup/#android-setup for detailed instructions).If Android SDK has been installed to a custom location, set $ANDROID_HOME to that

→˓location.[!] iOS toolchain - develop for iOS devices

Xcode installation is incomplete; a full installation is necessary for iOS→˓development.

Download at: https://developer.apple.com/xcode/download/Or install Xcode via the App Store.Once installed, run:

sudo xcode-select --switch /Applications/Xcode.app/Contents/DeveloperBrew not installed; use this to install tools for iOS device development.

Download brew at https://brew.sh/.[] Android Studio (not installed)[!] VS Code (version 1.21.1)

! Doctor found issues in 4 categories.macci:Code cat$

iOS toolchain Install

Flutter uses the iOS toolchain to produce iOS Applications.

1. Launch App Store, search for xcode, click install, enter apple ID. #. After xcode install run:

macci:Code cat$ sudo xcode-select --switch /Applications/Xcode.app/Contents/→˓Developer

2. Accept xcode lic by running the following:

macci:Code cat$ sudo xcodebuild -license

3. Enable developer mode:

macci:Code cat$ sudo DevToolsSecurity -enable

4. Brew-Install download at https://brew.sh/ or the following:

macci:Code cat$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/→˓Homebrew/install/master/install)"

5. Install brew libs #. brew install –HEAD libimobiledevice #. brew install ideviceinstaller #. brew install ios-deploy #. brew install cocoapods #. pod setup

Andriod toolchain Install

Flutter uses the Android toolchain to produce Android Applications.

1. Install Android-Studio from https://developer.android.com/studio/index.html

2. Launch android-studio-ide-173.4670197-mac.dmg

3. Drag and Drop Icon into Applications

4. Launch Android Studio App

4 Chapter 1. Guide

Page 9: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

5. Follow setup (I did not import anything)

6. Need to allow “App Store and identified developers” in Security System Preferences.

7. Accept Lic run:

macci:Code cat$ flutter doctor --android-licenses

Andriod Device Setup

We need and Android device and simulator setup.

1. Enable Developer options and USB debugging via Android-Device-DevOptions #. On device, open “Settings”#. Select System -> About phone -> tap Build number 7 times. #. Enter PIN and it should tell you “Your aDeveloper now.” #. Go to System -> Developer #. Enable “USB debugging”

vscode Install

I like vscode. . . so I use it vscode-install

1. Download vscode for mac vscode-mac-Install

2. Drag vscode app to Applications Directory

3. Add vscode to Dock

4. Add vscode to path (manually):

cat << EOF >> ~/.bash_profile# Add Visual Studio Code (code)export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/→˓bin"EOF

References

• Created via Flutter-Mac-Install

• Brew-Install

• Android-Studio

• Android-Device-DevOptions

1.2 Flutter dev smoke

1.2.1 Smoke Test App

Create new app

The below command creates a Flutter project directory called myapp that contains a simple demo app that uses MaterialComponents:

1.2. Flutter dev smoke 5

Page 10: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

macci:flutter cat$ flutter create smoketest_appCreating project smoketest_app......smoketest_app/test/widget_test.dart (created)Wrote 65 files.

Running "flutter packages get" in smoketest_app... 10.2s

[X] Flutter is fully installed. (Channel beta, v0.2.3, on Mac OS X 10.13.3 17D47,→˓locale en-US)[X] Android toolchain - develop for Android devices is fully installed. (Android SDK→˓27.0.3)[X] iOS toolchain - develop for iOS devices is fully installed. (Xcode 9.2)[X] Android Studio is fully installed. (version 3.1)[X] VS Code is fully installed. (version 1.21.1)[X] Connected devices is fully installed. (1 available)

All done! In order to run your application, type:

$ cd smoketest_app$ flutter run

Your main program file is lib/main.dart in the smoketest_app directory.

macci:flutter cat$ cd smoketest_app/macci:smoketest_app cat$ flutter runLaunching lib/main.dart on PH 1 in debug mode...Initializing gradle... 40.3sResolving dependencies... 87.0sRunning 'gradlew assembleDebug'... 36.1sBuilt build/app/outputs/apk/debug/app-debug.apk (25.6MB).Installing build/app/outputs/apk/app.apk... 8.4sI/FlutterActivityDelegate(18711): onResume setting current activity to thisSyncing files to device PH 1... 2.3s

To hot reload your app on the fly, press "r". To restart the app entirely, press "R→˓".An Observatory debugger and profiler on PH 1 is available at: http://127.0.0.1:8100/For a more detailed help message, press "h". To quit, press "q".D/EssentialLetterbox(18711): setting letterbox insets Handler (android.view.→˓ViewRootImpl$ViewRootHandler) {b3e007f}

In the project directory, the code for your app is in lib/main.dart.

Run the app

1. Make sure a target device is selected in the lower, right-hand corner of VS Code

2. Press the F5 button on the keyboard, or invoke Debug>Start Debugging

3. Wait for the app to launch

If everything works, after the app has been built, you should see your starter app on your device.

6 Chapter 1. Guide

Page 11: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

Mod the app

Edit lib/main.dart change “Flutter Demo Home Page” to “Flutter Smoke Test”. Go to terminal and press “r” to reload.The smoketest_app should update.

1.3 Smoke Test App augmentation

1.3.1 Flutter smoke dev chat

Smoke Test App with chat

chat smoke app

Screencasts

1. tc159 Demo the Secret Sauce

2. tc461 Explains main.dart structure

3. tc591 Widgets are immutable and ephemeral

4. tc639 class MyApp Explained and hotload shown

5. tc709 class ChatScreenState explain how to send messages in _buildTextComposer add new Flexible aTextField:

new Flexible(child: new TextField(

controller: _textController,onSubmitted: _handleSubmitted,onChanged: _handleMessageChanged,decoration:

new InputDecoration.collapsed(hintText: 'Send a message'),),

),

6. tc812 go handle submitted function:

void _handleSubmitted(String text) {_textController.clear();_addMessage(name: _name, text: text);});

}

7. tc855 update the view to redraw sent messages:

var message = new ChatMessage(sender: sender,text: text,imageUrl: imageUrl,textOverlay: textOverlay,animationController: animationController);

setState(() {_messages.insert(0, message);});

1.3. Smoke Test App augmentation 7

Page 12: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

8. tc915 Make pretty via a theme:

class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {

return new MaterialApp(title: 'Memechat',theme: defaultTargetPlatform == TargetPlatform.iOS

? kIOSTheme: kDefaultTheme,

home: new ChatScreen(),);

}}

9. tc1008 Add some animationController:

void _addMessage({String name,String text,String imageUrl,String textOverlay,String senderImageUrl}) {var animationController = new AnimationController(duration: new Duration(milliseconds: 700),vsync: this,);

....also added SizeTransistion in ChatMessageListItem

10. tc1088 Bug in code.. they go fix it (simple typo but the point was to see debug).

11. tc1161 Add plugin dependencies via pubspec.yaml

12. tc1239 Add Google Sign-in plugin in main.dart

void _handleSubmitted(String text) {_textController.clear();_googleSignIn.signIn().then((user) {var message = {

'sender': {'name': user.displayName, 'imageUrl': user.photoUrl},'text': text,

};_messagesReference.push().set(message);});

}..... display profile photo

children: [new Container(

margin: const EdgeInsets.only(right: 16.0),child: new GoogleUserCircleAvatar(message.sender.imageUrl),

),

13. tc1330 Add Firebase Database:

@overridevoid initState() {

super.initState();_googleSignIn.signInSilently();

8 Chapter 1. Guide

Page 13: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

FirebaseAuth.instance.signInAnonymously().then((user) {_messagesReference.onChildAdded.listen((Event event) {

var val = event.snapshot.value;_addMessage(

name: val['sender']['name'],senderImageUrl: val['sender']['imageUrl'],text: val['text'],imageUrl: val['imageUrl'],textOverlay: val['textOverlay']);

});});

}.....void _handleSubmitted(String text) {

_textController.clear();_googleSignIn.signIn().then((user) {var message = {

'sender': {'name': user.displayName, 'imageUrl': user.photoUrl},'text': text,

};_messagesReference.push().set(message);});

}

14. tc1482 Add send images via Image Picker and Storage.

15. tc1504 Add icon button:

child: new IconButton(icon: new Icon(Icons.photo),onPressed: _handlePhotoButtonPressed,

),),

16. tc1525 Add _handlePhotoButtonPressed function:

Future<Null> _handlePhotoButtonPressed() async {var account = await _googleSignIn.signIn();var imageFile = await ImagePicker.pickImage();var random = new Random().nextInt(10000);var ref = FirebaseStorage.instance.ref().child('image_$random.jpg');var uploadTask = ref.put(imageFile);var textOverlay =

await Navigator.push(context, new TypeMemeRoute(imageFile));if (textOverlay == null) return;var downloadUrl = (await uploadTask.future).downloadUrl;var message = {'sender': {'name': account.displayName, 'imageUrl': account.photoUrl},'imageUrl': downloadUrl.toString(),'textOverlay': textOverlay,};_messagesReference.push().set(message);

}

17. tc1656 Add text overlay (which was what the Navigator textOverlay above).

1.3. Smoke Test App augmentation 9

Page 14: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

References

• Tutorial via GoogleIO-17 “Single Codebase, Two Apps with Flutter and Firebase” see youtube-flutter-chat-tutorial

• Github source for tutorial youtube-flutter-chat-github

1.3.2 Flutter smoke dev maps

Smoke Test App with maps

maps smoke app

Screencasts

1. tc74 Create nomnom:

flutter create nomnomflutter run

2. tc87 Codebase clear comments lib/main.dart and change name on line 13

3. tc188 Remove boilderplate layout and add “Hello World”:

body: new Center( child: new Text('hello world') ),

4. tc211 Take out _incrementCounter

5. tc229 Create dummy test data for list view:

List<String> _places = <String>[];

@overrideinitState() {super.initState();_places = new List.generate(100, (i) => 'Restauant $i');

6. tc324 Put list in view:

body: new Center(child: new ListView(

children: _places.map((place) => Text (place)).toList(),)),

7. tc401 Add google places API:

cp ../src/places.dart ./lib/cp ../src/key.dart ./lib/

8. tc519 Open pubspec.yaml add to line 8:

http: ^0.11.3

9. tc586 Run command line:

10 Chapter 1. Guide

Page 15: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

dart lib/places.dart

10. tc628 Parse json in a nice way (code is commented out in places.dart file)into streams.

11. tc761 Return stream to flutter app by using:

Future<Stream<Place>>

12. tc800 In file lib/main.dart make function:

import 'places.dart';...List<Place> _places = <Place>[];

...@overrideinitState() {super.initState();listenForPlaces();

}...listenForPlaces() async {var stream = await getPlaces(33.9850, -118.4695);stream.listen( (place) =>

setState[ () => _places.add(place)));

}...

children: _places.map((place) => new Text(place.name)).toList(),...

13. tc984 Should get a ‘non-pretty’ list

14. tc1000 Make it pretty

15. tc1009 In main.dart add new widget PlaceWidget:

class PlaceWidget extends StatelessWidget {final Place _place;PlaceWidget(this._place);@overrideWidget build(BuildContext context) {

// TODO: implement buildreturn new ListTile(title: new Text(_place.name),

); // ListTile}

}

16. tc1048 Override the build widget:

children: _places.map((place) => new PlaceWidget(place)).toList(),

17. tc1116 Add subtitle:

class PlaceWidget extends StatelessWidget {final Place _place;PlaceWidget(this._place);@overrideWidget build(BuildContext context) {

1.3. Smoke Test App augmentation 11

Page 16: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

// TODO: implement buildreturn new ListTile(

title: new Text(_place.name),subtitle: new Text(_place.address),

); // ListTile}

}

18. tc1138 Add leading:

class PlaceWidget extends StatelessWidget {final Place _place;PlaceWidget(this._place);@overrideWidget build(BuildContext context) {

// TODO: implement buildreturn new ListTile(leading: new CircleAvatar(child: new Text(_place.rating.toString()),backgroundColor: Colors.green,

), // CircleAvatartitle: new Text(_place.name),subtitle: new Text(_place.address),

); // ListTile}

}

19. tc1197: Update backgroundColor based on Rating using interpolation:

class PlaceWidget extends StatelessWidget {final Place _place;PlaceWidget(this._place);

Color getColor(double rating) {return Color.lerp(Colors.red, Colors.green, rating/5);

}

@overrideWidget build(BuildContext context) {

// TODO: implement buildreturn new ListTile(leading: new CircleAvatar(child: new Text(_place.rating.toString()),backgroundColor: getColor(_place.rating),

), // CircleAvatartitle: new Text(_place.name),subtitle: new Text(_place.address),

); // ListTile}

}

20. tc1293 Put in Swipe Right to Like, Left to Remove using Dismissible:

class PlaceWidget extends StatelessWidget {final Place _place;PlaceWidget(this._place);

Color getColor(double rating) {

12 Chapter 1. Guide

Page 17: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

return Color.lerp(Colors.red, Colors.green, rating/5);}

@overrideWidget build(BuildContext context) {

// TODO: implement buildreturn new Dismissible(key: new Key(_place.name),background: new Container(color: Colors.green),secondaryBackground: new Container(color: Colors.red),leading: new CircleAvatar(child: new Text(_place.rating.toString()),backgroundColor: getColor(_place.rating),

), // CircleAvatartitle: new Text(_place.name),subtitle: new Text(_place.address),

); // ListTile}

}

21. tc1415 Add text to swipe feedback:

onDismissed: (direction) {direction == DismissDirection.endToStart ? Scaffold.of(context).showSnackBar(

new SnackBar(content: new Text('I Like'))) : print('No Like');},

22. tc1609 Show some of the render debugging performance.

References

• Tutorial via “Let’s live code in Flutter (DartConf 2018)” see youtube-flutter-maps-tutorial

• Github source for tutorial youtube-flutter-maps-github

1.3.3 Flutter smoke dev qr

Smoke Test App with qr codes

qr code smoke app

Screencasts

1. tc74 Create nomnom:

flutter create nomnom

2. tc87 Codebase clear comments lib/main.dart

3. tczz tbd

1.3. Smoke Test App augmentation 13

Page 18: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

References

• Tutorial via GoogleIO-17 “Single Codebase, Two Apps with Flutter and Firebase” see youtube-flutter-chat-github

• Github source for tutorial youtube-flutter-chat-github

• Scanbot.io Quickly enable document scanning with cutting-edge image processing in your app.

1.4 GNU Lesser General Public License

Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNUGeneral Public License, supplemented by the additional permissions listed below.

1.4.1 0. Additional Definitions

As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL”refers to version 3 of the GNU General Public License.

“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work asdefined below.

An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise basedon the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface providedby the Library.

A “Combined Work” is a work produced by combining or linking an Application with the Library. The particularversion of the Library with which the Combined Work was made is also called the “Linked Version”.

The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the CombinedWork, excluding any source code for portions of the Combined Work that, considered in isolation, are based on theApplication, and not on the Linked Version.

The “Corresponding Application Code” for a Combined Work means the object code and/or source code for theApplication, including any data and utility programs needed for reproducing the Combined Work from the Application,but excluding the System Libraries of the Combined Work.

1.4.2 1. Exception to Section 3 of the GNU GPL

You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNUGPL.

1.4.3 2. Conveying Modified Versions

If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be suppliedby an Application that uses the facility (other than as an argument passed when the facility is invoked), then you mayconvey a copy of the modified version:

14 Chapter 1. Guide

Page 19: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

* **a)** under this License, provided that you make a good faith effort toensure that, in the event an Application does not supply thefunction or data, the facility still operates, and performswhatever part of its purpose remains meaningful, or

* **b)** under the GNU GPL, with none of the additional permissions ofthis License applicable to that copy.

### 3. Object Code Incorporating Material from Library Header Files

The object code form of an Application may incorporate material from a header file that is part of the Library. Youmay convey such object code under terms of your choice, provided that, if the incorporated material is not limited tonumerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten orfewer lines in length), you do both of the following:

* **a)** Give prominent notice with each copy of the object code that theLibrary is used in it and that the Library and its use arecovered by this License.

* **b)** Accompany the object code with a copy of the GNU GPL and this licensedocument.

1.4.4 4. Combined Works

You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict mod-ification of the portions of the Library contained in the Combined Work and reverse engineering for debugging suchmodifications, if you also do each of the following:

• a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Libraryand its use are covered by this License.

• b) Accompany the Combined Work with a copy of the GNU GPL and this license document.

• c) For a Combined Work that displays copyright notices during execution, include the copyright notice for theLibrary among these notices, as well as a reference directing the user to the copies of the GNU GPL and thislicense document.

• d) Do one of the following:

– 0) Convey the Minimal Corresponding Source under the terms of this License, and the CorrespondingApplication Code in a form suitable for, and under terms that permit, the user to recombine or relink theApplication with a modified version of the Linked Version to produce a modified Combined Work, in themanner specified by section 6 of the GNU GPL for conveying Corresponding Source.

– 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is onethat (a) uses at run time a copy of the Library already present on the user’s computer system, and (b)will operate properly with a modified version of the Library that is interface-compatible with the LinkedVersion.

• e) Provide Installation Information, but only if you would otherwise be required to provide such informationunder section 6 of the GNU GPL, and only to the extent that such information is necessary to install andexecute a modified version of the Combined Work produced by recombining or relinking the Application with amodified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany theMinimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must providethe Installation Information in the manner specified by section 6 of the GNU GPL for conveying CorrespondingSource.)

1.4. GNU Lesser General Public License 15

Page 20: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

1.4.5 5. Combined Libraries

You may place library facilities that are a work based on the Library side by side in a single library together with otherlibrary facilities that are not Applications and are not covered by this License, and convey such a combined libraryunder terms of your choice, if you do both of the following:

• a) Accompany the combined library with a copy of the same work based on the Library, uncombined with anyother library facilities, conveyed under the terms of this License.

• b) Give prominent notice with the combined library that part of it is a work based on the Library, and explainingwhere to find the accompanying uncombined form of the same work.

1.4.6 6. Revised Versions of the GNU Lesser General Public License

The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public Licensefrom time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to addressnew problems or concerns.

Each version is given a distinguishing version number. If the Library as you received it specifies that a certain num-bered version of the GNU Lesser General Public License “or any later version” applies to it, you have the optionof following the terms and conditions either of that published version or of any later version published by the FreeSoftware Foundation. If the Library as you received it does not specify a version number of the GNU Lesser GeneralPublic License, you may choose any version of the GNU Lesser General Public License ever published by the FreeSoftware Foundation.

If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser GeneralPublic License shall apply, that proxy’s public statement of acceptance of any version is permanent authorization foryou to choose that version for the Library.

1.5 Help

Ping admin_at_2cld_dot_net

Various help various tool chain setups.

1.5.1 Help with Building the Docs

Build ReadTheDocs

To edit and update the readthedocs:

$ cd ~/2cld$ git clone https://github.com/2cld/flutter$ cd flutter/docs$ make html$ open build/html/index.html$ vi source/help.rst$ make html$ open build/html/index.html(verify changes)$ make clean$ cd ~/2cld/flutter$ git add *$ git commit -m "Update documents"

16 Chapter 1. Guide

Page 21: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

$ git push(wait some min for webhooks to hit)$ open http://2cldflutter.readthedocs.io/en/latest/(inspect changes)

Sphinx Install

To install Sphinx via pip ( pip-install ) to make documentation:

$ python --versionPython 2.7.10$ python get-pip.py$ pip --versionpip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)$ sudo pip install --ignore-installed Sphinx

Add key to github

Add your ssh key to github via github-addkey

macci:~ cat$ pbcopy < ~/.ssh/id_rsa.pub

Login to github. Click your picture, select settings. Select SSH and GPG keys. Paste key to add.

git repo config

The .git/config file should look like this:

[core]repositoryformatversion = 0filemode = truebare = falselogallrefupdates = trueignorecase = trueprecomposeunicode = true

[remote "origin"]url = https://gituser:[email protected]/2cld/flutter.gitfetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]remote = originmerge = refs/heads/master

ssh keygen

Generate a new key via github-genkey process for macmini:

macci:~ cat$ ssh-keygen -t rsa -b 4096 -C "[email protected]"

Modify ~/.ssh/config to contain:

1.5. Help 17

Page 22: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

2cldflutter Documentation, Release 0.0.1

Host *AddKeysToAgent yesUseKeychain yesIdentityFile ~/.ssh/id_rsa

Now add the key to ssh-agent keychain:

macci:~ cat$ eval "$(ssh-agent -s)"macci:~ cat$ ssh-add -K ~/.ssh/id_rsa

xcode git install

Assuming Mac OSX 10.13.3 fresh install on macmini named macci. To install git and xcode on macci:

macci:~ cat$ git --version

This will activate the xcode install pop-up and configure machine with xcode cli.

Set your git global info:

macci:flutter cat$ git config --global --edit

References

• Docs created via Sphinx

• rst-cheatsheet

• pip-install

• yarn is a new npm (node package manager)

1.5.2 Things

idempotent - denoting an element of a set that is unchanged in value when multiplied or otherwise operated on byitself. immutable - unchanging over time or unable to be changed. ephemeral - lasting for a very short time.

18 Chapter 1. Guide

Page 23: Release 0.0CHAPTER 1 Guide 1.1Flutter Install 1.1.1Create new app The below command creates a Flutter project directory called myapp that contains a simple demo app that uses Material

CHAPTER 2

Indices and tables

• genindex

• modindex

• search

19