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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/Add Icon Logo to the Mistake Popup #53

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Binary file added images/symbol_boxed_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions lib/core/langtool_images.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Class [LangToolImages] for managing the images used in LanguageTool.
class LangToolImages {
/// LanguageTool logo
static const logo = 'images/symbol_boxed_white.png';

LangToolImages._();
}
19 changes: 18 additions & 1 deletion lib/utils/mistake_popup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:math';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:languagetool_textfield/core/langtool_images.dart';
import 'package:languagetool_textfield/domain/typedefs.dart';
import 'package:languagetool_textfield/languagetool_textfield.dart';
import 'package:languagetool_textfield/utils/extensions/string_extension.dart';
Expand Down Expand Up @@ -48,6 +49,7 @@ class LanguageToolMistakePopup extends StatelessWidget {
static const double _defaultVerticalMargin = 25.0;
static const double _defaultHorizontalMargin = 10.0;
static const double _defaultMaxWidth = 250.0;
static const _iconSize = 25.0;

/// Renderer used to display this window.
final PopupOverlayRenderer popupRenderer;
Expand Down Expand Up @@ -138,7 +140,22 @@ class LanguageToolMistakePopup extends StatelessWidget {
padding: const EdgeInsets.only(left: 4),
child: Row(
children: [
const Expanded(child: Text('Correct')),
Expanded(
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 5.0),
child: Image.asset(
LangToolImages.logo,
width: _iconSize,
height: _iconSize,
package: 'languagetool_textfield',
),
),
const Text('Correct'),
],
),
),
IconButton(
icon: const Icon(
Icons.close,
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ dev_dependencies:

flutter:
uses-material-design: true
assets:
- images/symbol_boxed_white.png