Can only open a new page once in a dialog
- Dominant language
- Dart
- Stars
- 11.2k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Description**
Can only open a new page once in a dialog
**My suggested solution**
Open new page again when click button
**Reproduction code**
```dart
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_demo/main.dart';
import 'package:get_demo/second_page.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State {
@override
initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
Future.delayed(Duration(milliseconds: 500), () {
Get.dialog(Material(
type: MaterialType.transparency,
child: Container(
// color: Colors.deepPurple,
child: Center(
child: RaisedButton(
child: Text('to second'),
onPressed: () async {
// Get.back();
Get.toNamed('/second');
},
),
),
),
));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('HomePage')),
body: Container(
color: Colors.white,
child: Center(
child: RaisedButton(child: Text('to second page'), onPressed: () => Get.toNamed('/second')),
),
),
);
}
}
```
**To Reproduce**
Steps to reproduce the behavior:
1. Click on button to second page
2. Close second page
3. Click on button to second page again
**Expected behavior**
Can open new page again
**Flutter Version:**
flutter 1.22.5 stable channel
**Getx Version:**
get: ^3.22.2
**Describe on which device you found the bug:**
Both android and iOS devices.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.