deniscolak / colorize-text-avatar

Flutter plugin that allows users to create TextAvatar easily!
MIT License
21 stars 15 forks source link

Throws a 'Null check operator used on a null value' exception when the text is an Arabic letters or numbers #6

Open devmuaz opened 2 years ago

devmuaz commented 2 years ago

Hi @deniscolak how are you, I recently had this exception when I attempted to use it with Arabic letters or even numbers, I couldn't figure it out until I removed the Arabic letters and worked just fine.

Here's a sample:

Code:

class TestApp extends StatelessWidget {
  const TestApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('اهلا'),
      ),
      body: Center(
        child: TextAvatar(
          text: 'مرحبا',
          shape: Shape.Circular,
          upperCase: true,
        ),
      ),
    );
  }
}

Exception:

════════ Exception caught by widgets library ═══════════════════════════════════

The following _CastError was thrown building TextAvatar(dirty):

Null check operator used on a null value
SahSantoshh commented 1 year ago

@devmuaz https://github.com/deniscolak/colorize-text-avatar/pull/13 will fix number issue. Thanks