0

Error: The non-abstract class 'S' is missing implementations for these members: i18n.dart:11

  • WidgetsLocalizations.reorderItemDown
  • WidgetsLocalizations.reorderItemLeft
  • WidgetsLocalizations.reorderItemRight
  • WidgetsLocalizations.reorderItemToEnd
  • WidgetsLocalizations.reorderItemToStart
  • WidgetsLocalizations.reorderItemUp Try to either
  • provide an implementation,
  • inherit an implementation from a superclass or mixin,
  • mark the class as abstract, or
  • provide a 'noSuchMethod' implementation.

class S implements WidgetsLocalizations { ^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:173:14: Context: 'WidgetsLocalizations.reorderItemDown' is defined here. String get reorderItemDown; ^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:177:14: Context: 'WidgetsLocalizations.reorderItemLeft' is defined here. String get reorderItemLeft; ^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:181:14: Context: 'WidgetsLocalizations.reorderItemRight' is defined here. String get reorderItemRight; ^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:165:14: Context: 'WidgetsLocalizations.reorderItemToEnd' is defined here. String get reorderItemToEnd; ^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:161:14: Context: 'WidgetsLocalizations.reorderItemToStart' is defined here. String get reorderItemToStart; ^^^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:169:14: Context: 'WidgetsLocalizations.reorderItemUp' is defined here. String get reorderItemUp; ^^^^^^^^^^^^^ : Error: The non-abstract class '$en' is missing implementations for these members: i18n.dart:26

  • WidgetsLocalizations.reorderItemDown
  • WidgetsLocalizations.reorderItemLeft
  • WidgetsLocalizations.reorderItemRight
  • WidgetsLocalizations.reorderItemToEnd
  • WidgetsLocalizations.reorderItemToStart
  • WidgetsLocalizations.reorderItemUp Try to either
  • provide an implementation,
  • inherit an implementation from a superclass or mixin,
  • mark the class as abstract, or
  • provide a 'noSuchMethod' implementation.

class $en extends S { ^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:173:14: Context: 'WidgetsLocalizations.reorderItemDown' is defined here. String get reorderItemDown; ^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:177:14: Context: 'WidgetsLocalizations.reorderItemLeft' is defined here.

String get reorderItemLeft; ^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:181:14: Context: 'WidgetsLocalizations.reorderItemRight' is defined here. String get reorderItemRight; ^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:165:14: Context: 'WidgetsLocalizations.reorderItemToEnd' is defined here. String get reorderItemToEnd; ^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:161:14: Context: 'WidgetsLocalizations.reorderItemToStart' is defined here.

String get reorderItemToStart; ^^^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter/lib/src/widgets/localizations.dart:169:14: Context: 'WidgetsLocalizations.reorderItemUp' is defined here.

String get reorderItemUp; ^^^^^^^^^^^^^ : Error: Field 'wLanguage' cannot be nullable or have type 'Null', it must be int, double, Pointer, or a subtype of Struct or Union. file_version_info.dart:13 external int? wLanguage; ^ : Error: Field 'wCodePage' cannot be nullable or have type 'Null', it must be int, double, Pointer, or a subtype of Struct or Union. file_version_info.dart:16 external int? wCodePage; ^

Target kernel_snapshot failed: Exception 2

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

2: Task failed with an exception.

  • What went wrong: java.lang.StackOverflowError (no error message)

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

BUILD FAILED in 1m 5s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

Can someone expert to help me to solve these issues, I has been working for these whole day but can't find any solution. Thank you.

I can't find any solution

qwertt
  • 1
  • 1
  • 1
    Don't ask [the same question](https://stackoverflow.com/q/76238315/) multiple times. The best way to get help is to provide enough information to allow other people to reproduce your problem. What is `i18n.dart`? Is it from a package? If so, which package and which version? Which version of Flutter are you using? – jamesdlin May 13 '23 at 15:54

1 Answers1

1

simply adding overrides to i18n.dart solved my problem.

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: camel_case_types
// ignore_for_file: prefer_single_quotes

//This file is automatically generated. DO NOT EDIT, all your changes would be lost.

class S implements WidgetsLocalizations {
  const S();

  static const GeneratedLocalizationsDelegate delegate =
      GeneratedLocalizationsDelegate();

  static S? of(BuildContext context) =>
      Localizations.of<S>(context, WidgetsLocalizations);

  @override
  TextDirection get textDirection => TextDirection.ltr;
  
  @override
  String get reorderItemDown => "To Down";
  
  @override
  String get reorderItemLeft => "To Left";
  
  @override
  String get reorderItemRight => "To Right";
  
  @override
  String get reorderItemToEnd => "To End";
  
  @override
  String get reorderItemToStart => "To Start";
  
  @override
  String get reorderItemUp => "To Up";

}

class en extends S {
  const en();
}


class GeneratedLocalizationsDelegate extends LocalizationsDelegate<WidgetsLocalizations> {
  const GeneratedLocalizationsDelegate();

  List<Locale> get supportedLocales {
    return const <Locale>[

      Locale("en", ""),

    ];
  }

  LocaleResolutionCallback? resolution({Locale? fallback}) {
    return (Locale? locale, Iterable<Locale> supported) {
      final Locale languageLocale =  Locale(locale!.languageCode, "");
      if (supported.contains(locale)) {
        return locale;
      } else if (supported.contains(languageLocale)) {
        return languageLocale;
      } else {
        final Locale fallbackLocale = fallback ?? supported.first;
        return fallbackLocale;
      }
    };
  }

  @override
  Future<WidgetsLocalizations> load(Locale locale) {
    final String lang = getLang(locale);
    switch (lang) {

      case "en":
        return SynchronousFuture<WidgetsLocalizations>(const en());

      default:
        return SynchronousFuture<WidgetsLocalizations>(const S());
    }
  }

  @override
  bool isSupported(Locale locale) => supportedLocales.contains(locale);

  @override
  bool shouldReload(GeneratedLocalizationsDelegate old) => false;
}

String getLang(Locale l) => l.countryCode != null && l.countryCode!.isEmpty
    ? l.languageCode
    : l.toString();
Bilal Şimşek
  • 5,453
  • 2
  • 19
  • 33