sakibguy / worked-issues

arget medi a[rpescriptionmedicie] &ssets[dr] (reeeverse._ax:p)
2 stars 0 forks source link

[ORG] SG-MYALICE: Tried to build dirty widget in the wrong build scope. #119

Closed sakibguy closed 1 year ago

sakibguy commented 1 year ago

PROB

Screenshot (678)

CODE SNIPPET

GetPage(name: FILTER_PAGE, page: () => FilterAdminPage()),

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class FilterAdminPage extends StatefulWidget {
  FilterAdminPage({Key? key}) : super(key: key);

  @override
  _FilterAdminPage createState() => _FilterAdminPage();
}

class _FilterAdminPage extends State<FilterAdminPage> {

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
        home: Container(
          color: Colors.white,
          child: Text("TEXT_1",
            style: TextStyle(
                color: CupertinoColors.systemBlue,
                fontSize: 20
            ),
          ),
        )
    );
  }
}
====================================================================================================

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Tried to build dirty widget in the wrong build scope.

A widget which was marked as dirty and is still active was scheduled to be built, but the current build scope unexpectedly does not contain that widget.

Sometimes this is detected when an element is removed from the widget tree, but the element somehow did not get marked as inactive. In that case, it might be caused by an ancestor element failing to implement visitChildren correctly, thus preventing some or all of its descendants from being correctly deactivated.

The root of the build scope was: [root]
  renderObject: RenderView#55a57
The offending element (which does not appear to be a descendant of the root of the build scope) was: _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#5d537]
  dirty
  state: _OverlayEntryWidgetState#6f481
When the exception was thrown, this was the stack: 
#0      BuildOwner.buildScope.<anonymous closure> (package:flutter/src/widgets/framework.dart:2626:13)
#1      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2651:10)
#2      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
#3      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:378:5)
#4      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)
#5      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1104:9)
#6      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1015:5)
#7      _invoke (dart:ui/hooks.dart:148:13)

SNaP

Screenshot (676)

sakibguy commented 1 year ago

Target Filter UI

Screenshot (677)

sakibguy commented 1 year ago

SOLn

Updated API from GetMaterialApp to MaterialApp and solved.

SNaP

Screenshot (679)