krokyze / flutter_seo

Flutter package for SEO support on Web.
MIT License
46 stars 5 forks source link

AppText not working #46

Closed LucyJeong closed 5 months ago

LucyJeong commented 7 months ago

I added AppText widget by link (it's exactly same code)

But, it's not working. look like this.

my version are Flutter 3.16.0 and Tools • Dart 3.2.0

my code is

        resizeToAvoidBottomInset: false,
        appBar: AppBar(
          elevation: 0,
          foregroundColor: Colors.white,
          backgroundColor: Colors.green,
          title: const Text(
            '오늘의 웹툰',
            style: TextStyle(
              fontWeight: FontWeight.w500,
              fontSize: 24,
            ),
          ),
        ),
        body: Row(
          children: [
            const AppText(
              text: "heel",
              style: TextStyle(),
            ),....

error code is this.

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following TypeErrorImpl was thrown building Seo(dirty): Unexpected null value.

The relevant error-causing widget was: Seo Seo:file:///....lib/widgets/app_text.dart:19:16

Screenshot 2023-12-09 at 3 39 48 PM

krokyze commented 5 months ago

Did you wrap your whole app within SeoController?

import 'package:seo/seo.dart';

void main() {
  runApp(const App());
}

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

  @override
  Widget build(BuildContext context) {
    return SeoController(
      enabled: true,
      tree: WidgetTree(context: context),
      child: MaterialApp(...),
    );
  }
}
LucyJeong commented 5 months ago

no. I did warp just the class. I will try it.