Results for “BuildContext”
Full-text search across Boring Doc explanations, official documentation pages, the Flutter API index and every indexed version change.
Version changes
- Added BuildContext parameter to TextEditingController.buildTextSpan2.0.0breaking
BuildContext` parameter was added to `TextEditingController.buildTextSpan`. With the `BuildContext` available, users can access `InheritedWidgets` inside `buildTextSpan` to retrieve state required to style the text, or otherwise
- Deprecate findChildIndexCallback in favor of findItemIndexCallback in ListView and SliverList separated constructors3.41.0deprecated
account for separators. return itemIndex == -1 ? null : itemIndex * 2; }, itemBuilder: (BuildContext context, int index) { return ListTile( key: ValueKey (items[index]), title: Text(items[index]), ); }, separatorBuilder: (BuildContext
- More Strict Assertions in the Navigator and the Hero Controller Scope1.20.0breaking
throw exceptions. ```dart import 'package:material_ui/material_ui.dart'; void main() { runApp( MaterialApp( builder: (BuildContext context, Widget child) { // Builds two parallel navigators. This throws // error because both of navigators
- Default multitouch scrolling3.19.0breaking
MyCustomScrollBehavior extends MaterialScrollBehavior { // Override behavior methods and getters like multitouchDragStrategy @override MultitouchDragStrategy getMultitouchDragStrategy(BuildContext context) => MultitouchDragStrategy.sumAllPointers; } // Set ScrollBehavior for an entire application. MaterialApp( scrollBehavior: MyCustomScrollBehavior(), // ... ); ``` ### Setting
- SnackBars managed by the ScaffoldMessenger2.0.0breaking
SnackBar`s would be shown by calling on the `Scaffold` within the current `BuildContext`. By calling `Scaffold.of(context).showSnackBar`, the current `Scaffold` would animate a `SnackBar` into
- Redesigned the Radio widget3.35.0breaking
them with `RadioGroup`. ### Case 1: trivial case Code before migration: ```dart Widget build(BuildContext context) { return Column( children: [ Radio ( value: 0, groupValue: _groupValue, onChanged: (int? value) { setState
- Default Scrollbars on Desktop2.2.0breaking
dart final ScrollController controller = ScrollController(); Scrollbar( controller: controller, child: ListView.builder( controller: controller, itemBuilder: (BuildContext context, int index) { return Text('Item $index'); } ) ); ``` Code after migration: ```dart final ScrollController
- Deprecated the window singleton3.10.0deprecated
static `window` property, application and library code that has access to a `BuildContext` should use `View.of` to look up the `FlutterView` the context is associated with. Some
- Deprecate OverlayPortal.targetsRootOverlay3.38.0deprecated
with `overlayLocation` instead. ### Case 1: trivial case Code before migration: ```dart Widget build(BuildContext context) { return OverlayPortal.targetsRootOverlay( controller: myController, overlayChildBuilder: _myBuilder, child: myChild, ); } ``` Code after migration: ```dart
- Actions API revision1.20.0breaking
TheAction.key)` instance. Code before migration: ```dart class MyWidget extends StatelessWidget { // ... @override Widget build(BuildContext context) { return Shortcuts( shortcuts: <LogicalKeySet, Intent> { LogicalKeySet(LogicalKeyboardKey.enter): Intent(ActivateAction.key), }, child: Actions( actions
- Trackpad gestures can trigger GestureRecognizer3.3.0breaking
Trackpad gestures on most platforms now send `PointerPanZoom` sequences and can trigger
- MouseTracker no longer attaches annotations1.17.0breaking
Removed `MouseTracker`'s methods `attachAnnotation`, `detachAnnotation`, and `isAnnotationAttached`. The `MouseTracker` class has
- Default PrimaryScrollController on Desktop3.3.0breaking
constraints) { return Row( children: [ SizedBox( height: constraints.maxHeight, width: constraints.maxWidth / 2, child: ListView.builder( itemBuilder: (BuildContext context, int index) { return Text
- Default drag scrolling devices2.5.0breaking
widget Code before migration: ```dart final ScrollController controller = ScrollController(); ListView.builder( controller: controller, itemBuilder: (BuildContext context, int index) { return Text('Item $inde
- TextField requires MaterialLocalizations1.20.0breaking
material_ui/material_ui.dart'; void main() => runApp(Foo()); class Foo extends StatelessWidget { @override Widget build(BuildContext context) { return MediaQuery( data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Material( child
- Removed ignoringSemantics3.13.0removed
semantics tree. class _IgnorePointerWithSemantics extends SingleChildRenderObjectWidget { const _IgnorePointerWithSemantics({ super.child, }); @override _RenderIgnorePointerWithSemantics createRenderObject(BuildContext context) { return _Rende
- CupertinoTabBar requires Localizations parent1.17.0breaking
cupertino_ui/cupertino_ui.dart'; void main() => runApp(Foo()); class Foo extends StatelessWidget { @override Widget build(BuildContext context) { return MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( items: const [ BottomNavigationBarItem( icon: Icon
- IconData class marked as final3.44.0breaking
final String? fontFamily; @override final String? fontPackage; @override final bool matchTextDirection; } Widget build(BuildContext context) { // Example usage of AppIcons: return Icon(AppIcons.arrowUpward); } ``` To maintain dot shorthand support
- Deprecate ExpansionTileController in favor of ExpansibleController3.32.0deprecated
migration: ```dart class _MyWidgetState extends State { final ExpansionTileController controller = ExpansionTileController(); @override Widget build(BuildContext context) { return ExpansionTile( controller: controller, ); } } ``` Code after migration: ```dart class _MyWidgetState extends State
- Deprecate SystemContextMenuController.show3.32.0deprecated
hood. No migration is needed: ```dart class _MyWidgetState extends State { @override Widget build(BuildContext context) { TextField( contextMenuBuilder: (BuildContext context, EditableTextState editableTextState) { return SystemContextMenu.editableText( editableTextState: editableTextState
- The new Form, FormField auto-validation API1.22.0breaking
changes. Code before migration: ```dart class MyWidget extends StatelessWidget { @override Widget build(BuildContext context) { return FormField( autovalidate: true, builder: (FormFieldState state) { return Container(); }, ); } } ``` Code after migration: ```dart
- Dialogs' Default BorderRadius1.20.0breaking
material_ui/material_ui.dart'; void main() => runApp(Foo()); class Foo extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( floatingActionButton: FloatingActionButton(onPressed: () { showDialog( context: context, builder: (BuildContext
- Rebuild optimization for OverlayEntries and Routes1.17.0breaking
migration: ```dart class FooState extends State { String buttonLabel = 'Click Me'; @override Widget build(BuildContext context) { return ElevatedButton( onPressed: () async { // Illegal state modification that should
- Eliminating nullOk Parameters2.0.0breaking
using static member functions that are typically called `of`, and take a `BuildContext`. In order to modify your code to use the new form of the APIs
- Migrate ShortcutActivator and ShortcutManager to KeyEvent system3.16.0breaking
For some time now (years), Flutter has had two key event systems
- Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system3.19.0breaking
For some time now (years), Flutter has had two key event systems
- Migrate to standalone material_ui and cupertino_ui packagesunreleasedbreaking
The Material and Cupertino design libraries are now available as standalone packages
- Accessibility traversal order of tooltip changed3.19.0breaking
tree in your test: ```dart Directionality( textDirection: TextDirection.ltr, child: Overlay( initialEntries: [ OverlayEntry( builder: (BuildContext context) { return ListView( children: [ const Text('before'), Tooltip( key: tooltipKey, showDuration: const Duration
- Replaced parameters for customizing context menus with a generic widget builder3.7.0breaking
Context menus, or text selection toolbars, are the menus that show up