{"id":17018439,"url":"https://github.com/liquidatorcoder/better_textfield","last_synced_at":"2026-04-20T10:02:40.612Z","repository":{"id":124470908,"uuid":"441129749","full_name":"LiquidatorCoder/better_textfield","owner":"LiquidatorCoder","description":"A native textfield that can be used in place of Flutter's TextField widget.","archived":false,"fork":false,"pushed_at":"2021-12-25T11:38:31.000Z","size":17172,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T16:12:02.177Z","etag":null,"topics":["android","flutter","plugin","textfield"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiquidatorCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-23T09:32:21.000Z","updated_at":"2022-09-13T00:06:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"301f339f-b5e9-4e02-9a34-859594a43ccd","html_url":"https://github.com/LiquidatorCoder/better_textfield","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/LiquidatorCoder/better_textfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidatorCoder%2Fbetter_textfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidatorCoder%2Fbetter_textfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidatorCoder%2Fbetter_textfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidatorCoder%2Fbetter_textfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiquidatorCoder","download_url":"https://codeload.github.com/LiquidatorCoder/better_textfield/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiquidatorCoder%2Fbetter_textfield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32042293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flutter","plugin","textfield"],"created_at":"2024-10-14T06:45:52.780Z","updated_at":"2026-04-20T10:02:40.519Z","avatar_url":"https://github.com/LiquidatorCoder.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\nBetter Textfield\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://flutter.dev/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Flutter-v2.8.0-blue?logo=flutter\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/LiquidatorCoder/better_textfield\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/LiquidatorCoder/better_textfield.svg?style=flat\u0026logo=github\u0026colorB=green\u0026label=release\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/LiquidatorCoder/better_textfield\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/LiquidatorCoder/better_textfield.svg?style=flat\u0026logo=github\u0026colorB=deeppink\u0026label=stars\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eA native textfield that can be used in place of Flutter's TextField widget.\u003c/p\u003e\n\n![Better Textfield -A native textfield that can be used in place of Flutter's TextField widget.](doc/header.png)\n\n## Demo\n\nhttps://user-images.githubusercontent.com/42910433/147383853-7d2c0e40-8d5d-40ef-b7f7-4349ae15b796.mp4\n\nHere are some screenshots of the demo app:\n\n| Native Text Field \t| Magnifier (loupe) effect\t| Native Text Toolbar \t|\n|--------------\t|--------------\t|--------------\t|\n|  ![NativeTextField](doc/1.jpg) | ![Magnifier (loupe) effect](doc/2.jpg) \t| ![Native Text Toolbar](doc/3.jpg)  \t|\n\nYou can also access the demo app via this [link](https://github.com/LiquidatorCoder/better_textfield/releases) or by visiting `release` directory in the repository.\n\n## Install\nThe plugin package is under development.\nIf you still want to use it in your app you can use the code from this repository.\n\n## Features\n\n- Better dragging of the cursor\n- Magnifier (loupe) effect\n- Fixes all issues described here: [link](https://pastebin.com/iqnjMa1m)\n- Supports setting values for text\n- Also supports retrieving input text via the text controller\n- Decent performance\n- Supports text selection and clipboard\n- Supports autocorrect\n- Supports direct sharing of text\n- Supports only Android for now\n\n## Problem\nWe generally use TextField and TextFormFields widgets for input field. If you notice, there is a glitch in Flutter’s widget while dragging the cursor, where within a word if you drag the cursor it works fine, but if you try to drag the cursor from one word to another, hen draggable cursor disappears.\n\n(Screen recording attached for reference for Reflectly app developed in Flutter.)\n\nhttps://user-images.githubusercontent.com/42910433/147383865-c154c661-8e6e-4ebf-a5c5-c06e4c6dbf44.mp4\n\n\n## Solution/Approach\nSince this problem only occurs in the TextField widget available in Flutter, we can use the Hybrid composition of AndroidView in Flutter to display a native textfield instead of a regular textfield.\nNote, however, that rendering an AndroidView inside a Flutter widget is quite performance intensive and can slow down your app in some cases.\nAlso, we need to bump up the `minSdkVersion` to at least 19 to support hybrid composition.\n\nI have referred to the following [docs](https://docs.flutter.dev/development/platform-integration/platform-views) to understand how to host a native view in Flutter.\n\nNext, I created a MethodChannel to communicate with the native code.\n\nI also created a native text field controller class to help me retrieve and set text values in the native text field using the MethodChannel.\n\nAnd that's about it. If you do it right, this only takes 20-30 minutes and greatly improves the app experience if your app is primarily text input based (like a text editor app).\n\n\u003eNote: We can also extend this approach to support iOS UIViews.\n\n\n## Code Explaination\n\nThe structure of the `lib` directory of the app is as follows:\n\n```\n│   main.dart [Main app file (starting point of the app)]\n│   \n├───controllers\n│       native_text_field_controller.dart [NativeTextField controller, which handles the communication of data between the textfield and the flutter app] \n└───views\n        home_page.dart [Home page of the demo app]\n\n```\n\nThe structure of the `android\\app\\src\\main\\kotlin\\com\\abhay` directory of the app is as follows:\n\n```\n└───better_textfield\n        MainActivity.kt [Main activity of the android app]\n        NativeView.kt [Native text view class, which is the view that is displayed on the screen]\n        NativeViewFactory.kt [Native view factory class, which is the factory class that is used to create the native view]\n\n```\n## Built With\n\n* [Flutter](https://flutter.dev/)\n\n* [Kotlin](https://kotlinlang.org/)\n\n## Stay Up-to-Date\n\n\u003cimg src=\"https://github.com/AppFlowy-IO/appflowy/blob/main/doc/imgs/howtostar.gif\" alt=\"Star project\" width=\"700px\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliquidatorcoder%2Fbetter_textfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliquidatorcoder%2Fbetter_textfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliquidatorcoder%2Fbetter_textfield/lists"}