Skip to content

type 'Null' is not a subtype of type 'WidgetsLocalizations' in type cast for Arabic, Najdi #358

@Kal-Elx

Description

@Kal-Elx

Version

3.1.0

Library

feedback

Flutter channel

stable

Flutter version

3.29.3

Platform

iOS

Details

We noticed the following issue surfacing in Crashlytics where some users were unable to open the app.

_LocalizationsState._textDirection
FlutterError - type 'Null' is not a subtype of type 'WidgetsLocalizations' in type cast. Error thrown .

Thanks to this comment we narrowed down the issue to this package and specifically to devices with the language Arabic, Najdi. Other Right-to-left languages I've tested works as expected.

Steps to reproduce

  • Change your device language to Arabic, Najdi
  • Run the example project
import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(BetterFeedback(child: const MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(body: Center(child: Text('Hello, World!'))),
    );
  }
}

  • You will see the following error
    Image

Output of flutter doctor -v

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.4.1 24E263 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.99.3)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions