Skip to content

[in_app_purchase] Remove unnecessary Material imports - #12804

Open
ricardodalarme wants to merge 1 commit into
flutter:mainfrom
ricardodalarme:refactor/in_app_purchase/remove-unnecessary-material-cupertino-imports
Open

ricardodalarme wants to merge 1 commit into
flutter:mainfrom
ricardodalarme:refactor/in_app_purchase/remove-unnecessary-material-cupertino-imports

Conversation

@ricardodalarme

Copy link
Copy Markdown
Contributor

Removes unnecessary material imports from in_app_purchase.

Part of: flutter/flutter#191322

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@ricardodalarme
ricardodalarme force-pushed the refactor/in_app_purchase/remove-unnecessary-material-cupertino-imports branch from dbf4958 to 1157a75 Compare October 21, 2026 23:32
@ricardodalarme
ricardodalarme marked this pull request as ready for review October 21, 2026 23:33
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the test-exempt label. All reviewers should feel empowered to ask for tests before escalating.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces unnecessary material.dart imports with widgets.dart across several files in the in_app_purchase_android and in_app_purchase_storekit packages, updating the respective changelogs. The feedback suggests further optimizing these imports by using foundation.dart instead of widgets.dart, as the affected files only require lightweight utilities like @visibleForTesting, @immutable, and Object.hash.

// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this file only uses @visibleForTesting, @immutable, and Object.hash, it does not require any widgets or UI-related classes. Importing package:flutter/foundation.dart is more appropriate and lightweight than package:flutter/widgets.dart.

Suggested change
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';

// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this file only uses @visibleForTesting, @immutable, and Object.hash, it does not require any widgets or UI-related classes. Importing package:flutter/foundation.dart is more appropriate and lightweight than package:flutter/widgets.dart.

Suggested change
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';

// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this file only uses @visibleForTesting, @immutable, and Object.hash, it does not require any widgets or UI-related classes. Importing package:flutter/foundation.dart is more appropriate and lightweight than package:flutter/widgets.dart.

Suggested change
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';

Comment on lines 8 to +9
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this file only uses @visibleForTesting, @immutable, and Object.hash from Flutter, it does not require any widgets or UI-related classes. Importing package:flutter/foundation.dart is more appropriate and lightweight than package:flutter/widgets.dart.

Suggested change
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

@loic-sharma
loic-sharma requested a review from pjkammer October 27, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant