Setup: Top left arrow button should go back

It's extremely irritating that it closes setup.
This commit is contained in:
Vishesh Handa
2021-07-25 09:52:14 +02:00
parent dff717eb9a
commit af83a70bf4
2 changed files with 15 additions and 7 deletions

View File

@ -2,8 +2,8 @@ import 'package:dart_git/dart_git.dart';
import 'package:dart_git/utils/result.dart'; import 'package:dart_git/utils/result.dart';
import 'package:function_types/function_types.dart'; import 'package:function_types/function_types.dart';
import 'package:git_bindings/git_bindings.dart' as git_bindings; import 'package:git_bindings/git_bindings.dart' as git_bindings;
import 'package:gitjournal/utils/logger.dart';
import 'package:gitjournal/utils/logger.dart';
import 'clone.dart'; import 'clone.dart';
Future<Result<void>> cloneRemote({ Future<Result<void>> cloneRemote({

View File

@ -406,6 +406,10 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
), ),
onTap: () { onTap: () {
if (_currentPageIndex != 0) {
_previousPage();
return;
}
_removeRemote(); _removeRemote();
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@ -418,10 +422,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
if (_currentPageIndex != 0) { if (_currentPageIndex != 0) {
pageController.previousPage( _previousPage();
duration: 200.milliseconds,
curve: Curves.easeIn,
);
return false; return false;
} }
@ -452,8 +453,15 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
} }
} }
void _nextPage() { Future<void> _previousPage() {
pageController.nextPage( return pageController.previousPage(
duration: 200.milliseconds,
curve: Curves.easeIn,
);
}
Future<void> _nextPage() {
return pageController.nextPage(
duration: 200.milliseconds, duration: 200.milliseconds,
curve: Curves.easeIn, curve: Curves.easeIn,
); );