I redirected my Home View page to another view.
class HomeView extends GetView<HomeController> {
const HomeView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return CustomScaffold(
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ElevatedButton(
onPressed: () {
Get.to(() => AirView());
},
child: Text("GO NEXT"),
),
);
After going to the next page, i encounter an error when I REFRESH the page.
No Directionality used.
Console Error
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following TypeErrorImpl was thrown building Directionality(textDirection: ltr): Unexpected null value. The relevant error-causing widget was: Directionality Directionality:file:///C:/Flutter/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/get-4.6.5/lib/get_navigation/src/root/get_material_app.dart:328:12 ..\…\root\get_material_app.dart:328 When the exception was thrown, this was the stack: C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 528:63 nullCheck packages/get/get_navigation/src/routes/route_middleware.dart 199:50 page packages/get/get_navigation/src/root/get_material_app.dart 347:23 initialRoutesGenerate packages/flutter/src/widgets/app.dart 1559:27 packages/flutter/src/widgets/navigator.dart 3290:41 restoreState packages/flutter/src/widgets/restoration.dart 887:5 [_doRestore] packages/flutter/src/widgets/restoration.dart 873:7 didChangeDependencies packages/flutter/src/widgets/navigator.dart 3336:11 didChangeDependencies packages/flutter/src/widgets/framework.dart 4963:11 [_firstBuild] packages/flutter/src/widgets/framework.dart 4781:5 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget ......
Second Page Codes:
const AirView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('AircoView'),
centerTitle: true,
),
body: const Center(
child: Text(
'AirView is working',
style: TextStyle(fontSize: 20),
),
),
);
}
}