Skip to content

Commit 16e9371

Browse files
Merge pull request #88 from SamuelWakoli/popup-visibility
Fix Mistake Popup visibility on dark mode #82
2 parents db00748 + b71ddfe commit 16e9371

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ migrate_working_dir/
2828
.dart_tool/
2929
.packages
3030
build/
31+
/.flutter-plugins-dependencies
32+
/example/.flutter-plugins-dependencies

lib/src/utils/mistake_popup.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ class LanguageToolMistakePopup extends StatelessWidget {
113113

114114
final availableSpace = _calculateAvailableSpace(context);
115115

116+
final colorScheme = Theme.of(context).colorScheme;
117+
116118
return PointerInterceptor(
117119
child: ConstrainedBox(
118120
constraints: BoxConstraints(
@@ -125,9 +127,14 @@ class LanguageToolMistakePopup extends StatelessWidget {
125127
vertical: verticalMargin,
126128
),
127129
decoration: BoxDecoration(
128-
color: const Color.fromRGBO(241, 243, 248, 1.0),
130+
color: colorScheme.surface.withValues(alpha: 0.9),
129131
borderRadius: BorderRadius.circular(_borderRadius),
130-
boxShadow: const [BoxShadow(color: Colors.grey, blurRadius: 8)],
132+
boxShadow: [
133+
BoxShadow(
134+
color: colorScheme.onSurface.withValues(alpha: 0.5),
135+
blurRadius: 8,
136+
),
137+
],
131138
),
132139
padding: const EdgeInsets.only(
133140
top: 8,
@@ -180,7 +187,7 @@ class LanguageToolMistakePopup extends StatelessWidget {
180187
margin: const EdgeInsets.only(top: 8),
181188
padding: const EdgeInsets.all(padding),
182189
decoration: BoxDecoration(
183-
color: Colors.white,
190+
color: colorScheme.surface,
184191
borderRadius: BorderRadius.circular(_borderRadius),
185192
),
186193
child: SingleChildScrollView(
@@ -194,7 +201,8 @@ class LanguageToolMistakePopup extends StatelessWidget {
194201
child: Text(
195202
mistake.type.name.capitalize(),
196203
style: TextStyle(
197-
color: Colors.grey.shade700,
204+
color:
205+
colorScheme.onSurface.withValues(alpha: 0.7),
198206
fontSize: _mistakeNameFontSize,
199207
fontWeight: FontWeight.w600,
200208
letterSpacing: _titleLetterSpacing,

0 commit comments

Comments
 (0)