Skip to content

Commit

Permalink
Merge pull request #53 from solid-software/task/add-icon
Browse files Browse the repository at this point in the history
Task/Add Icon Logo to the Mistake Popup
  • Loading branch information
solid-danylokhvan authored Jul 6, 2023
2 parents 274082f + bbbf62b commit 8e1ddc6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
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

0 comments on commit 8e1ddc6

Please sign in to comment.