Get.rawRoute is null when i use Get.offAllToNamed
- Dominant language
- Dart
- Stars
- 11.2k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Get.rawRoute is null when i use Get.offAllToNamed, then i use Get.offAndToNamed It's normal.
example:
```dart
class AppLoadPage extends StatefulWidget {
@override
_AppLoadState createState() => _AppLoadState();
}
class _AppLoadState extends State {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_initApplication();
});
}
void _initApplication() async {
bool isLogin = true;
Get.offAllToNamed(isLogin ? Routes.HOME : Routes.LOGIN);
// Get.offAndToNamed(isLogin ? Routes.HOME : Routes.LOGIN); // is ok
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container( ),
);
}
}
```
```dart
class IndexLogic extends GetxController {
@override
void onInit() {
super.onInit();
print(Get.rawRoute); // null
print(ModalRoute.of(Get.context)); // null
}
}
class IndexPage extends StatelessWidget {
final IndexLogic logic = Get.find();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container( ),
);
}
}
```
**Flutter Version:**
1.22.3
**Getx Version:**
3.25.0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.