-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Decoupling Material and Cupertino (with dart fixes) #11669
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
justinmc
wants to merge
7,851
commits into
flutter:main
Choose a base branch
from
justinmc:decoupling-material-and-cupertino-and-fixes
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.
Open
Changes from 250 commits
Commits
Show all changes
7851 commits
Select commit
Hold shift + click to select a range
84bb52d
Make sure that a CupertinoTabBar doesn't crash in 0x0 environment (#1…
ahmedsameha1 fc56b33
Make sure that a CupertinoLinearActivityIndicator doesn't crash in 0x…
ahmedsameha1 7d10f15
Make sure that a TimePickerDialog doesn't crash in 0x0 environment (#…
ahmedsameha1 006ae29
Make sure that a UserAccountsDrawerHeader doesn't crash in 0x0 enviro…
ahmedsameha1 3391717
Remove deprecated `activeColor` in `switch.0.dart` example (#178293)
AbdeMohlbi de8e834
Make sure that a Stepper doesn't crash in 0x0 environment (#178068)
ahmedsameha1 c25194c
Make sure that a SearchAnchor doesn't crash in 0x0 environment (#177749)
ahmedsameha1 19878ad
Refactor `_isLabel` method in `stepper.dart` to use `any` for better …
AbdeMohlbi 3a0c8a0
Add framework-side hitTestBehavior support to Semantics (#178817)
flutter-zl 1afe411
Reverts "Add framework-side hitTestBehavior support to Semantics (#17…
auto-submit[bot] 32f985f
Modernize framework lints (#179089)
Piinks fc80e65
Add flutter_lints to samples (#179091)
loic-sharma 11b4926
Make sure that a CupertinoActivityIndicator doesn't crash in 0x0 envi…
ahmedsameha1 8b070fe
Update some comments to reflect theme normalization (#179013)
bleroux 04a9f87
Unfocus search anchor bar when the view is closed (#178910)
68ec8f8
Fix crash when text editing value changes between scrolls (#179163)
Renzo-Olivares 4379a84
Migrate samples and docs to RadioGroup (#179158)
loic-sharma 381fd35
Update some BottomNavigationBar comments to reflect theme normalizati…
bleroux bae2117
Add DropdownMenu.selectOnly (#179189)
bleroux 9a79874
Reimplemented StretchingOverscrollIndicator with Simulation ported fr…
MTtankkeo 9684541
Update several comments related to theme normalization (#179457)
bleroux 2fb7649
Make sure that a CupertinoScrollbar doesn't crash in 0x0 environment …
ahmedsameha1 7d6b318
Make sure that a CupertinoTimerPicker doesn't crash in 0x0 environmen…
ahmedsameha1 49eaa60
Make sure that a CupertinoButton doesn't crash in 0x0 environment (#1…
ahmedsameha1 bf96b39
Make sure that a CupertinoApp doesn't crash in 0x0 environment (#178610)
ahmedsameha1 0933360
Make sure that a CupertinoCheckbox doesn't crash in 0x0 environment (…
ahmedsameha1 976e527
Replace dropdown button with dropdown menu (#179095)
ahmedsameha1 0a0bbeb
Make sure that CupertinoNavigationBar doesn't crash in 0x0 environmen…
ahmedsameha1 eea19db
Make sure that a CupertinoListTileChevron doesn't crash in 0x0 enviro…
ahmedsameha1 0e8dc90
Make sure that a CupertinoAlertDialog doesn't crash in 0x0 environmen…
ahmedsameha1 a49d689
Make sure that a CupertinoPicker doesn't crash in 0x0 environment (#1…
ahmedsameha1 827f370
Make sure that a CupertinoSearchTextField doesn't crash in 0x0 enviro…
ahmedsameha1 3fce10d
Make sure that a CupertinoRadio doesn't crash in 0x0 environment (#17…
ahmedsameha1 f5a6611
Make sure that a CupertinoContextMenuAction doesn't crash in 0x0 envi…
ahmedsameha1 d9cc959
Make sure that a CupertinoFormRow doesn't crash in 0x0 environment (#…
ahmedsameha1 e28c031
Make sure that a CupertinoPopupSurface doesn't crash in 0x0 environme…
ahmedsameha1 ff7cba2
Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment …
ahmedsameha1 7a0ecd5
Make sure that a CupertinoListTile doesn't crash in 0x0 environment (…
ahmedsameha1 fdfd26c
Make sure that a CupertinoExpansionTile doesn't crash in 0x0 environm…
ahmedsameha1 3533eb2
Make sure that a CupertinoPickerDefaultSelectionOverlay doesn't crash…
ahmedsameha1 b6ada8e
Make sure that a CupertinoActionSheetAction doesn't crash in 0x0 envi…
ahmedsameha1 f700832
Relax assertion for adding semantics locale (#178140)
chunhtai f623bdd
Make sure that a CupertinoPageScaffold doesn't crash in 0x0 environme…
ahmedsameha1 2c370bd
Make sure that a CupertinoSlider doesn't crash in 0x0 environment (#1…
ahmedsameha1 ee94b62
Make sure that a CupertinoSegmentedControl doesn't crash in 0x0 envir…
ahmedsameha1 64f0d16
Make sure that a Tooltip doesn't crash in 0x0 environment (#178461)
ahmedsameha1 489a271
Make sure that a CupertinoMagnifier doesn't crash in 0x0 environment …
ahmedsameha1 4a861cc
Make sure that a CupertinoFormSection doesn't crash in 0x0 environmen…
ahmedsameha1 6d0f81b
Make sure that a CupertinoListSection doesn't crash in 0x0 environmen…
ahmedsameha1 ad5d64f
Make sure that a CupertinoDialogAction doesn't crash in 0x0 environme…
ahmedsameha1 de4c546
Reland: Add framework-side hitTestBehavior support to Semantics (#178…
flutter-zl e62ed2e
Add `Adwaita Sans` as a font fallback on Linux (#179144)
adil192 4a0b28a
Feat: Add top gap for cupertino sheet (#171348)
rkishan516 e25711e
Update some comments related to theme normalization (#179624)
bleroux 668e27f
ListTile fix MinIntrinsicHeight calculation (#179515)
RamonFarizel 0ff87e0
Make sure that a CupertinoSwitch doesn't crash in 0x0 environment (#1…
ahmedsameha1 543fee1
Make sure that a CupertinoTextField doesn't crash in 0x0 environment …
ahmedsameha1 cca8f66
Make sure that a CupertinoTabView doesn't crash in 0x0 environment (#…
ahmedsameha1 5ec82e1
Make sure that a CupertinoTextFormFieldRow doesn't crash in 0x0 envir…
ahmedsameha1 fbe3345
Adds property passthrough for CheckboxListTile, SwitchListTile and Ra…
Guldem b2fef10
Update more comments related to theme normalization (#179682)
bleroux 9135736
Add FloatingActionButtonTheme (#179736)
bleroux 181c04f
Update the Material `IconAlignment` sample (#179159)
loic-sharma cca9439
Clamps input value for progress indicator (#179898)
chunhtai 5381c45
Improve assertion messages in Tab widget for better clarity (#178295)
JeelChandegra eebe9fe
Improve the documentation of `Card` (#178834)
dkwingsmt 01474d5
Add Slider.showValueIndicator property. (#179661)
ksokolovskyi 8fc8eba
Remove an obsolete TODO in DataTable (#180033)
dkwingsmt 52ce949
fix: Enable mouse drag for RefreshIndicator.noSpinner example (#180066)
Franklyn-R-Silva e072fae
Make sure that a CupertinoTextSelectionToolbarButton doesn't crash in…
ahmedsameha1 c9c9e3a
Remove unnecessary RadioGroup migration TODOs (#180105)
loic-sharma c9403d6
Add SnackBarTheme (#180001)
bleroux 18b9fd6
docs: clarify dropdown menu text clearing (#179676)
kazbeksultanov bdbf451
Enhance documentation for sortable column behavior (#180011)
AbdeMohlbi 924bcc6
fix: exclude semantics for disabled dates (#178981)
rkishan516 2726183
[Framework] iOS style blurring and `ImageFilterConfig` (#175473)
dkwingsmt 0f0617c
Some cleanup of cross library test imports (#177029)
justinmc 2fb97ec
Relands "Feat: Add a11y for loading indicators (#165173)" (#178402)
chunhtai ef5fd72
Add accessibilityAnnouncement matcher (#180058)
zemanux 02b9689
Replace semantic announcements in expansion tile for Android (#179917)
hannah-hyj d5a11db
Add DropdownMenuFormField.errorBuilder (#179345)
bleroux be08c73
Fix DropdownMenuEntry.style not resolved when entry is highlighted (#…
bleroux 7a03609
Fix TabBar.image does not render at initialIndex for the first time (…
afc5454
New isSemantics and deprecate containsSemantics (#180538)
zemanux 857d975
Fix Drawer.child docstring to say ListView instead of SliverList (#18…
nathannewyen c2f77cc
Raw tooltip with smaller API surface that exposes tooltip widget (#17…
victorsanni e54437d
Add drag handle to CupertinoSheet (#179962)
MitchellGoodwin 27db7c2
Do not dispose CupertinoSheetTransition animation on update and throw…
MitchellGoodwin a0bc453
Fix typo in dropdown_menu.dart (#180172)
Koichi5 354799c
[A11y ] Add `clearSemantics`in table (#180665)
hannah-hyj eb91373
Make sure that a CupertinoTabScaffold doesn't crash in 0x0 environmen…
ahmedsameha1 8f5d7f7
Add API sample and docs for Expansible widget (#180273)
gowsikraja 8a42365
Add TabBar API example for scroll notification integration (#180728)
113e8c3
Fix RangeSlider dragged cursor handling. (#179988)
ksokolovskyi 27f62de
Add RouteSettings to showCupertinoSheet (#178643)
jonmountjoy 52c42fd
Implement superellipse support for CupertinoFocusHalo (#180724)
O-Hannonen e7d41b4
clean up usages of resetXyz for TestFlutterView (#180840)
navaronbracke 594acaa
Fix vertical SegmentedButton not filling available width under bounde…
Mairramer 4ae34e3
fix: clip ink highlights in NavigationDrawer when footer is present (…
ikramhasan e10bf0d
Add leadingIndex to CarouselController and onItemChanged to CarouselV…
Mairramer 2f8ed09
Use null-aware elements in cupertino/nav_bar.dart (#181237)
brahim-guaali 8e87f9e
[Material] update hourFormat to use Dart 3 switch expression (#181041)
Enderjua 10c829c
Fix remove material import textfield (#181254)
kazbeksultanov 50422f2
Fixes Typo in codebase (#181256)
srivats22 fc7d610
Broaden the applicability of `Color` fix_data rules from flutter/pain…
b-luk 03564c8
Revert DropdownMenu non-nullable breaking change (#181074)
Gustl22 0db5499
Make topGap not required for CupertinoSheetTransition (#181269)
MitchellGoodwin 337b5fc
Add bottom navigation bar item semantics label (#180577)
Lilian-C 7ab663a
Reset TextFormField to initial value after state change (#181199)
Mairramer e65a3b5
Remove unnecessary Material import from dialog_test.dart (#181249)
kazbeksultanov e3dbc76
CupertinoSheetRoute with scrolling and dragging (#177337)
MitchellGoodwin 70d9098
[Material] modernize Typography._withPlatform with Dart 3 switch expr…
Enderjua 60bd72a
Add `alignment` to `SizeTransition` (#177895)
IvoneDjaja 67956a0
Fix Range Slider issue where indescrete ranges lead to out of range r…
chris-prenissl 59c76f1
[Material] modernize time picker components with Dart 3 switch expres…
Enderjua e57ced2
feat: add RoundedSuperellipseInputBorder (#177220)
rkishan516 ace6c25
Fix `todayBorder` todayBorder color is incorrectly overridden by `tod…
huycozy 765aa21
test: Improve DropdownMenuFormField tests (#181369)
Gustl22 e6b568a
Send statusBarTouch events via dedicated messages (#179643)
LongCatIsLooong e9cfcbc
[material/menu_anchor.dart] Add animations to MenuAnchor. (#176494)
davidhicks980 51a467c
Add isDark, isLight, and isSystem getters to ThemeMode (#181475)
Turskyi f4d5a3e
Deprecate onReorder callback (#178242)
navaronbracke c2638a4
Add `TestTextField` and migrate tests (#180494)
Renzo-Olivares 414ee23
180162 fix radio list tile and switch list tile accept widget states …
AnishTiwari5077 28e1057
Use null-aware spread in material/app.dart (#181586)
brahim-guaali 505083f
Use null-aware spread in cupertino/app.dart (#181585)
brahim-guaali 38fc030
Use null-aware elements in material/dialog.dart (#181244)
brahim-guaali 41231eb
Use null-aware elements in cupertino/list_tile.dart (#181243)
brahim-guaali 2f13faa
Remove material from slivers_appbar_floating_pinned_test.dart + slive…
navaronbracke 32dfb01
Reduce reliance on Material in page_transitions_test.dart (#181467)
navaronbracke 7f3694b
Remove material from scrollable_helpers_test.dart (#181460)
navaronbracke d9f81b9
Remove unnecessary Material import from cupertino/slider_test.dart (#…
nathannewyen dfac5b4
feat: Pass parameters from DropdownMenuFormField to DropDownMenu (#18…
Gustl22 94b3b57
[Material] Remove Material import from backdrop_filter_test.dart widg…
kazbeksultanov fe8bb22
[cupertino.dart] Implement CupertinoMenuAnchor and CupertinoMenuItem …
davidhicks980 8f89b5a
Reverts "[cupertino.dart] Implement CupertinoMenuAnchor and Cupertino…
auto-submit[bot] 9129cf7
fix: OutlineInputBorder not respecting BorderSide stroke alignment (#…
ikramhasan 8a17526
Introduce ScrollCacheExtent and also fixes unbound shrinkwrap cache e…
chunhtai 589f5ef
refactor: migrate CupertinoPageTransitionsBuilder to cupertino folder…
rkishan516 04442ae
[cupertino/dialog.dart] CupertinoPopupSurface: remove bounded paramet…
davidhicks980 4052385
Revert "Send statusBarTouch events via dedicated messages (#179643)" …
vashworth c2ae163
Enhance the Stepper widget by adding customizable header and content …
safwanidrees bc215ec
Fix misleading error message for color/decoration conflict (relands #…
dkwingsmt e7ec904
[Material] modernize legacy switch statements to expressions across m…
Enderjua 502f278
Preparation to add contentTextStyle flag to SimpleDialog. (#182200)
chingjun 3cc588a
Fix cross imports for all Cupertino tests (#181634)
navaronbracke 55c3a17
Add await to tester.pump callsites (#182398)
victorsanni 30e4964
Reverts "Fix cross imports for all Cupertino tests (#181634)" (#182404)
auto-submit[bot] 66c0316
[Reland] Cupertino cross imports (#182416)
navaronbracke b7cb26b
Add contentTextStyle support to SimpleDialog (#178824)
777genius 5418e29
[a11y] RangeSlider mouse interaction should change keyboard focus (#…
hannah-hyj 88ee022
Clean up cross imports in single_child_scroll_view_test.dart, decorat…
navaronbracke cbd2cf9
Allow TabBar to receive a TabBarScrollController (#180389)
navaronbracke df77016
[web] Pass form validation errors to screen readers via aria-descript…
flutter-zl 828b094
Fixing ExpansionTile expandedAlignment not Accepts AlignmentGeometry …
devnoaman a86697f
Fix(Material): DateRangePicker ignores DatePickerTheme.dayShape (#181…
akhil-ge0rge d44b247
Move SelectionArea web test from widgets to material folder (#181951)
gbolahan507 69c2000
Handle#6537 first grouped tests (#182077)
ahmedsameha1 7489a3f
Add RawTooltip.ignorePointer (#182527)
victorsanni 8411ba1
Remove Material import from scroll_view_test.dart (#181281)
navaronbracke c99b833
Reland #179643, only scroll hit-testable primary scroll views on stat…
LongCatIsLooong f59572d
Add cupertino docimports for CupertinoPageTransitionsBuilder and fix …
victorsanni 9a7f259
Shortcircuit if Tooltip message and richMessage are empty (#182524)
victorsanni 86c08b5
Carousel: Migration from Scrollable+Viewport to CustomScrollView (#18…
Mairramer a9bf208
Reland Standardize on Test* widgets in *_tester.dart files (#182632)
justinmc 2d5853d
Use AnimationStyle curve and reverseCurve in ModalBottomSheet animati…
Mairramer e7f001e
Add WidgetStatesController support to ExpansionTile (#181238)
iamvikashtiwari fa60a17
Factor out unnecessary `assert`s (#182042)
nate-thegrate 3c65e1a
Updates MenuAnchor to respect software keyboard (#180975)
patrickBillingsley 564f347
Remove some instances of useMaterial3: true (#182944)
AbdeMohlbi 4e90d1f
`SizedBox.square()` (#182731)
nate-thegrate 26a232f
[A11y] in calendar date picker, remove SemanticsService.sendAnnouncem…
hannah-hyj 4202752
Add warning when there is a widget with color between `Material` and …
QuncCccccc 2d9c390
Eliminate rebuilds for Scaffold FAB animation (#182331)
nate-thegrate e8b21b2
Add await to flutter_test callsites (#182983)
victorsanni ac8a5cc
Windowing implementation of `showDialog` that uses a native desktop w…
mattkae 41ab796
Add fallbackColor for PredictiveBackPageTransitionBuilder and Predict…
victorsanni 407a368
refactor: remove material from widget_inspector_test, sliver_cross_ax…
rkishan516 7df96ba
Add displayCornerRadii support to predictive back transitions. (#181326)
ksokolovskyi e91301f
Remove material from scrollable_test.dart (#181429)
navaronbracke 83f6dd4
[material/menu_anchor.dart] Ensure positioned menus always begin anim…
davidhicks980 35dad2c
Fix reselection issue after the text is cleared (#183545)
QuncCccccc 59c8873
Add await to more flutter/flutter callsites (#183413)
victorsanni 0037e39
Add awaits to flutter/test callsites (#183487)
victorsanni 9d7145f
Add mainAxisAlignment to NavigationRail (#183514)
mbcorona 2d0896b
Framework: Improve DropdownButton selectedItemBuilder assertion (#183…
mbcorona 37daf9c
Add a Clarification for the docs of suggestionsBuilder of SearchAncho…
ahmedsameha1 19ff4a1
Fixes animation glitch into bottom sheet (#183303)
Mairramer 0e2a6b9
[Slider] Refactor test "Value indicator appears when it should" (#183…
dkwingsmt b2dc66b
Fix Semantics expanded state not updating in PopupMenuButton and Drop…
AhmedLSayed9 54e094b
Replace BorderRadius.circular with const BorderRadius.all and update …
BrainLUX a336f29
Add assert for mutually exclusive errorBuilder and errorText (#183901)
muradhossin 12d0ee8
Add scrollPadding property to DropdownMenu (#183109)
ishaquehassan 5b31e29
[Slider] Remove value indicator painter when animation is dismissed (…
dkwingsmt a80ac40
Refactor layout dimensions (#184066)
Piinks a1b48e9
[Dot shorthands] Migrate examples/api/lib/material (#183963)
loic-sharma a5a643a
feat: add infinite carousel support (#175710)
rkishan516 29d73d4
For ShapeBorder instances with preferPaintInterior=true, use paintInt…
b-luk e2b8a72
Reland "Fix Slider semantics node size" with some changes (#184168)
hannah-hyj 7170f77
Update TabBar documentation to clarify indicatorWeight behavior (#184…
saurabh-mirajkar 2247e76
Even more awaits (#184042)
victorsanni 6db5aaf
Revert "Even more awaits (#184042)" (#184429)
gaaclarke 269018c
Add bottom safe area padding to licenses package license page (#182425)
sysint64 69dea74
[ios] Add opt-in inline prediction text input support (#183650)
nikb7 2fc901a
Replace usages of `MediaQuery.of(context).property` with `MediaQuery.…
AbdeMohlbi 50144ea
Remove sliver_test_utils cross-import from sliver_app_bar_test (#184193)
Sanaullah49 5d536e7
Reland "Even more awaits" (#184467)
victorsanni f53cc85
Fix line breaks being lost when copying after selection gesture in Se…
Renzo-Olivares ee41c63
Remove live_text_utils cross-imports from material and cupertino test…
xfce0 7a72eca
[Dot shorthands] Migrate examples/api/lib/cupertino (#183964)
loic-sharma 2582828
[A11y] Allow percentage strings like "50%" as `SemanticsValue` for `P…
hannah-hyj 3ee11b9
[widgets/raw_menu_anchor.dart] Always call onClose and onCloseRequest…
davidhicks980 3b94e02
[cupertino.dart] Implement CupertinoMenuAnchor and CupertinoMenuItem …
davidhicks980 dc0d989
Remove editable_text_utils cross-imports from material and cupertino …
xfce0 923e6e0
Add more error handling to unawaited callsites (#184526)
victorsanni d227d26
Remove navigator_utils cross-imports from cupertino tests (#184282)
xfce0 552d733
[Dot shorthands] Migrate examples/api/test (#183966)
loic-sharma 8b55350
Remove last material dependency from cupertino tests (#184781)
Piinks d9e1b34
Enable the `avoid_final_parameters` lint. (#185216)
kallentu dcb3f86
test: inline TestCallbackPainter in cupertino/picker_test.dart (#185398)
shivanshu877 0b83bd5
Remove semantics_tester import from user_accounts_drawer_header_test.…
Sanaullah49 a1e97c9
Remove semantics_tester import from raw_material_button_test.dart (#1…
Sanaullah49 9defdae
Inline test callback painter in tab scaffold test (#184851)
DaveT1991 f8db4f4
Remove trivial test utility cross-imports from material and cupertino…
xfce0 7b9f28c
Remove semantics_tester cross-import from segmented_button_test.dart …
spandan3001 62f3d4d
Remove semantics_tester import from cupertino/slider_test.dart (#184805)
Sanaullah49 5e0c259
Merge remote-tracking branch 'source-origin/master' into decoupling-m…
justinmc a4fc11b
Move all copied code to its correct location.
justinmc d5cd369
Material exports
justinmc b748886
Cupertino imports.
justinmc fb62d65
Set up material_ui_examples package.
justinmc fb0d6ac
All example tests pass
justinmc 71a4891
Fix material_ui_examples readme paths
justinmc 26def7c
Set up cupertino_ui_examples package.
justinmc 9f17a4e
All cupertino example tests pass.
justinmc 826c5b9
material_ui import cupertino_ui in main code
justinmc 0472114
publish_to: none
justinmc f0e4e1f
material_ui_examples references new packages correctly, and tests pass.
justinmc f9a6f56
cupertino_ui_examples references new packages correctly, and tests pass.
justinmc 6d40c22
material_ui test directory organization
justinmc 51c9445
Additional files for fix_data and test_fixes directories
justinmc 9ca98b7
material_ui tests import material_ui/material_ui.dart.
justinmc afa1400
Doc import from material.dart to material_ui.dart
justinmc 69833c1
Test fixes import material_ui/material_ui.dart.
justinmc aacb751
Imports updated in material_ui dart fixes.
justinmc 2cd6f87
Imports updated in cupertino_ui dart fixes.
justinmc 48aa027
Migrate cupertino imports in cupertino_ui tests
justinmc b7779c3
Migrate docImports of Material in cupertino_ui.
justinmc 3ee626f
material_ui tests import cupertino_ui correctly.
justinmc 5c7f674
Skip cupertino_ui test files that fail due to cross imports.
justinmc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Unused platform specific files | ||
| android/ | ||
| ios/ |
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,10 @@ | ||
| # This file tracks properties of this Flutter project. | ||
| # Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
| # | ||
| # This file should be version controlled and should not be manually edited. | ||
|
|
||
| version: | ||
| revision: "89172fc6152056af222e0afcf6e2d6ee4e9f6f8f" | ||
| channel: "master" | ||
|
|
||
| project_type: package |
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,166 @@ | ||
| # cupertino_ui API Example Code | ||
| This directory contains the example code that is referenced in the documentation | ||
| in cupertino_ui's source code. | ||
|
|
||
| These examples were originally located [in | ||
| flutter/flutter](https://github.com/flutter/flutter/tree/master/examples/api) | ||
| before the Cupertino library was decoupled and moved into its current home in | ||
| flutter/packages. | ||
|
|
||
| The examples can be run individually by just specifying the path to the example | ||
| on the command line (or in the run configuration of an IDE). | ||
|
|
||
| For example (no pun intended!), to run the first example from the | ||
| `CupertinoActivityIndicator` class in Chrome, you would run it like so from the | ||
| [api](.) | ||
| directory: | ||
|
|
||
| ``` | ||
| % flutter run -d chrome lib/activity_indicator/cupertino_activity_indicator.0.dart | ||
| ``` | ||
|
|
||
| All of these same examples are available on the API docs site. | ||
|
|
||
| <!-- TODO(justinmc): Include a link to the docs page with the example above like this: For instance, the example above is available on [this page](https://api.flutter.dev/flutter/animation/Curve2D-class.html#animation.Curve2D.1). | ||
| --> | ||
|
|
||
| <!-- TODO(justinmc): Uncomment when Dartpads work again. | ||
| Most of the samples are available as interactive examples in | ||
| [Dartpad](https://dartpad.dev), but some (the ones marked with `{@tool sample}` | ||
| in the framework source code), just don't make sense on the web, and so are | ||
| available as standalone examples that can be run here. For instance, setting the | ||
| system overlay style doesn't make sense on the web (it only changes the | ||
| notification area background color on Android), so you can run the example for | ||
| that on an Android device like so: | ||
|
|
||
| ``` | ||
| % flutter run -d MyAndroidDevice lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart | ||
| ``` | ||
| --> | ||
|
|
||
| ## Naming | ||
|
|
||
| > `lib/file/class_name.n.dart` | ||
| > | ||
| > `lib/file/class_name.member_name.n.dart` | ||
|
|
||
| The naming scheme corresponds to the files under [lib/src](../lib/src) where | ||
| each file is represented as a directory (without the `.dart` suffix), and each | ||
| sample in the file is a separate file in that directory. So, for the example | ||
| above, where the examples are from the | ||
| [lib/src/activity_indicator.dart](../lib/src/activity_indicator.dart) file, the | ||
| `CupertinoActivityIndicator` class, the first sample (hence the index "0") for | ||
| that symbol resides in the file named | ||
| [lib/activity_indicator/cupertino_activity_indicator.0.dart](lib/activity_indicator/cupertino_activity_indicator.0.dart). | ||
|
|
||
| Symbol names are converted from "CamelCase" to "snake_case". Dots are left | ||
| between symbol names, so the first example for symbol | ||
| `InputDecoration.prefixIconConstraints` would be converted to | ||
| `input_decoration.prefix_icon_constraints.0.dart`. | ||
|
|
||
| If the same example is linked to from multiple symbols, the source will be in | ||
| the canonical location for one of the symbols, and the link in the API docs | ||
| block for the other symbols will point to the first symbol's example location. | ||
|
|
||
| ## Authoring | ||
|
|
||
| > For more detailed information about authoring examples, see | ||
| > [the snippets package](https://pub.dev/packages/snippets). | ||
|
|
||
| When authoring examples, first place a block in the Dartdoc documentation for | ||
| the symbol you would like to attach it to. Here's what it might look like if you | ||
| wanted to add a new example to the `CupertinoActivityIndicator` class: | ||
|
|
||
| ```dart | ||
| /// {@tool dartpad} | ||
| /// Write a description of the example here. This description will appear in the | ||
| /// API web documentation to introduce the example. | ||
| /// | ||
| /// ** See code in cupertino_ui_examples/lib/activity_indicator/cupertino_activity_indicator.0.dart ** | ||
| /// {@end-tool} | ||
| ``` | ||
|
|
||
| The "See code in" line needs to be formatted exactly as above, with no wrapping | ||
| or newlines, one space after the "`**`" at the beginning, and one space before | ||
| the "`**`" at the end, and the words "See code in" at the beginning of the line. | ||
| This is what the snippets tool use when finding the example source code that you | ||
| are creating. | ||
|
|
||
| <!-- TODO(justinmc): Uncomment when Dartpad works again. | ||
| Use `{@tool dartpad}` for Dartpad examples, and use `{@tool sample}` for | ||
| examples that shouldn't be run/shown in Dartpad. | ||
|
|
||
| Once that comment block is inserted in the source code, create a new file at the | ||
| appropriate path under [`examples/api`](.). See the | ||
| [sample_templates](./lib/sample_templates/) directory for examples of different | ||
| types of samples with some best practices applied. | ||
|
|
||
| The filename should match the location of the source file it is linked from, and | ||
| is named for the symbol it is attached to, in lower_snake_case, with an index | ||
| relating to their order within the doc comment. So, for the `Curve2D` example | ||
| above, since it's in the `animation` library, in a file called `curves.dart`, | ||
| and it's the first example, it should have the name | ||
| `examples/api/lib/animation/curves/curve2_d.0.dart`. | ||
| --> | ||
|
|
||
| You should also add tests for your sample code under | ||
| [`cupertino_ui_examples/test`](./test), that matches their location under [lib](./lib), | ||
| ending in `_test.dart`. See the section on [writing tests](#writing-tests) for | ||
| more information on what kinds of tests to write. | ||
|
|
||
| The entire example should be in a single file, so that Dartpad can load it. | ||
|
|
||
| Only packages that can be loaded by Dartpad may be imported. If you use one that | ||
| hasn't been used in an example before, you may have to add it to the | ||
| [pubspec.yaml](pubspec.yaml) in the [cupertino_ui_examples](./) directory. | ||
|
|
||
| ## Snippets | ||
|
|
||
| There is another type of example that can also be authored, using `{@tool | ||
| snippet}`. Snippet examples are just written inline in the source, like so: | ||
|
|
||
| ```dart | ||
| /// {@tool dartpad} | ||
| /// Write a description of the example here. This description will appear in the | ||
| /// API web documentation to introduce the example. | ||
| /// | ||
| /// ```dart | ||
| /// // Sample code goes here, e.g.: | ||
| /// const Widget emptyBox = SizedBox(); | ||
| /// ``` | ||
| /// {@end-tool} | ||
| ``` | ||
|
|
||
| The source for these snippets isn't stored under the [`cupertino_ui_examples`](.) | ||
| directory, or available in Dartpad in the API docs, since they're not intended | ||
| to be runnable, they just show some incomplete snippet of example code. It must | ||
| compile (in the context of the sample analyzer), but doesn't need to do | ||
| anything. See [the snippets documentation]( | ||
| https://pub.dev/packages/snippets#snippet-tool) for more information about the | ||
| context that the analyzer uses. | ||
|
|
||
| ## Writing Tests | ||
|
|
||
| Examples are required to have tests. There is already a "smoke test" that simply | ||
| builds and runs all the API examples, just to make sure that they start up | ||
| without crashing. Functionality tests are required the examples, and generally | ||
| just do what is normally done for writing tests. The one thing that makes it | ||
| more challenging to do for examples is that they can't really be written for | ||
| testability in any obvious way, since that would complicate the examples and | ||
| make them harder to explain. | ||
|
|
||
| As an example, in regular framework code, you might include a parameter for a | ||
| `Platform` object that can be overridden by a test to supply a dummy platform, | ||
| but in the example. This would be unnecessarily complex for the example. In all | ||
| other ways, these are just normal tests. You don't need to re-test the | ||
| functionality of the widget being used in the example, but you should test the | ||
| functionality and integrity of the example itself. | ||
|
|
||
| Tests go into a directory under [test](./test) that matches their location under | ||
| [lib](./lib). They are named the same as the example they are testing, with | ||
| `_test.dart` at the end, like other tests. For instance, an | ||
| `CupertinoActivityIndicator` example that resides in | ||
| [`lib/activity_indicator/cupertino_activity_indicator.0.dart`]( ./lib/activity_indicator/cupertino_activity_indicator.0.dart) would | ||
| have its tests in a file named | ||
| [`test/activity_indicator/cupertino_activity_indicator.0_test.dart`]( | ||
| ./test/activity_indicator/cupertino_activity_indicator.0_test.dart) |
12 changes: 12 additions & 0 deletions
12
packages/cupertino_ui/cupertino_ui_examples/analysis_options.yaml
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,12 @@ | ||
| # This file is also used by dev/bots/analyze_snippet_code.dart to analyze code snippets (`{@tool snippet}` sections). | ||
|
|
||
| # The following line activates a set of recommended lints for Flutter apps, | ||
| # packages, and plugins designed to encourage good coding practices. | ||
| include: package:flutter_lints/flutter.yaml | ||
|
|
||
| linter: | ||
| rules: | ||
| # Samples want to print things pretty often. | ||
| avoid_print: false | ||
| # Samples are sometimes incomplete and don't show usage of everything. | ||
| unreachable_from_main: false |
75 changes: 75 additions & 0 deletions
75
...rtino_ui/cupertino_ui_examples/lib/activity_indicator/cupertino_activity_indicator.0.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,75 @@ | ||
| // Copyright 2014 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. | ||
|
|
||
| import 'package:cupertino_ui/cupertino_ui.dart'; | ||
|
|
||
| /// Flutter code sample for [CupertinoActivityIndicator]. | ||
|
|
||
| void main() => runApp(const CupertinoIndicatorApp()); | ||
|
|
||
| class CupertinoIndicatorApp extends StatelessWidget { | ||
| const CupertinoIndicatorApp({super.key}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return const CupertinoApp( | ||
| theme: CupertinoThemeData(brightness: .light), | ||
| home: CupertinoIndicatorExample(), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| class CupertinoIndicatorExample extends StatelessWidget { | ||
| const CupertinoIndicatorExample({super.key}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return const CupertinoPageScaffold( | ||
| navigationBar: CupertinoNavigationBar( | ||
| middle: Text('CupertinoActivityIndicator Sample'), | ||
| ), | ||
| child: Center( | ||
| child: Column( | ||
| mainAxisAlignment: .spaceEvenly, | ||
| children: <Widget>[ | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| // Cupertino activity indicator with default properties. | ||
| CupertinoActivityIndicator(), | ||
| SizedBox(height: 10), | ||
| Text('Default'), | ||
| ], | ||
| ), | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| // Cupertino activity indicator with custom radius and color. | ||
| CupertinoActivityIndicator( | ||
| radius: 20.0, | ||
| color: CupertinoColors.activeBlue, | ||
| ), | ||
| SizedBox(height: 10), | ||
| Text( | ||
| 'radius: 20.0\ncolor: CupertinoColors.activeBlue', | ||
| textAlign: .center, | ||
| ), | ||
| ], | ||
| ), | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| // Cupertino activity indicator with custom radius and disabled | ||
| // animation. | ||
| CupertinoActivityIndicator(radius: 20.0, animating: false), | ||
| SizedBox(height: 10), | ||
| Text('radius: 20.0\nanimating: false', textAlign: .center), | ||
| ], | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
77 changes: 77 additions & 0 deletions
77
...i/cupertino_ui_examples/lib/activity_indicator/cupertino_linear_activity_indicator.0.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,77 @@ | ||
| // Copyright 2014 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. | ||
|
|
||
| import 'package:cupertino_ui/cupertino_ui.dart'; | ||
|
|
||
| /// Flutter code sample for [CupertinoLinearActivityIndicator]. | ||
|
|
||
| void main() => runApp(const CupertinoLinearActivityIndicatorApp()); | ||
|
|
||
| class CupertinoLinearActivityIndicatorApp extends StatelessWidget { | ||
| const CupertinoLinearActivityIndicatorApp({super.key}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return const CupertinoApp( | ||
| theme: CupertinoThemeData(brightness: .light), | ||
| home: CupertinoIndicatorExample(), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| class CupertinoIndicatorExample extends StatelessWidget { | ||
| const CupertinoIndicatorExample({super.key}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return const CupertinoPageScaffold( | ||
| navigationBar: CupertinoNavigationBar( | ||
| middle: Text('CupertinoLinearActivityIndicator Sample'), | ||
| ), | ||
| child: Padding( | ||
| padding: .all(8.0), | ||
| child: Column( | ||
| mainAxisAlignment: .spaceEvenly, | ||
| children: <Widget>[ | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| CupertinoLinearActivityIndicator(progress: 0), | ||
| SizedBox(height: 10), | ||
| Text('Progress: 0'), | ||
| ], | ||
| ), | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| CupertinoLinearActivityIndicator(progress: 0.2), | ||
| SizedBox(height: 10), | ||
| Text('Progress: 0.2', textAlign: .center), | ||
| ], | ||
| ), | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| CupertinoLinearActivityIndicator(progress: 0.4, height: 10), | ||
| SizedBox(height: 10), | ||
| Text('Height: 10', textAlign: .center), | ||
| ], | ||
| ), | ||
| Column( | ||
| mainAxisAlignment: .center, | ||
| children: <Widget>[ | ||
| CupertinoLinearActivityIndicator( | ||
| progress: 0.6, | ||
| color: CupertinoColors.activeGreen, | ||
| ), | ||
| SizedBox(height: 10), | ||
| Text('Color: green', textAlign: .center), | ||
| ], | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax
.lightis invalid in Dart for referring to an enum member in this context. It should beBrightness.light. This issue is pervasive throughout the example files (e.g.,.center,.spaceEvenly,.all,.only,.symmetric,.date,.time,.w600).