I am a Flutter developer, and it's documentation code samples are licensed under BSD-3, does that mean when learning from it and then applying that to my code I should include the license in my code (and how would I do that), or only when copying substantial blocks from the documentation into my code (which I do not do, I only read documentation to get a sense on how I should use the API), The way I do it right now is by showing all licenses in the form of text of every package I use, and give the option to display it in my UI, including Flutter's BSD-3 notice, using a ready-made function, does that cover it
We are looking here at several different levels of use of the code from the documentation. Learning -- copying insignificant parts -- copying substantial blocks
The basic legal framework for software licenses is the copyright. So when you just learn from other code, but you don't copy it, then the licenses do not have any impact on what you are doing.
In order for copyright to apply, the text/code must exceed the threshold of originality. And here starts the grey zone, because this is not easy to determine, and it is not the same in all jurisdictions. If you are just copying simple no-brainer lines of trivial code, which everybody more or less does in the same way, then this code might not meet the threshold of originality, and you can use it without attribution and respecting the license terms. But again, this is a grey zone.
As soon as you are copying substantial blocks you will be above the threshold of originality and copyright applies, that means you have to have to fulfill the terms required by the license.
With the 3-Clause BSD License it is easy to comply with the terms
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
You do not need to put the license and copyright notice into the UI, it is sufficient to provide it (in a .txt or .md file) with the code you distribute. It is good practice to have these files in the top-level folder of the distributed files. If you want to have something in the UI, then please do that in addition to the plain text files.