Is there something missing in the Flutter introduction? - flutter

I am currently learning Flutter and followed the official introduction on the Flutter website, which worked without any problems. On the page there was a link to part 2 on Google Developers Codelab.
First there is some information, including a code template for the second part, which is the same as my code on part 1. Then the actual coding part starts and here is the problem. It says to make changes in a widget that I don't have and wasn't mentioned before. The problem is that I know basically nothing about flutter and don't know where it belongs and also the whole context is missing, so I don't know what else is in the widget.
At the end of the chapter is again a code template given in case of problems, but again there is no trace of the widget. Maybe I've overlooked something, but I'm pretty sure that there is an error at this point.
Edit
This is the problem:
And this is their code template without any trace of a _buildRow() method

Related

How to find the input form in the Flutter mobile program structure?

I have a task to solve a bug for an application form update on an application that uses Flutter when it is built. However, this is my first time using Flutter, and the program structure is a bit confusing. Can you tell me the easiest way to find the form structure in a Flutter program?
Start with exploring the screens available in your project to know which screen is being displayed that you need to debug. Then have a look at the widgets which this screen is composed of to point to the one that is causing the bug.

Which is the better way to white-label a flutter app

I have one project that I have to sell to another clients, so I wanna found a way to unify the code to, when I release some updates, I have to manipulate only one code (and, of course, keeping the specificities from each one)
I found an article HERE which the guy creates a new folder named 'config' and set some variables there to be used in the parent project. I tried this but find out that would be very tough to do because the first app was developed specifically by one client, and with it I would need so much time to make all the aspects dynamic... Another problem is firebase, in first app I used firebase but in the second i won't. How to make it possible?
And in this article they say about 'flavours' that can be used to do something similar.
Someone knows about this approaches or there is another to reach my goal? With flavours I will have less re-factor than with config?
I appreciate any help
A third way to do this with no client specific app configuration is to make an api call to get back your client specific theme, and then set the flutter theme based on this.
If you need web support see below:
First update your assets in index.html that aren't white labeled, leaving stubs in their place that we'll fill in later. i.e.
Next show a nice loading indicator while flutter loads. To do this, just put the html for it in the body element of the index.html file.
Finally update the webpage title and favicon using javascript inside Flutter. I used package
universal_html: 2.0.8
https://pub.dev/packages/universal_html
then you can update the favicon
import 'package:universal_html/html.dart';
var favicon = document.getElementById('favicon');
favicon?.setAttribute('href','insertLinkToYourImage');
Updating the title can be accomplished in various normal ways like just setting the title attribute of a MaterialApp widget.

flutter: what should I test in a page?

I have finished all the pages and I want to start testing. I have read the docs about unit test. Also, I learned the test_widget.dart in an init flutter project. (the counter project you must know). But when come to my own pages, for example, a login page, I have little idea about what should I test. Could you please give me some tips?

FLP: Setting Custom Initial Focus on App Launch Fails

I am trying to set initial focus to the first input field in each page of my app.
I have implemented the code in the following post and it is working great:
How to Set Initial Focus in a View?
But I found that it is not working for first view/page in app when it opens from Fiori Launchpad. I found the following code which is getting executed after my onAfterShow:
From sap/ushell/renderers/fiori2/Shell-dbg.controller.js
Could you please help to solve this?
I am using SAP UI5 version 1.56.7.
Author of that answer here. After browsing through the source code and documentation quite a while, I have to admit I couldn't find any acceptable solutions to this question either. My impression is that FLP developers want to make sure that the app doesn't interfere with setting the initial focus.
The lack of APIs and documentation thereof strongly suggests that there are compelling reasons behind this prevention (probably a11y related).
My advice is not to rely on timeouts but maintaining consistent UX by keeping the focus on the app title on its launch - as designed by SAP.
Solved the issue by passing around 200ms into setTimeout function for first page and it is working fine

Deprecated AnimatedList

I am learning how to make an AnimatedList. I ran the example from the documentation. Although it is not nearly as easy to understand and use as a ListView, the example worked. However, there was a message on the documentation page:
This page is deprecated and its content may be out of date.
Usually when something is deprecated there is a better way to do it, but I cannot find any other information. What is wrong with that documentation page that makes it deprecated?
It looks like this style of documentation has been discontinued.
Thus, the code is not up to date and also not maintained anymore.
/docs/catalog/samples is not really part of the "Docs" tab on flutter.io anymore.
It only redirects to a "curated list of samples", which is not related to the /docs/catalog/samples/... section of flutter.io.
The AnimatedList class can be found in the widgets documentation.
Some of the widgets have samples built into their docs page. An example of this would be Column.
Hence, the conclusion that the old samples are not needed anymore.