---
title: "How to reference string keys in Flutter without context?"
description: "In general, there is no clean solution here. In most cases, you'll end up with tightly coupled app layers. Passing the context to the non-widget piece of the code (e.g. model class) that needs to be localized is perhaps the simplest approach."
category: flutter
date: 2023-02-01
updated: 2026-10-09
canonical: https://localizely.com/i18n-questions/flutter/how-to-reference-string-keys-in-flutter-without-context/
---

# How to reference string keys in Flutter without context?

In general, there is no clean solution here. 😔  
In most cases, you'll end up with tightly coupled app layers.  
Passing the context to the non-widget piece of the code (e.g. model class) that needs to be localized is perhaps the simplest approach.

```dart
class MyWidget extends StatelessWidget {
  const MyWidget({Key? key}): super(key: key);

  @override
  Widget build(BuildContext context) {

    var myList = MyList(context);

    /* ... */
  }
}

class MyList {
  final BuildContext context;

  MyList(this.context);

  /* ... */
}
```

Source: https://localizely.com/i18n-questions/flutter/how-to-reference-string-keys-in-flutter-without-context/
