Skip to content

Commit 04495da

Browse files
Shahroz16claude
andcommitted
Fix remaining lint issues
- Use Color.toARGB32() instead of deprecated .value - Fix SizedBox usage in integration tests - Add const constructors where possible 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 952cddb commit 04495da

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

lib/messaging_in_app/inline_in_app_message_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class _InlineInAppMessageViewState extends State<InlineInAppMessageView> {
6060
if (defaultTargetPlatform == TargetPlatform.android) {
6161
final creationParams = <String, dynamic>{
6262
'elementId': widget.elementId,
63-
if (widget.progressTint != null) 'progressTint': widget.progressTint!.value,
63+
if (widget.progressTint != null) 'progressTint': widget.progressTint!.toARGB32(),
6464
};
6565

6666
return AndroidView(
@@ -130,7 +130,7 @@ class _InlineInAppMessageViewState extends State<InlineInAppMessageView> {
130130
Future<void> _setProgressTint(Color color) async {
131131
if (_methodChannel != null) {
132132
try {
133-
await _methodChannel!.invokeMethod('setProgressTint', color.value);
133+
await _methodChannel!.invokeMethod('setProgressTint', color.toARGB32());
134134
} on PlatformException catch (e) {
135135
debugPrint('Failed to set progress tint: ${e.message}');
136136
}

test/messaging_in_app/inline_in_app_message_view_test.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void main() {
1010
group('Widget Creation', () {
1111
testWidgets('creates widget with required elementId', (WidgetTester tester) async {
1212
await tester.pumpWidget(
13-
MaterialApp(
13+
const MaterialApp(
1414
home: Scaffold(
1515
body: InlineInAppMessageView(
1616
elementId: 'test-banner',
@@ -47,7 +47,7 @@ void main() {
4747
debugDefaultTargetPlatformOverride = TargetPlatform.android;
4848

4949
await tester.pumpWidget(
50-
MaterialApp(
50+
const MaterialApp(
5151
home: Scaffold(
5252
body: InlineInAppMessageView(
5353
elementId: 'test-banner',
@@ -67,7 +67,7 @@ void main() {
6767
debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
6868

6969
await tester.pumpWidget(
70-
MaterialApp(
70+
const MaterialApp(
7171
home: Scaffold(
7272
body: InlineInAppMessageView(
7373
elementId: 'test-banner',
@@ -89,11 +89,11 @@ void main() {
8989
debugDefaultTargetPlatformOverride = TargetPlatform.android;
9090

9191
await tester.pumpWidget(
92-
MaterialApp(
92+
const MaterialApp(
9393
home: Scaffold(
9494
body: InlineInAppMessageView(
9595
elementId: 'test-element-id',
96-
progressTint: const Color(0xFF123456),
96+
progressTint: Color(0xFF123456),
9797
),
9898
),
9999
),
@@ -115,7 +115,7 @@ void main() {
115115
debugDefaultTargetPlatformOverride = TargetPlatform.android;
116116

117117
await tester.pumpWidget(
118-
MaterialApp(
118+
const MaterialApp(
119119
home: Scaffold(
120120
body: InlineInAppMessageView(
121121
elementId: 'test-element-id',
@@ -162,7 +162,7 @@ void main() {
162162
debugDefaultTargetPlatformOverride = TargetPlatform.android;
163163

164164
await tester.pumpWidget(
165-
MaterialApp(
165+
const MaterialApp(
166166
home: Scaffold(
167167
body: InlineInAppMessageView(
168168
elementId: 'test-banner',
@@ -185,7 +185,7 @@ void main() {
185185
debugDefaultTargetPlatformOverride = TargetPlatform.android;
186186

187187
await tester.pumpWidget(
188-
MaterialApp(
188+
const MaterialApp(
189189
home: Scaffold(
190190
body: InlineInAppMessageView(
191191
elementId: 'initial-element',
@@ -200,7 +200,7 @@ void main() {
200200

201201
// Update the widget with a new elementId
202202
await tester.pumpWidget(
203-
MaterialApp(
203+
const MaterialApp(
204204
home: Scaffold(
205205
body: InlineInAppMessageView(
206206
elementId: 'updated-element',
@@ -222,7 +222,7 @@ void main() {
222222
debugDefaultTargetPlatformOverride = TargetPlatform.android;
223223

224224
await tester.pumpWidget(
225-
MaterialApp(
225+
const MaterialApp(
226226
home: Scaffold(
227227
body: InlineInAppMessageView(
228228
elementId: 'test-element',
@@ -237,7 +237,7 @@ void main() {
237237

238238
// Update the widget with a new progressTint
239239
await tester.pumpWidget(
240-
MaterialApp(
240+
const MaterialApp(
241241
home: Scaffold(
242242
body: InlineInAppMessageView(
243243
elementId: 'test-element',
@@ -261,7 +261,7 @@ void main() {
261261
debugDefaultTargetPlatformOverride = TargetPlatform.android;
262262

263263
await tester.pumpWidget(
264-
MaterialApp(
264+
const MaterialApp(
265265
home: Scaffold(
266266
body: InlineInAppMessageView(
267267
elementId: 'test-element',

test/messaging_in_app/platform_view_integration_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void main() {
1919
body: Column(
2020
children: [
2121
const Text('Test App'),
22-
Container(
22+
SizedBox(
2323
height: 200,
2424
child: InlineInAppMessageView(
2525
elementId: 'integration-test-banner',
@@ -49,7 +49,7 @@ void main() {
4949

5050
final params = androidView.creationParams as Map<String, dynamic>;
5151
expect(params['elementId'], equals('integration-test-banner'));
52-
expect(params['progressTint'], equals(Colors.purple.value));
52+
expect(params['progressTint'], equals(Colors.purple.toARGB32()));
5353

5454
debugDefaultTargetPlatformOverride = null;
5555
});

0 commit comments

Comments
 (0)