- Notifications
You must be signed in to change notification settings - Fork0
Flutter documentation web site
License
olof-dev/flutter-website
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Flutter documentation website
Thedocumentation site for theFlutter framework,built withEleventy and hosted onFirebase.
We welcome contributions and feedback on our website.Please file a request in ourissue trackeror create apull request.For simple changes (such as tweaking some text),it's easiest to make changes using the GitHub UI.
If you have an issue with theAPI docs onapi.flutter.dev,please file those issues ontheflutter/flutter repo,not on this (flutter/website) repo.The API docs are embedded in Flutter's source code,so the engineering team handles those.
We love it when the community gets involved in improving our docs!But here are a few notes to keep in mind before you submit a PR:
- When triaging issues,we sometimes label an issue with the tagPRs welcome.But we welcome PRs on other issues as well—it doesn't have to be tagged with that label.
- Please don't run our docs through Grammarly (or similar)and submit those changes as a PR.
- We follow theGoogle Developer Documentation Style Guidelines —for example, don't use "i.e." or "e.g.",avoid writing in first person,and avoid writing in future tense.You can start with thestyle guide highlightsor theword list,or use the search bar that's at the top of every style guide page.
We truly thank you for your willingness and helpfulnessin keeping the website docs up to date!
To update this site, fork the repo, make your changes,and generate a pull request.For small, contained changes (such as style and typo fixes),you probably don't need to build this site.Often you can make changes using the GitHub UI.If needed, we can stage the changes automatically in your pull request.
Important
If you are cloning this repository locally,follow the below instruction on cloning with its submodule.
If your change involves code samples, adds/removes pages, or affects navigation,do consider building and test your work before submitting.
If you want or need to build the site, follow the steps below.
For changes beyond simple text and CSS tweaks,we recommend running the site locally toenable an edit-refresh cycle.
Install the following tools to build and develop the site:
The latest stable release of Flutter, which includes Dart,is required to build the site and run its tooling.If you don't have Flutter or need to update, follow theinstructions atInstall Flutter orUpgrading Flutter.
If you already have Flutter installed, verify it's on your pathand already the latest stable version:
flutter --versionThelatest stable LTS release of Node.js is required to build the site.If you don't have Node.js or need to update, download yourcomputer's corresponding version and follow the instructionsfrom theNode.js download archive.If you prefer, you can use a version manager such asnvm,and runnvm install from the repository's root directory.
If you already have Node installed, verify it's available on your pathand already the latest stable version(currently22.12 or later):
node --versionIf your version is out of date,follow the update instructions for how you originally installed it.
Note
This repository has gitsubmodules, which affects how you clone it.The GitHub documentation has general help onforking andcloning repos.
If you're not a member of the Flutter organization,we recommend youcreate a fork of this repo under your own account,and then submit a PR from that fork.
Once you have a fork (or you're a Flutter org member),choose one of the following submodule-cloning techniques:
Clone the repo and its submodule at the same timeusing the
--recurse-submodulesoption:git clone --recurse-submodules https://github.com/flutter/website.gitIf you've already cloned the repo without its submodule,then run this command from the root of the repository:
git submodule update --init --recursive
Note
At any time during developmentyou can use thegit submodule command to refresh submodules:
git pull && git submodule update --init --recursiveBefore you continue setting up the site infrastructure,verify the correct versions of Flutter and Node.js are set up and available byfollowing the instructions inGet the prerequisites.
Optional: After cloning the repo and its submodules,create a branch for your changes:
git checkout -b <BRANCH_NAME>From the root directory of the repository,fetch the site's Dart dependencies.
dart pub getOptional: We recommend you use
pnpm, but you can also usenpm.Installpnpm, an alternative, efficient package manager fornpm packages. If you already havepnpm, verify you have thelatest stable version.node --versionIf you don't already have
pnpminstalled, we recommendusingcorepackto install and managepnpmversions,sincecorepackis bundled with most installations ofNode. If you installednodeusing Homebrew, you'll needto install corepack separately:brew install corepackIf you haven't used
corepackbefore, you'll need tofirst enable it withcorepack enable.Then, to install the correctpnpmversion, from theroot directory of the repository, runcorepack install:corepack enable;corepack install
To install
pnpmwithout usingcorepack, youcan use your preferredinstallation method.(optional) Once you have
pnpminstalled and setup,fetch the site's npm dependencies usingpnpm install.We highly recommend you usepnpm, but you can also usenpm.pnpm installRerun
pnpm installwhenever you incorporate thelatest changes to themainbranch or if youexperience dependency or import errors when building the site.From the root directory, run the
dash_sitetool tovalidate your setup and learn about the available commands../dash_site --helpFrom the root directory, serve the site locally.
./dash_site serveThis command generates and serves the site on alocal port that's printed to your terminal.
View your changes in the browser by navigating tohttp://localhost:4000.
Note the port might be different if
4000is taken.If you want to check the raw, generated HTML output and structure,view the
_sitedirectory in a file explorer or an IDE.Make your changes to the local repo.
The site should automatically rebuild on most changes, but ifsomething doesn't update, exit the process and rerun the command.Improvements to this functionality are planned.Please open a new issue to track the issue if this occurs.
Commit your changes to the branch and submit your PR.
If your change is large, or you'd like to test it,considervalidating your changes.
Tip
To find additional commands that you can run,run./dash_site --help from the repository's root directory.
If you've made changes to the code in the/examples or/tool directories,commit your work, then run the following command toverify it is up to date and matches the site standards.
./dash_site check-allIf this script reports any errors or warnings,then address those issues and rerun the command.If you have any issues, leave a comment on your issue or pull request,and we'll try our best to help you.You can also chat with us on the#hackers-devrel channelon theFlutter contributors Discord!
A build that fails with the errorError: Some code excerpts needed to be updated!means that one or more code excerpts in the site Markdown filesaren't identical to the code regions declaredin the corresponding.dart files.
The.dart files are the source of truth for code snippets,and the preceding<?code-excerpt> instructions in Markdown files specifyhow the snippets are copied from the.dart files.
To resolve this error and update the Markdown snippets to match,from the root of thewebsite directory,run./dash_site refresh-excerpts.
To learn more about creating, editing, and using code excerpts,check out theexcerpt updater package documentation.
Submitted pull requests can be automatically stagedby a site maintainer.If you'd like to stage the site yourself though,you can build a full version and upload it to Firebase.
- If you don't already have a Firebase project,
Navigate to theFirebase Consoleand create your own Firebase project (for example,
flutter-dev-staging).Head back to your local terminal and verify that you are logged in.
firebase loginEnsure that your project exists and activate that project:
firebase projects:listfirebase use <your-project>
From the root directory of the repository, build the site:
./dash_site buildThis builds the site and copies it to your local
_sitedirectory.If that directory previously existed, it will be replaced.Deploy to your activated Firebase project's default hosting site:
firebase deploy --only hostingNavigate to your PR on GitHub and include the link of the staged version.Do consider adding a reference to the commit you staged,so that reviewers know if any further changes have been made.
About
Flutter documentation web site
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Dart89.6%
- SCSS3.6%
- TypeScript3.4%
- JavaScript2.7%
- Shell0.4%
- Liquid0.2%
- Other0.1%