Open abhilashsajeev opened 1 year ago
@MarcelGarus
Interesting. I actually can't reproduce this – it works for me (this is the example application from the example
directory with your widget as the body):
Can you maybe post your entire example including the main
function?
@MarcelGarus I use a getx main function. very normal ones
import 'dart:math';
import 'package:flutter/services.dart';
import 'package:window_manager/window_manager.dart';
import 'constant/route_constant.dart';
import 'ui/view/second_home.dart';
import 'package:flutter/material.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'constant/get_pages_constant.dart';
void main() async {
try {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeRight,
DeviceOrientation.landscapeLeft,
]).then((value) => runApp(MyApp()));
await windowManager.ensureInitialized();
WindowOptions windowOptions = const WindowOptions(fullScreen: true);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
});
} catch (e) {}
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'MyApp',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.deepPurple,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
getPages: getPages,
initialRoute: RouteConstant.homeScreen,
home: const SecondHome(),
);
}
}
Also when I try to render marquee text dynamically, (Wrapped in OBX) the error throws
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0 ScrollPosition.minScrollExtent (package:flutter/src/widgets/scroll_position.dart:141:49)
#1 ScrollPosition._updateSemanticActions (package:flutter/src/widgets/scroll_position.dart:668:18)
#2 ScrollPosition.notifyListeners (package:flutter/src/widgets/scroll_position.dart:983:5)
#3 ScrollPosition.forcePixels (package:flutter/src/widgets/scroll_position.dart:384:5)
#4 ScrollPositionWithSingleContext.jumpTo (package:flutter/src/widgets/scroll_position_with_single_context.dart:202:7)
#5 ScrollController.jumpTo (package:flutter/src/widgets/scroll_controller.dart:172:16)
#6 _MarqueeState.initState.<anonymous closure> (package:marquee/marquee.dart:548:23)
#7 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1289:15)
#8 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
#9 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1076:5)
#10 _invoke (dart:ui/hooks.dart:145:13)
#11 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#12 _drawFrame (dart:ui/hooks.dart:112:31)
I am writing this widget
Eventhough the app runs and displays the marquee in terminal following error is shown
Why is this happening and how to resolve this?