Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'package:flutter/src/widgets/overlay.dart': Failed assertion: line 552 pos 15: 'textDirection != null': is not true. #68

Closed
muhammednazil opened this issue Nov 19, 2020 · 3 comments

Comments

@muhammednazil
Copy link

The following assertion was thrown building Overlay(state: OverlayState#b90aa(entries[OverlayEntry#fa568(opaque: false; maintainState: false), OverlayEntry#83b08(opaque: false; maintainState: false)])):

'package:flutter/src/widgets/overlay.dart': Failed assertion: line 552 pos 15: 'textDirection != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.

In either case, please report this assertion by filing a bug on GitHub:

https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was:

Overlay file:///Users/qlinksoftware/Documents/FlutterSdk/flutter/.pubcache/hosted/pub.dartlang.org/flutter_easyloading-1.3.0/lib/src/widgets/loading.dart:38:14

When the exception was thrown, this was the stack:
#2 new _RenderTheatre (package:flutter/src/widgets/overlay.dart:552:15)
#3 _Theatre.createRenderObject (package:flutter/src/widgets/overlay.dart:509:12)
#4 RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5491:28)
#5 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6232:11)
.... Normal element mounting (67 frames)
═════════════════════════════════════════════════════════════════════════

@nslogx
Copy link
Owner

nslogx commented Nov 20, 2020

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter EasyLoading',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter EasyLoading'),
      builder: EasyLoading.init(),
    );
  }
}

@muhammednazil

@nslogx nslogx closed this as completed Nov 20, 2020
@muhammednazil
Copy link
Author

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:odoo_client/app/data/services/odoo_api.dart';

import 'app/pages/home.dart';
import 'app/pages/login.dart';
import 'app/utility/strings.dart';
import 'base.dart';

class MyHttpOverrides extends HttpOverrides {
  @override
  HttpClient createHttpClient(SecurityContext context) {
    return super.createHttpClient(context)
      ..badCertificateCallback =
          (X509Certificate cert, String host, int port) => true;
  }
}

void main() {
  HttpOverrides.global = new MyHttpOverrides();
  WidgetsFlutterBinding.ensureInitialized();
  runApp(App());
}

class App extends StatefulWidget {
  @override
  _AppState createState() => _AppState();
}

class _AppState extends Base<App> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return FlutterEasyLoading(
      child: MaterialApp(
          debugShowCheckedModeBanner: false,
          title: Strings.app_title,
          theme: ThemeData(
            primarySwatch: Colors.indigo,
            fontFamily: "Montserrat",
          ),
          builder: EasyLoading.init(),
          home: FutureBuilder<Odoo>(
            future: getOdooInstance(),
            builder: (BuildContext context, AsyncSnapshot<Odoo> snapshot) {
              switch (snapshot.connectionState) {
                case ConnectionState.done:
                  return isLoggedIn() ? Home() : Login();
                default:
                  return new Container(
                    decoration: new BoxDecoration(color: Colors.white),
                    child: new Center(child: CircularProgressIndicator()),
                  );
              }
            },
          )),
    );
  }
}

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building Overlay(state: OverlayState#22314(entries: [EasyLoadingOverlayEntry#1deb0(opaque: false; maintainState: false), EasyLoadingOverlayEntry#51aaf(opaque: false; maintainState: false)])):
'package:flutter/src/widgets/overlay.dart': Failed assertion: line 552 pos 15: 'textDirection != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was:
FlutterEasyLoading file:///Users/qlinksoftware/AndroidStudioProjects/Odoo-JsonRpc-with-Flutter/lib/main.dart:40:12
When the exception was thrown, this was the stack:
#2 new _RenderTheatre (package:flutter/src/widgets/overlay.dart:552:15)
#3 _Theatre.createRenderObject (package:flutter/src/widgets/overlay.dart:509:12)
#4 RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5491:28)
#5 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6232:11)
#6 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

@nslogx
Copy link
Owner

nslogx commented Nov 22, 2020

set MaterialApp as root widget, not FlutterEasyLoading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants