Skip to content

Commit 45ae62d

Browse files
committed
feat: update large layout ui for erase input
1 parent f7436d9 commit 45ae62d

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

lib/l10n/arb/app_en.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"@puzzleAppBarSudoku": {
111111
"description": "Text shown in app bar of the Puzzle Page"
112112
},
113-
"eraseInputButtonText": "Erase number",
113+
"eraseInputButtonText": "X",
114114
"@eraseInputButtonText": {
115115
"description": "Text shown in the input erase button in Puzzle Page"
116116
},

lib/puzzle/view/puzzle_page.dart

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class PuzzleViewLayout extends StatelessWidget {
155155
),
156156
ResponsiveGap(large: 32),
157157
SudokuInputView(),
158-
SizedBox(height: 32),
158+
SizedBox(height: 8),
159159
InputEraseViewForLargeLayout(),
160160
],
161161
),
@@ -227,30 +227,44 @@ class InputEraseViewForLargeLayout extends StatelessWidget {
227227
@override
228228
Widget build(BuildContext context) {
229229
final l10n = context.l10n;
230+
final theme = Theme.of(context);
231+
232+
const gradient = LinearGradient(
233+
colors: [
234+
SudokuColors.darkPurple,
235+
SudokuColors.darkPink,
236+
],
237+
begin: Alignment.bottomLeft,
238+
end: Alignment.topRight,
239+
);
230240

231241
return GestureDetector(
232242
onTap: () => context.read<PuzzleBloc>().add(const SudokuInputErased()),
233243
child: SizedBox(
234-
width: SudokuInputSize.large * 3,
235-
height: 56,
244+
width: SudokuInputSize.large - 16,
245+
height: SudokuInputSize.large - 16,
246+
// height: 56,
236247
child: DecoratedBox(
237248
decoration: BoxDecoration(
238-
borderRadius: BorderRadius.circular(14),
239-
gradient: const LinearGradient(
240-
colors: [
241-
SudokuColors.darkPurple,
242-
SudokuColors.darkPink,
243-
],
244-
begin: Alignment.bottomLeft,
245-
end: Alignment.topRight,
249+
borderRadius: BorderRadius.circular(12),
250+
border: Border.all(
251+
color: theme.dividerColor,
252+
width: 1.4,
246253
),
247254
),
248255
child: Center(
249-
child: Text(
250-
l10n.eraseInputButtonText,
251-
textAlign: TextAlign.center,
252-
style: SudokuTextStyle.button.copyWith(
253-
color: Colors.white,
256+
child: ShaderMask(
257+
blendMode: BlendMode.srcIn,
258+
shaderCallback: (bounds) => gradient.createShader(
259+
Rect.fromLTWH(0, 0, bounds.width, bounds.height),
260+
),
261+
child: Text(
262+
l10n.eraseInputButtonText,
263+
textAlign: TextAlign.center,
264+
style: SudokuTextStyle.button.copyWith(
265+
fontWeight: SudokuFontWeight.semiBold,
266+
fontSize: 26,
267+
),
254268
),
255269
),
256270
),

0 commit comments

Comments
 (0)