Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/view/image_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import 'package:magicepaperapp/l10n/app_localizations.dart';
import '../util/app_logger.dart';
import 'package:magicepaperapp/provider/getitlocator.dart';
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

getitlocator.dart is now unused in this file after removing getIt.get<AppLocalizations>(). Please remove the unused import to keep flutter analyze clean.

Suggested change
import 'package:magicepaperapp/provider/getitlocator.dart';

Copilot uses AI. Check for mistakes.

AppLocalizations appLocalizations = getIt.get<AppLocalizations>();

class ImageEditor extends StatefulWidget {
final DisplayDevice device;
Expand Down Expand Up @@ -311,7 +310,7 @@ class _ImageEditorState extends State<ImageEditor> {
style: TextButton.styleFrom(
foregroundColor: colorAccent,
),
child: const Text('OK'),
child: Text(appLocalizations.ok),
),
],
);
Expand All @@ -321,6 +320,7 @@ class _ImageEditorState extends State<ImageEditor> {

@override
Widget build(BuildContext context) {
final appLocalizations = AppLocalizations.of(context)!;
var imgLoader = context.watch<ImageLoader>();
Comment on lines 321 to 324
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

After removing the file-level appLocalizations variable, several methods in this file still reference appLocalizations (e.g., _exportXbmFiles, _showRefreshModeInfoDialog). The new final appLocalizations = AppLocalizations.of(context)!; inside build() is not in scope for those methods, which will cause a compile error. Consider adding a State getter (e.g., AppLocalizations get appLocalizations => AppLocalizations.of(context)!;) or retrieving AppLocalizations.of(context)! locally inside each method that needs it.

Copilot uses AI. Check for mistakes.
if (!_isInitializing && imgLoader.image != null && !_isProcessingImages) {
WidgetsBinding.instance.addPostFrameCallback((_) {
Expand Down Expand Up @@ -578,6 +578,7 @@ class BottomActionMenu extends StatelessWidget {

@override
Widget build(BuildContext context) {
final appLocalizations = AppLocalizations.of(context)!;
return SafeArea(
Comment on lines +581 to 582
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Minor formatting: this line has an extra leading space compared to surrounding indentation; run dart format (or fix indentation) to match the file’s formatting.

Copilot uses AI. Check for mistakes.
top: false,
bottom: true,
Expand All @@ -602,7 +603,7 @@ class BottomActionMenu extends StatelessWidget {
_buildActionButton(
context: context,
icon: Icons.add_photo_alternate_outlined,
label: "Import",
label: appLocalizations.import,
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

appLocalizations.import does not appear to exist in the generated AppLocalizations API (and import is also a Dart keyword). This will not compile; use an existing key such as importImageButtonLabel (or add a new ARB key and regenerate localizations).

Suggested change
label: appLocalizations.import,
label: appLocalizations.importImageButtonLabel,

Copilot uses AI. Check for mistakes.
onTap: () async {
final success = await imgLoader.pickImage(
width: epd.width,
Expand Down Expand Up @@ -646,7 +647,7 @@ class BottomActionMenu extends StatelessWidget {
_buildActionButton(
context: context,
icon: Icons.text_fields,
label: "Text",
label: appLocalizations.text,
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

appLocalizations.text does not exist in the generated AppLocalizations API, so this will not compile. Please switch to the correct existing localization key for this action label (or add it to the ARB files and regenerate).

Suggested change
label: appLocalizations.text,
label: 'Text',

Copilot uses AI. Check for mistakes.
onTap: () async {
final bytes = await Navigator.of(context).push<Uint8List>(
MaterialPageRoute(
Expand Down