(This page has no text content)
Table of Contents Table of Contents 1. Table of Contents 2. Welcome Introduction Acknowledgements Purpose Work Disclaimer Revisions Source Code Location Example & Exercise Names Example – ‘gesture_app’ One File 3. The Big Picture Introduction Before Cross-Platform Mobile Application Development Early Cross-Platform Development Tools Development Tools That Used Native Libraries Development Tools That Didn’t Use Native Libraries Modern Cross-Platform Development Tools React Native Google Flutter Conclusion 4. Introduction to Dart Introduction Platforms
1. Within a Web Browser 2. As Interpreted Application 3. As Native Application Dart SDK Command-Line Tools Libraries 5. Basic Dart Introduction Example Code Entry Point Example Code Output Introduction to Typing Statically-typed languages. Dynamically-typed languages. Dart Typing Static Types Dynamic Types (aka Untyped) There is a difference, but it is subtle. This code wont compile. Dartpad displays the following error: Type Inference Example of Inference #1: Output Example of Inference #2: Output Type Matching Example Code Output Type Information Example Code Output Strings
Interpolation Raw Strings Runes Object-Orientated Language Features Modules Constructors Instance Variables Constructor and Method Parameters Constructor and Method Parameters - Positional Required Constructor and Method Parameters - Positional Optional Constructor and Method Parameters - Named Other Method Cascades 6. More Advanced Dart Introduction Operator Overloading Example Warning Reflection Mixins Collections Introduction Lists Maps More-Specific Collection Classes Assertions Example Code Output Assertions & Modes (Flutter) Further Reading Errors & Exceptions Why Have Error & Exception Handling?
Errors Exceptions Handling Errors Handling Exceptions Finally Catch Exception Catch Exception and Stack Trace Catch Specific Exceptions Throw Exception Rethrow Exception Create Custom Exceptions Console Output Example Code Output Asynchronicity Introduction Future Invoking and Handling Asynchronous Operations Future API Async & Await Keywords Reactive Programming Further Reading 7. Introduction to Flutter Introduction What is Flutter? High Productivity High Quality High Performance It is Free and Open. Fuschsia Flutter Source Code Flutter SDK
Dart Platform Flutter Engine Foundation Library 8. Installing Flutter Introduction Issues Developing on a PC for iOS Install Process Introduction Step 1: Software Pre-Requisites Step 2: Download the Flutter SDK Step 3: Setup Your Path Step 4: Run Flutter Doctor Step 5: Setup Your Editor Step 6: Setup Your Emulator(s) 9. Your First App Introduction Default Flutter App Generate Your First App Android Studio Visual Studio Code Command-Line Emulators Open Android Emulator & Run Your First App Introduction Open Android Emulator Run Your App on the Android Emulator Open iOS Emulator & Run Your First App Introduction XCode iOS Emulator Open iOS Simulator/Emulator
Run Your App on the iOS Simulator Connect Your Device & Run Your First App Introduction Android Device iOS Device iOS Device - Open Xcode Project iOS Device – Create Signing Team iOS Device – Set Bundle Identifier Hot Restarting & Reloading Introduction Two Options Hot Restarting & Hot Reloading 10. Dependencies & Packages Introduction Website Core Packages Non-Core Packages Most Useful Non-Core Packages How to Use an External Package Declare Dependency in Project Import Packages Import & Use Package Code Restart Your App Package Version Numbers Project Files .packages pubspec.lock How to Publish Your Own Packages Introduction Setting Up a Dart Package Adding Documentation Final Review
Do a Publish Dry-Run Publish Further Reading 11. Default Flutter Application Project Introduction Folders Application Code Location Introduction to Composition & Widgets 12. Introduction to Widgets Introduction What Are Widgets? User Interface: Material & Cupertino Material Design, According to Google Most Flutter Widgets Work with Material Design User Interface: Cupertino Flutter Includes iOS-Styled Widgets Building Widgets Build Method Build Context Widgets Have No Mutable State Not All Widgets Are Equal Further Reading 13. Stateless Widgets Introduction Not All Widgets Need to be Smart Minimum Code Creation Example Rendering The ‘Build’ Method
When Does The ‘Build’ Method Execute? Lifecycle Exercise – ‘first_stateless’ Step 1 – Create Default Flutter App Step 2 – Replace Application Code Step 3 – Open Emulator & Run Summary So Far Step 4 – Add Some Padding Step 5 – Add Scrolling Step 6 – Add Border Step 7 – Final Touch Example – ‘stateless_widget_rebuild’ Optional Purpose Source Code 14. Stateful Widgets Introduction Some Widgets Need to be Smart Minimum Code Two Classes Class #1 – the class that extends StatefulWidget Class #2 – the class that extends State Creation Rendering The ‘Build’ Method LifeCycle Methods Class #1 – the class that extends StatefulWidget Class #2 – the class that extends State More Reading Example – ‘stateful_widget_flowers’ Optional App Purpose
App Widgets Start App Change the Flower Add Blur Source Code 15. Basic Material Widgets Introduction Text Example – ‘text’ Image Introduction Exercise – ‘loading_image’ Icon Introduction Example - ‘icon’ Further Reading Buttons Introduction Enabling Example – ‘buttons’ 16. Multi-Child Layout Widgets Introduction Multi-Child Layout Widgets Column Spacing Out Children Using MainAxisAlignment Expanding Children Using Expanded Widget Row Spacing Out Children Using MainAxisAlignment Expanding Children Using Expanded Widget Flex Example – ‘flex’ ListView
Example - ‘horizontal_list’ ListTile Stack Example – ‘stack_please_wait’ 17. Single-Child Layout Widgets Introduction Padding Example – ‘padding’ Container Example – ‘container’ Further Reading Card Example – ‘cards’ Expanded Example – ‘expanded’ Flexible Example – ‘flexible’ Center GestureDetector Example – ‘gesture_app’ Positioned Example – ‘positioned’ SafeArea Example: Non-Safe Area Example: Safe Area Example: Safe Area with Minimum Padding Set SingleChildScrollView Constructor Arguments Include: Exercise – ‘single_child_scroll_view’ 18. App Scaffolding Widgets Introduction MaterialApp
Navigator Themes Locales Debugging Constructor Arguments Scaffold AppBar Body BottomNavigationBar Drawer BottomSheet PersistentFooterButtons Exercise – ‘scaffold’ Step 1 – Create Default Flutter App Step 2 – Replace Application Code Step 3 – Open Emulator & Run 19. Other Widgets Introduction Checkbox Dialog AlertDialog SimpleDialog Custom Dialog Widget DropdownButton & DropdownMenuItem ExpansionPanelList & ExpansionPanel ExpansionPanelList ExpansionPanel Example – ‘expansion_panel’ GridView Builder GridTile GridTileBar Example – ‘gridview_app’
Further Reading PopupMenuButton Example – ‘popup_menu_button’ Radio SnackBar Example – ‘snack_bar’ Spacer Exercise – ‘spacer’ Switch TabBar, Tabs and TabBarView Widgets Instructions: Exercise – ‘tabs_simple’ Step 1 – Create Default Flutter App Step 2 – Replace Application Code Step 3 – Open Emulator & Run Step 4 – Move Tabs to Bottom Step 5 – Change Tab Styles Table Introduction Column Width Specifiers 20. Builders Introduction What is a Builder? How Do You Use a Builder? Nested Builders Common Builders AnimatedBuilder GridView Builder FutureBuilder ListView Builder: OrientationBuilder PageRoutebuilder
StreamBuilder StreamBuilder Example – ‘nested_builders’ Source Code 21. Routing & Navigation Introduction Navigator Class Stack of Routes Navigation without Named Routes with Parameters Navigating Forward Navigating Backwards Data Example – ‘routes_simple’ Navigation with Named Routes - Part One Define Routes Navigating Forward See the problem yet? Example – ‘routes_named’ Navigation with Named Routes - Part Two Attach Route Handler to MaterialApp Define Route Handler Navigating Forward Example – ‘routes_named_with_parms’ PageView Introduction Child Widgets Controller Example – ‘page_view_navigation’ 22. Forms Introduction Form Form State
Form Validation Form / Field Integration Form Fields Checkbox DropdownButton Radio TextFormField, TextField InputDecorator Example – ‘form_details’ Dependencies Source Code Other Information Input Decoration Themes Enabling / Disabling Form Buttons 23. HTTP, APIs, REST & JSON Introduction Asynchronous Communication HTTP Introduction Tools Request Response Methods URI Status Header Body APIs REST REST APIs should be stateless. How REST Uses URLs How REST Uses HTTP Method
Accessing Data with a REST API Inserting Data with a REST API Updating Data with a REST API Deleting Data with a REST API JSON JSON For Passing an Object Containing Data. JSON For Passing an Array JSON For Passing an Array of Objects 24. Flutter with HTTP, APIs, REST & JSON Introduction Flutter & JSON Introduction Serializing & Deserializing JSON. Generating Code for Serializing & Deserializing Manually Writing Code for Serialization & Deserialization Flutter & HTTP Flutter HTTP Package Dummy API Error Handling Example ‘http_employees’ Source Code Other Information Alice HAL / HATEOS 25. State Introduction State & Events Storing State Kinds of State How to Determine Where to Store State Responding to Events Introduction
Events Can Affect State State & Events – Problems State & Events – Different Approaches Mixing Approaches How I Decide Where to Put State State & Events – Commonly-Used Approaches Stateful Widget Approach InheritedWidget Approach Scoped Model Approach BLoC w/Streams Approach 26. State & Stateful Widget Approach Introduction Approach Exercise – ‘state_and_stateful_widget’ Introduction Step 1 – Create Default Flutter App Step 2 – Replace Application Code Step 3 – Open Emulator & Run Summary Step 4– Add Car Selection Further Reading 27. State & InheritedWidget Approach Introduction Approach Exercise – ‘state_and_inherited_widget_add’ Step 1 – Create Default Flutter App Step 2 – Replace Application Code Step 3 – Open Emulator & Run Summary Exercise – ‘state_and_inherited_widget’ Step 1 – Create Default Flutter App Step 2 – Replace Application Code
Step 3 – Open Emulator & Run Summary Conclusion Further Reading 28. State & ScopedModel Approach Introduction Approach Package Package Readme Multiple Models Exercise – ‘state_and_scoped_model’ Step 1 – Create Default Flutter App Step 2 – Replace Application Code Step 3 – Open Emulator & Run Summary Conclusion 29. State & BLoCs w/Streams Approach Introduction BLoC Pattern Reactive Programming RxDart StreamBuilder Exercise – ‘state_and_block_with_streams’ Step 1 – Create Default Flutter App Step 2 – Add the RxDart Dependency Step 3 – Replace Application Code Step 4 – Open Emulator & Run Summary Conclusion Further Reading 30. Local Persistence
Introduction Your Options SQLite Database Introduction Step 1 – Add Dependencies to Project Step 2 – Define the Data Model Step 3 – Open the Database Retrieve Rows from Database Executing SQL Insert into Database Update Row in Database Delete Row in Database Example – ‘sqlite_vocabulary’ Further Reading Local Files Introduction Platform Path Provider Package Application Documents Directory Directories Files Directory & File Methods Reading & Writing Data to a File Example ‘persistence_files’ Shared Preferences Introduction Methods Further Reading Example ‘persistence_shared_preferences’ 31. Mixins Introduction Mixins & Code Generators
Example – ‘mixins’ Source Code 32. Debugging & Performance Profiling Introduction Debugging Profiling Programmatical Options Add Debugger Statements Add Print & DebugPrint Statements Add Assertions Service Extensions Introduction Performance Overlay Show Paint Baselines (debugPaintSizeEnabled) Show Material Grid Turn Service Extensions On/Off from Android Studio Turn Service Extensions On/Off from Visual Studio Code Turn Service Extensions On/Off from Command Line Turn Service Extensions On/Off Programmatically Dart Observatory Introduction Part of the Dart SDK Starting the Observatory Timeline Profile Mode Further Reading Android Studio Visual Studio Code Command-Line Further Reading 33. Change Detection, Keys & Rendering Introduction
Comments 0
Loading comments...
Reply to Comment
Edit Comment