Skip to content

Commit

Permalink
Merge pull request #29 from solid-software/feat/mistake-popup
Browse files Browse the repository at this point in the history
Mistake Popup
  • Loading branch information
drooxie committed May 24, 2023
2 parents 0ab61ac + 87809b1 commit d922d5a
Show file tree
Hide file tree
Showing 13 changed files with 356 additions and 436 deletions.
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
}
37 changes: 30 additions & 7 deletions example/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,39 @@ 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(
body: Column(
mainAxisAlignment: alignments[currentAlignmentIndex],
children: [
LanguageToolTextField(
style: const TextStyle(),
decoration: const InputDecoration(),
coloredController: _controller,
mistakePopup: MistakePopup(popupRenderer: PopupOverlayRenderer()),
),
DropdownMenu(
hintText: "Select alignment...",
onSelected: (value) => setState(() {
currentAlignmentIndex = value ?? 0;
}),
dropdownMenuEntries: const [
DropdownMenuEntry(value: 0, label: "Center alignment"),
DropdownMenuEntry(value: 1, label: "Top alignment"),
DropdownMenuEntry(value: 2, label: "Bottom alignment"),
],
)
],
),
),
);
}
Expand Down
Loading

0 comments on commit d922d5a

Please sign in to comment.