flutter_sheet_localization icon indicating copy to clipboard operation
flutter_sheet_localization copied to clipboard

build_runner does not generate anything

Open illuminated opened this issue 1 year ago • 4 comments

Coming back to sheet_localization after several years and I'm struggling with the initial setup.

Running the build_runner reports a "severe" issue and nothing is generated:

→ flutter packages pub run build_runner build          
[INFO] Generating build script...
[INFO] Generating build script completed, took 375ms

[SEVERE] Nothing can be built, yet a build was requested.
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 58ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 471ms

[INFO] Running build...
[INFO] Running build completed, took 2ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 35ms

[INFO] Succeeded after 51ms with 0 outputs (0 actions)

The localization.dart is as in the ReadMe, placed in /lib folder:

import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_sheet_localization/flutter_sheet_localization.dart';

part 'localization.g.dart';

@SheetLocalization("redacted", "0", 2) // <- See 1. to get DOCID and SHEETID
// the `1` is the generated version. You must increment it each time you want to regenerate
// a new version of the labels.
class AppLocalizationsDelegate
    extends LocalizationsDelegate<AppLocalizationsData> {
  const AppLocalizationsDelegate();

  @override
  bool isSupported(Locale locale) => localizedLabels.containsKey(locale);

  @override
  Future<AppLocalizationsData> load(Locale locale) =>
      SynchronousFuture<AppLocalizationsData>(localizedLabels[locale]!);
  @override
  bool shouldReload(AppLocalizationsDelegate old) => false;
}

This happens on a MacOS.

Any help appreciated.

illuminated avatar Feb 11 '23 23:02 illuminated