Repository navigation
Add dark mode to the Flutter blog #13954
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
Open
conooi
wants to merge
18
commits into
flutter:main
Choose a base branch
from
conooi:blog-dark-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+569
−242
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
62ce708
Add dark mode theme switcher and styles to the Flutter blog
conooi 4467bf7
Fix dark mode logo
conooi 743e9a6
Add improvements based on feedback
conooi 5709fd4
Merge branch 'main' into blog-dark-mode
conooi ca7aaed
Merge branch 'main' into blog-dark-mode
parlough 2db662a
Misc clean up
parlough e2df61e
Continue clean up
parlough 1ac2dac
Merge branch 'main' into blog-dark-mode
parlough fe7a635
Continue simplifications
parlough 0da950b
Don't close on selection
parlough eb88a4c
Simplifications
parlough e8ea6e8
Organize and increase consistency of updated code
parlough d8bd528
Continue clean up and add additional API docs
parlough 4f1dc36
Reduce overflow in header
parlough d7aab64
Avoid button backgrounds in dropdowns
parlough 199b6de
Fix positioning of header logo
parlough ae56abb
Fix header transition
parlough 20041ef
Merge branch 'main' into blog-dark-mode
parlough File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/site_shared/lib/components/blog/blog_card_layout.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright 2026, the Flutter authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that | ||
| // can be found in the LICENSE file. | ||
|
|
||
| /// The layout of a card in the blog index, | ||
| /// determined by its position among the visible cards. | ||
| enum BlogCardLayout { | ||
| /// A full-width card with a large image and title, | ||
| /// used to highlight the most prominent post. | ||
| featured, | ||
|
|
||
| /// A bordered tile that's arranged in a grid with other cards. | ||
| grid, | ||
|
|
||
| /// A full-width row with a small image beside the post details. | ||
| list, | ||
| ; | ||
|
|
||
| /// The CSS class applied to a `.blog-card` element to | ||
| /// style it with this layout. | ||
| String get className => switch (this) { | ||
| .featured => 'layout-featured', | ||
| .grid => 'layout-grid', | ||
| .list => 'layout-list', | ||
| }; | ||
|
|
||
| /// Returns the layout for the card at the specified [index] | ||
| /// among the visible cards. | ||
| /// | ||
| /// The first card is [featured], the next four are [grid], | ||
| /// and all remaining cards are [list]. | ||
| static BlogCardLayout forIndex(int index) => switch (index) { | ||
| 0 => featured, | ||
| < 5 => grid, | ||
| _ => list, | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.