[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tracking] Cookbook Recipes: Suggestions & Voting Thread #3587

Closed
brianegan opened this issue Mar 8, 2018 · 91 comments
Closed

[Tracking] Cookbook Recipes: Suggestions & Voting Thread #3587

brianegan opened this issue Mar 8, 2018 · 91 comments
Labels
a.cookbook Relates to a cookbook recipe or guide cl.wont-fix Issue closed as it either can't be or won't be fixed co.proposal Community ask to change an approach or process for docs.flutter.dev meta.umbrella Collects multiple related issues st.triage.ltw Indicates Lead Tech Writer has triaged

Comments

@brianegan
Copy link
Contributor

Hey all 👋

I'm helping to write the Flutter cookbook, and have received a tremendous amount of feedback regarding the types of recipes folks would like to see -- Thank you all so much!

Now, I'd love your help to prioritize these ideas! To do so, please leave a 👍 on the recipe ideas found in the comments below that you'd be most interested in seeing on the flutter.io website.

And of course, please feel free to add comments with more ideas 😄


Upate: I'm leaving a 😄 on each recipe as I complete it!

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Working with Tabbed Navigation

@brianegan
Copy link
Contributor Author

Creating a Drawer with Navigation

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Writing unit tests

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Writing Widget tests

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Writing UI Tests

@brianegan
Copy link
Contributor Author

Store information in a database

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Interacting with the Camera

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Writing a login flow

@brianegan
Copy link
Contributor Author

How to handle logging

@brianegan
Copy link
Contributor Author

Working with files on disk (file I/O)

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Connecting to an MQTT source for realtime data

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

How to draw on screen using a Canvas

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

How to create a an animated chart with realtime data

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Working with Sticky headers

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Creating a form with text fields

@brianegan
Copy link
Contributor Author

Validating forms

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Passing data down the Widget tree / Sharing datas to all screens

@brianegan
Copy link
Contributor Author

How to handle long-running processes, such as downloading a file in the background

@brianegan
Copy link
Contributor Author

Defining routes, and passing payloads to predefined routes

@brianegan
Copy link
Contributor Author

How to work with Dependency Injection

@brianegan
Copy link
Contributor Author

How to localize your app

@brianegan
Copy link
Contributor Author

How to handle when activity is killed, saving basic app state or at least the route

@brianegan
Copy link
Contributor Author

How to handle list pagination

@brianegan
Copy link
Contributor Author

Working with Local notifications

@brianegan
Copy link
Contributor Author

Recommendations on creating a dev, test and production environment.

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Crash reporting on both iOS and Android (Bonus points for including high level application logging from before the crash.)

@brianegan
Copy link
Contributor Author

Working with animations

@brianegan
Copy link
Contributor Author
brianegan commented Mar 8, 2018

Creating a single block of text containing various styles

@brianegan
Copy link
Contributor Author

How to play a sound

@brianegan
Copy link
Contributor Author

How to play a video

@brianegan
Copy link
Contributor Author
brianegan commented Mar 30, 2018

How to implement "Pull to Refresh"

@brianegan
Copy link
Contributor Author

How to load more data at the end of a list

@xster
Copy link
Member
xster commented May 10, 2018

Using isolates to do computationally heavy tasks concurrently with UI rendering

@xster
Copy link
Member
xster commented May 11, 2018

An image scrolling example using the cacheExtent property and the precaching API to load images before they come into the viewport.

@ColquePaxi
Copy link

Implementing Mobile App with ML Kit for Firebase (On-device and Cloud examples).

@nesscx
Copy link
nesscx commented Jun 14, 2018

Working with GraphQL

@letsar
Copy link
Contributor
letsar commented Jun 16, 2018

@brianegan for Sticky Header I created a package here: https://github.com/letsar/flutter_sticky_header.
I hope this will help you.

@ScottS2017
Copy link
Contributor

I think @slightfoot may have already pushed his version of Sticky Headers as well.
https://github.com/slightfoot/flutter_sticky_headers

@letsar
Copy link
Contributor
letsar commented Jun 18, 2018

@ScottS2017 Yes you are right, but the packages are quite different in their implementation details. The one you mentioned works with a RenderBox while mine works with a RenderSliver.

I think that the intended use of headers is typically for lists with a lot of items. And for lists, the SliverList (which renders in fine a RenderSliver) is a better choice than a Column (which renders in fine a RenderBox).

@zoechi
Copy link
zoechi commented Jun 28, 2018

An example for async validation until framework support flutter/flutter#9688 arrives.
I didn't have a closer look, but I assume this shouldn't be too hard without framework support.

@zoechi
Copy link
zoechi commented Jun 28, 2018

Another one I have seen several times already.
Get image data from an image flutter/flutter#18914

@PostImpatica
Copy link
PostImpatica commented Jul 12, 2018

How to implement Azure AD authentication. Also see this stack overflow. Currently this is the only thing keeping many companies from even looking at Flutter.

@mmcc007
Copy link
mmcc007 commented Jul 12, 2018

While waiting for flutter/flutter#9688 to resolve, based on suggestion made by @zoechi, there is a demo of sync and async form validation in the example provided in this new package:
https://pub.dartlang.org/packages/modal_progress_hud

modal_progress_hud
Example could possibly be adapted as a cookbook recipe (seems like a pretty common use case I so far couldn't find addressed elsewhere).

@mmcc007
Copy link
mmcc007 commented Oct 20, 2018

How to setup environment to develop integration tests in flutter:

Developing integration tests, at least for me, used to involve building the app and running in emulator for each development iteration. There is no hot reload equivalent for the integration tests. This takes minutes for each development iteration and is very slow.

$ flutter driver
Using device Android SDK built for x86.
Starting application: lib/main.dart
Initializing gradle...                                       0.8s
Resolving dependencies...                                    0.9s
Installing build/app/outputs/apk/app.apk...                  2.1s
Gradle task 'assembleDebug'...
Gradle task 'assembleDebug'... Done                          7.9s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                  1.8s
I/flutter (16870): Observatory listening on http://127.0.0.1:33407/
00:00 +0: app test:  (setUpAll)
[info ] FlutterDriver: Connecting to Flutter application at http://127.0.0.1:50244/
[trace] FlutterDriver: Isolate found with number: 980848669
[trace] FlutterDriver: Isolate is paused at start.
[trace] FlutterDriver: Attempting to resume isolate
[trace] FlutterDriver: Waiting for service extension

etc...

each run requires a build and install... very slow

Apparently there is a much faster way to develop integration tests.

  1. configure the app to run in emulator and listen on a particular port using something like --observatory-port=8888.
  2. The integration test, which is a pure dart program, can then be configured to connect on that port using something like VM_SERVICE_URL=http://127.0.0.1:8888/.

The integration test and the app code can then be modified and rerun without having to rebuild the app on each development iteration.

In one window run:

$ flutter run --observatory-port 8888 test_driver/main.dart
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching test_driver/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                       0.7s
Resolving dependencies...                                    0.9s
Gradle task 'assembleDebug'...
Gradle task 'assembleDebug'... Done                          3.4s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                  1.9s
Syncing files to device Android SDK built for x86...
D/        (16530): HostConnection::get() New Host Connection established 0x92a7f040, tid 16552
D/EGL_emulation(16530): eglMakeCurrent: 0xaa088a00: ver 3 0 (tinfo 0x96e46f10)
 2.2s

🔥  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:8888/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".

In another window run:

$ export VM_SERVICE_URL=http://127.0.0.1:8888/
$ dart test_driver/main_test.dart
00:00 +0: app test:  (setUpAll)
[info ] FlutterDriver: Connecting to Flutter application at http://127.0.0.1:8888/
[trace] FlutterDriver: Isolate found with number: 448955887
[trace] FlutterDriver: Isolate is not paused. Assuming application is ready.
[info ] FlutterDriver: Connected to Flutter application.

etc...

Makes integration testing development way faster, probably 10x faster.

Can also be configured to run in an IDE

@manhluong
Copy link

I am not sure if it fits this cookbook, but maybe some more samples that uses the BLoC architecture?

From the state management page there seems to be more redux samples than BLoC samples: https://flutter.io/docs/development/data-and-backend/state-mgmt

Reading quickly around the internet, it seems that there is interest / doubts around BLoC from people coming from redux: https://www.reddit.com/r/FlutterDev/comments/9769oz/if_youre_using_the_bloc_pattern_what_do_you_think/

@manhluong
Copy link

Some examples on how to automatically switch between iOS and Android theming.

Related to this issue: flutter/flutter#8410

However I am not sure about the status of 8410

@ronlobo
Copy link
ronlobo commented Jan 2, 2019

Setting up .env to run app based on current environment (production, stage, local, etc ...)

@geek-sajjad
Copy link

Secure storing API credentials and Keys in Flutter App.

@fredgrott
Copy link

I have one, how to hide api keys in the binary as everyone already know how to use build variants to hide it from the git repos.

use a chain of math functions to hash the api key

take each math step and make it a separate function in a separate class to reverse.

make sure to make the names of each function character names from your favorite movie,.

its imperfect...but its the only viable solution right now

@kf6gpe kf6gpe transferred this issue from flutter/flutter Jan 27, 2020
@legalcodes legalcodes added a.cookbook Relates to a cookbook recipe or guide co.proposal Community ask to change an approach or process for docs.flutter.dev labels Mar 25, 2020
@atsansone atsansone changed the title Cookbook Recipes: Suggestions & Voting Thread [Tracking] Cookbook Recipes: Suggestions & Voting Thread May 15, 2023
@atsansone atsansone added the st.triage.ltw Indicates Lead Tech Writer has triaged label May 15, 2023
@parlough
Copy link
Member

I'm going to close this as we haven't used it as a tracking issue for a while and now have many cookbook recipes. Thanks everyone!

@danagbemava-nc danagbemava-nc added the cl.wont-fix Issue closed as it either can't be or won't be fixed label Jul 13, 2023
@atsansone atsansone added meta.umbrella Collects multiple related issues and removed meta.tracking labels Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.cookbook Relates to a cookbook recipe or guide cl.wont-fix Issue closed as it either can't be or won't be fixed co.proposal Community ask to change an approach or process for docs.flutter.dev meta.umbrella Collects multiple related issues st.triage.ltw Indicates Lead Tech Writer has triaged
Projects
None yet
Development

No branches or pull requests