1. Project Overview & Quickstart (leoafarias/LICENSE)
LICENSE
Open-source repository leoafarias/LICENSE
Repository Details
- Repository: leoafarias/LICENSE
- Primary Language: Code
Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.
2. Official Technical Reference & Guides (leoafarias/website)
[Flutter][]'s website ![Flutter logo][]
Table of contents
- Issues, bugs, and requests
- Before you build this site
- Developing and serving changes
- Creating and/or editing DartPad example code
- Deploy to a staging site
- Deploying to the official site
- Writing for flutter.dev
Issues, bugs, and requests
We welcome contributions and feedback on our website!
Please file a request in our
issue tracker
and we'll take a look.
NOTE: For simple changes (such as to CSS and text), you probably don't need to
build this site. Often, you can make changes using the GitHub UI.
If you want/need to build, read on.
Before you build this site
1. Get the prerequisites
Install the following tools, if you don't have them already.
bash, the Bourne shell. These instructions assume you're using
bash-- setup might not work if you use another shell.nvm, the Node Version Manager.
NOTE: To make
nvmimmediately available in your current shell, runsource. For example:console$ source ~/.nvm/nvm.shrvm, the Ruby Version Manager.
NOTE: To make
rvmimmediately available in your current shell, runsource. For example:console$ source ~/.rvm/bin/rvmFlutter (You get Dart when you get Flutter. Confirm with
which flutterandwhich dart.)GNU diffutils version 3.6 or later.
NOTE:
diffv3.6+ is required to ensure that in-page code diffs are
consistently refreshed across macOS and Linux. Issue #3076 was due to
the default macOSdiffbeing at v2.x. To upgradediffutils, run:console$ brew install diffutils
IMPORTANT: Follow the installation instructions for each of the tools
carefully. In particular, configure your shell/environment so
that the tools are available in every terminal/command window you create.
2. Clone this repo _and_ its submodules
NOTE: This repo has git submodules, which affects how you clone it.
To clone flutter/website (this repo), follow the instructions given in the
GitHub help on Cloning a repository, then choose one of the following
submodule-cloning techniques:
Clone this repo and its submodule at the same, use the
--recurse-submodulesoption:console$ git clone --recurse-submodules https://github.com/flutter/website.gitOR
If you've already cloned this repo without its submodule, then run
this command from the repo root:console$ git submodule update --init --remote
NOTE: At any time during development you can use the
git submodulecommand to
refresh submodules:console$ git pull; git submodule update --init --remote
3. Run installation scripts
NOTE: It is safe to (re-)run all of the commands and scripts given below even
if you already have the required packages installed.
Open a bash terminal/command window and execute the following commands:
After you have cloned this repo, change to the root of this repo:
console$ cdRun the
env-set.shscript to initialize environment variables, and to install/use required Node & Ruby version:console$ source ./tool/env-set.shRun
before-install.shto install the core set of required tools:console$ ./tool/before-install.shRun
install.shto install everything else needed to build this site:console$ ./tool/install.sh
IMPORTANT:
- Any time you create a new terminal/command window to work on
this repo, repeat steps 1 and 2 above.
Developing and serving changes
After you clone this repo, create a branch. For example:
console$ git checkout -bMake your changes, then commit them to the branch.
Test your changes by serving the site locally.
To serve locally, run either one of these commands:- console
$ ./tool/serve.sh # or npm run start
OR
- console
$ bundle exec jekyll serve --incremental --watch --livereload --port 4002NOTE: Unless you're editing files under
site-shared, you can safely
ignoreERROR: directory is already being watchedmessages.
For details, see #1363.NOTE: The first time you run either one of these commands,
Jekyll takes anywhere between 10-20 seconds to generate static
content inside the_sitesdirectory. If you try to verify the
site locally, but aren't able to see the content right away,
wait 20 seconds before stopping the
server or concluding that something is wrong.
Before submitting, validate site links:
console$ ./tool/shared/check-links.sh
TIP: Sometimes Jekyll gets confused and seems to be out-of-sync. (This might
happen, for example, when you pull from master and lots of files have moved.)
To fix Jekyll, stop theserve.shscript, remove the generated site files:
hand, and then restart theserve.shscript:
console$ npm run cleanOR
console$ jekyll cleanOR
console$ rm -Rf ./_site/* ./.jekyll*
Next, restart the
serve.shscript:
console$ npm run startOR
console$ ./tool/serve.sh
Creating and/or editing DartPad example code
Most of the code used to create DartPad examples is hosted on GitHub. However, this repo also contains
some .dart files responsible for DartPad example code.
DartPad example code in GitHub gists
A typical DartPad example takes the form of an iframe, for example, within a codelab's markdown file:
This iframe depends on the following GitHub gist url:
https://gist.github.com/d7b09149ffee2f0535bb0c04d96987f5For detailed instructions on how to use this approach to DartPad examples, see the DartPad embedding guide.
DartPad example code in this repo - `src/_packages/dartpad_picker`
Some DartPad example code remains in .dart files in this repo, and must be compiled via src/_packages/dartpad_picker/compile.sh. For an example, consult src/_packages/dartpad_picker/web/dartpad_picker_main.dart.
In order to create or change example code using dartpad_picker, you must regenerate the JavaScript:
$ cd src/_packages/dartpad_picker
$ ./compile.shDeploy to a staging site
You can deploy your local edits to a personal staging site as follows.
Serve your changes locally, as previously instructed.
Keep theserve.shscript running in its ownbashshell.In the Firebase Console,
create your own Firebase project (e.g.my-foo). You only need
to do this step once.In a separate
bashshell, change to the repo directory and
initialize Firebase:console$ npx firebase initTell Firebase about your project with the
firebase usecommand
You only need to do this step once:console$ npx firebase use --add ? Which project do you want to add? <select the project you created> ? What alias do you want to use for this project? (e.g. staging) my-fooTell Firebase that you want to deploy to staging:
console$ npx firebase use my-foo Now using alias staging (my-foo)Tell Firebase to execute deployment of your project:
$ npx firebase deploy Your personal version of the Flutter website is now deployed to Firebase.
Copy the serving URL from the command output.
Alternate deployment script
Alternatively, you can skip the previous steps and just use the deploy script:
$ ./tool/shared/deploy.sh --local my-foo
=== Deploying to '<your project name>'...
i deploying hosting
i hosting: preparing _site directory for upload...
โ hosting: 213 files uploaded successfully
i starting release process (may take several minutes)...
โ Deploy complete!Deploying to the official site
As of Feb 23, 2021, official site deploys are
performed by GitHub Actions.
In the event that you need to manually deploy,
use the deploy script and the default project:
$ ./tool/shared/deploy.sh --local --robots ok defaultWriting for flutter.dev
The site-shared repo
contains infrastructure shared by most of our Dart and Flutter websites.
Some of this README is in the
doc
directory in the site-shared repo.
For more information on using and writing for this repo,
refer to the following docs:
Also check out the site-shared
wiki: