Kate Lovett
9d96df2364
Modernize framework lints ( #179089 )
...
WIP
Commits separated as follows:
- Update lints in analysis_options files
- Run `dart fix --apply`
- Clean up leftover analysis issues
- Run `dart format .` in the right places.
Local analysis and testing passes. Checking CI now.
Part of https://github.com/flutter/flutter/issues/178827
- Adoption of flutter_lints in examples/api coming in a separate change
(cc @loic-sharma)
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-11-26 01:10:39 +00:00
Justin McCandless
6b7662649f
Diagnosticable, not toString, for IOSSystemContextMenuItemDatas ( #171028 )
...
Flutter prefers using Diagnosticable instead of toString. See
https://github.com/flutter/flutter/issues/169696 and the related PR
https://github.com/flutter/flutter/pull/169705 . This does the same thing
for a few more classes that I missed.
2025-06-26 23:12:03 +00:00
Paulik8
ce6817b0a1
Added equals and hashCode for TextInputConfiguration and AutofillConfiguration ( #162238 )
...
- Added equals and hashCode for `TextInputConfiguration` and
`AutofillConfiguration` (fixed
https://github.com/flutter/flutter/issues/139033 )
- Fixed copyWith method in `TextInputConfiguration` (fixed
https://github.com/flutter/flutter/issues/162236 )
- Added some tests
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
2025-02-05 21:46:56 +00:00
NabilaWorks
e0d7b588b6
Feature/twitter keyboard ( #161025 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
Fixes https://github.com/flutter/flutter/issues/64801
Example :
```dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Centered TextField Example',
theme: ThemeData(primarySwatch: Colors.blue),
home: CenteredTextFieldScreen(),
);
}
}
class CenteredTextFieldScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Centered TextField')),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
keyboardType: TextInputType.twitter,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Enter some text here',
),
),
),
),
);
}
}
```
https://github.com/user-attachments/assets/5a2a2a4a-6994-44b1-bb0e-395c24012ef8
https://github.com/user-attachments/assets/aefc7bc5-a997-4e0f-a74e-a39a4517c898
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Jenn Magder <magder@google.com>
2025-01-15 00:15:15 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework ( #160545 )
...
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.
**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.
---------
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
André Stein
1511370a92
[TextInput] Add TextInputType.webSearch ( #15762 ) ( #158323 )
...
This PR adds `TextInputType.webSearch` that allows to show a keyboard with ready access to a "." key on iOS. On Android this is re-mapped to `url` which shows the same behaviour as `webSearch` on iOS. This fixes issue #157562 .
There also is a [corresponding *engine* PR](https://github.com/flutter/engine/pull/56428 ).
Screenshot from iOS demo app:

2024-11-08 18:26:05 +00:00
Satsrag
c033b08df7
fix: cannot input new line using custom input control ( #140356 )
...
For https://github.com/flutter/flutter/issues/125875 and https://github.com/flutter/engine/pull/45522
According to [this discussion](https://github.com/flutter/flutter/pull/139446#discussion_r1424776370 ), Just added `forceMultiline` to JSON on `_configurationToJson`. @LongCatIsLooong @Renzo-Olivares
2024-01-03 01:58:24 +00:00
Michael Goderbauer
73bd978529
Migrate away from deprecated BinaryMessenger API ( #124348 )
...
Migrate away from deprecated BinaryMessenger API
2023-04-07 19:38:52 +00:00
Tanay Neotia
0e22aca785
Add support for image insertion on Android ( #110052 )
...
* Add support for image insertion on Android
* Fix checks
* Use proper Dart syntax on snippet
* Specify type annotation on list
* Fix nits, add some asserts, and improve example code
* Add missing import
* Fix nullsafety error
* Fix nullsafety error
* Remove reference to contentCommitMimeTypes in docs
* Fix nits
* Fix warnings and import
* Add test for content commit in editable_text_test.dart
* Check that URIs are equal in test
* Fix nits and rename functions / classes to be more self-explanatory
* Fix failing debugFillProperties tests
* Add empty implementation to `insertContent` in TextInputClient
* Tweak documentation slightly
* Improve docs for contentInsertionMimeTypes and fix assert
* Rework contentInsertionMimeType asserts
* Add test for onContentInserted example
* Switch implementation to a configuration class for more granularity in setting mime types
* Fix nits
* Improve docs and fix doc tests
* Fix more nits (LongCatIsLooong)
* Fix failing tests
* Make parameters (guaranteed by platform to be non-nullable) non-nullable
* Fix analysis issues
2023-01-31 19:46:18 +00:00
Justin McCandless
17eb2e8aeb
Ability to disable the browser's context menu on web ( #118194 )
...
Enables custom context menus on web
2023-01-30 09:03:03 -08:00
Callum Moffat
c53501d835
Send text direction in selection rects ( #117436 )
2023-01-04 04:00:08 +00:00
Xilai Zhang
338841afd3
Revert "Revert "Revert "Scribble mixin ( #104128 )" ( #114647 )" ( #114698 )" ( #115146 )
...
This reverts commit 3cde69e8d9dff7e081cb6daa6cd633c49176cb32.
2022-11-11 10:01:11 -08:00
Justin McCandless
3cde69e8d9
Revert "Revert "Scribble mixin ( #104128 )" ( #114647 )" ( #114698 )
...
Relands the "Scribble mixin" PR, which was reverted due to breaking a Google test in the last roll.
Breaks the Scribble feature out of TextInputClient in order to avoid breaking changes.
2022-11-07 11:28:27 -08:00
Casey Hillers
009fa69f3c
Revert "Scribble mixin ( #104128 )" ( #114647 )
...
This reverts commit b571abfbfd17b9ab7bdf73ac9758bbd87264979a.
2022-11-03 17:17:30 -07:00
Justin McCandless
b571abfbfd
Scribble mixin ( #104128 )
...
Refactors methods related to the iPad Scribble feature out of TextInputClient
2022-10-24 12:46:43 -07:00
J-P Nurmi
28e0f089a2
Reland "[text_input] introduce TextInputControl" ( #113758 )
2022-10-24 07:23:32 -07:00
Zachary Anderson
9064bf674b
Revert "[text_input] introduce TextInputControl ( #76072 )" ( #113724 )
...
This reverts commit 2fdfa29e081bb368bf11b6177e4e9bb7c8ad4d34.
2022-10-19 15:00:00 -07:00
Justin McCandless
a832a72036
Handle privatecommand messages that pass no data ( #112590 )
...
Fixes an error in some text editors.
2022-10-19 10:30:23 -07:00
J-P Nurmi
2fdfa29e08
[text_input] introduce TextInputControl ( #76072 )
...
Allows the creation of virtual in-app keyboards written in Flutter. Especially useful for embedded environments.
2022-10-04 15:23:12 -07:00
LongCatIsLooong
8caa14e629
Fix a type casting error in text_input.dart ( #109635 )
2022-08-17 01:26:21 +00:00
Matej Knopp
7e8f0e57bf
[macOS] Use editing intents from engine ( #105407 )
2022-08-03 21:51:28 +02:00
Alexandre Ardhuin
bbdf617034
Export public API types from services/*.dart library ( #106316 )
2022-06-28 20:26:06 +00:00
Justin McCandless
1fd3d6c3c9
Make TextInputClient a mixin ( #104291 )
...
TextInputClient and DeltaTextInputClient are now mixins, which helps with breaking changes and future deltas work
2022-06-28 10:14:50 -07:00
Tong Mu
576e85ca5e
TextInput: Verify TextRange and make method call fail loudly ( #104711 )
...
* Fix
* Tests
* Format
* Empty line
* Fix range test
* Fix
* Comments
* trailing spaces
* Fix tests
* Comments
2022-06-14 20:31:09 -07:00
Ian Hickson
ab89ce285f
Clean up the bindings APIs. ( #89451 )
2022-02-03 14:55:15 -08:00
Jami Couch
af89a25e5b
Re-land "Support Scribble Handwriting" ( #96615 ) ( #97437 )
2022-02-01 09:50:07 -08:00
Justin McCandless
40c4da5cb8
Revert "Re-land "Support Scribble Handwriting" ( #96615 ) ( #96881 )" ( #97405 )
...
This reverts commit c54ce01575bf5002529e733143c948ba6ae301b7.
2022-01-27 16:11:02 -08:00
Jami Couch
c54ce01575
Re-land "Support Scribble Handwriting" ( #96615 ) ( #96881 )
2022-01-27 15:10:21 -08:00
LongCatIsLooong
9c23106711
Revert "Support Scribble Handwriting" ( #96615 )
2022-01-13 12:00:19 -08:00
Jami Couch
9490917408
Support Scribble Handwriting ( #75472 )
2022-01-11 11:00:12 -08:00
LongCatIsLooong
ffcd32ebb6
Move text editing Actions to EditableTextState ( #90684 )
2021-11-03 11:11:32 -07:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint ( #91409 ) ( #91462 )
2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint ( #91409 )" ( #91461 )
...
This reverts commit 5fd259be244244e14ff87fee9b6a721625f952cd.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint ( #91409 )
2021-10-07 20:13:02 -07:00
Renzo Olivares
4b330ddbed
Create DeltaTextInputClient ( #90205 )
...
* Create DeltaTextInputClient
* Remove old tests as updateEditingValueWithDeltas is no longer implemented
* fix analyzer
* Update docs
* Make example more general
* Update docs
* Add assert to check that TextInputClient is a DeltaTextInputClient
* Update assert
* More docs
* update
* Clean up docs
* updates
* Update docs
* updates
* Fix test
* add test
* updates
* remove logs
* fix tests
* Address reviewer comments
* Add text_input_utils.dart
* Address reviewer comments
2021-09-16 17:29:58 -07:00
Renzo Olivares
bf66cc2e08
Framework can receive TextEditingDeltas from engine ( #88477 )
2021-09-15 18:27:04 -07:00
LongCatIsLooong
c49eba6c3f
[TextInput] minor fixes ( #87973 )
2021-08-16 12:12:04 -07:00
Ren You
3dea9f0251
Revert "Clean up the bindings APIs ( #86438 )" ( #86484 )
...
This reverts commit d056500bfe6a712cdace450d06c4a8fb2290e63a.
2021-07-15 09:29:16 -07:00
Ian Hickson
d056500bfe
Clean up the bindings APIs ( #86438 )
2021-07-14 14:41:24 -07:00
Zachary Anderson
7f741e9181
Revert "Clean up the bindings APIs ( #86388 )" ( #86404 )
...
This reverts commit 31de052e3fddb4909ff88172a6937db7f3dc49db.
2021-07-13 21:32:29 -07:00
Ian Hickson
31de052e3f
Clean up the bindings APIs ( #86388 )
2021-07-13 18:31:11 -07:00
Ian Hickson
c800b9c3e4
Revert "Clean up the bindings APIs ( #83843 )" ( #86386 )
...
This reverts commit e2490f2906060d0aaecbbe34a9240ca3d54ef998.
2021-07-13 15:47:40 -07:00
Ian Hickson
e2490f2906
Clean up the bindings APIs ( #83843 )
2021-07-13 12:41:03 -07:00
J-P Nurmi
0967a40fca
Add TextInputType.none ( #83974 )
2021-06-29 15:41:03 -07:00
Ian Hickson
5e0cc4cba4
Migrate to ChannelBuffers.push ( #82564 )
2021-05-21 15:09:03 -07:00
Ian Hickson
2ae1e39810
Revert "Migrate to ChannelBuffers.push ( #82057 )" ( #82525 )
2021-05-14 12:09:03 -07:00
Ian Hickson
b86d5c0094
Migrate to ChannelBuffers.push ( #82057 )
2021-05-13 14:34:04 -07:00
Abhishek Ghaskata
254c9f1755
Enable use_named_constants_lint ( #82426 )
2021-05-13 13:29:06 -07:00
Viren Khatri
9ca32820ea
📝 Added toString tests for flutter/services/text_input.dart ( #82223 )
2021-05-10 23:49:04 -07:00
Ren You
7f1d1414cc
Revert "Migrate to ChannelBuffers.push ( #81235 )" ( #81829 )
...
This reverts commit 35ad43f20caa71ec051a97bc8bc8fec552fb4452.
2021-05-04 06:17:19 -07:00