Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistake Popup #29

Merged
merged 19 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ migrate_working_dir/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/pubspec.lock
**/doc/api/
.dart_tool/
.packages
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->

![languagetool popup presentation](readme/languagetool.gif)

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.

Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
32 changes: 25 additions & 7 deletions example/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,34 @@ class _AppState extends State<App> {
final ColoredTextEditingController _controller =
ColoredTextEditingController(languageCheckService: _debouncedLangService);

static const List<MainAxisAlignment> alignments = [
MainAxisAlignment.center,
MainAxisAlignment.start,
MainAxisAlignment.end,
];
int currentAlignmentIndex = 0;

@override
Widget build(BuildContext context) {
return Material(
child: LanguageToolTextField(
style: const TextStyle(),
decoration: const InputDecoration(),
mistakeBuilder: () {
return Container();
},
coloredController: _controller,
child: Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () => setState(() {
currentAlignmentIndex += 1;
currentAlignmentIndex %= alignments.length;
}),
),
drooxie marked this conversation as resolved.
Show resolved Hide resolved
body: Column(
mainAxisAlignment: alignments[currentAlignmentIndex],
children: [
LanguageToolTextField(
style: const TextStyle(),
decoration: const InputDecoration(),
coloredController: _controller,
mistakePopup: MistakePopup(popupRenderer: PopupOverlayRenderer()),
),
],
),
),
);
}
Expand Down
Loading