mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
[Fixed] Use browser navigation
This commit is contained in:
parent
69b3a77d17
commit
d19fa0ccd0
22 changed files with 210 additions and 156 deletions
|
|
@ -133,10 +133,10 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
(context) async {
|
||||
await ref.read(syncProvider.notifier).clear();
|
||||
setState(() {});
|
||||
context.router.maybePop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
context.localized.clear,
|
||||
(context) => context.router.maybePop(),
|
||||
(context) => Navigator.of(context).pop(),
|
||||
context.localized.cancel,
|
||||
);
|
||||
},
|
||||
|
|
@ -451,7 +451,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FilledButton(
|
||||
onPressed: () => context.router.maybePop(),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text(context.localized.cancel),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/providers/user_provider.dart';
|
||||
import 'package:fladder/screens/shared/user_icon.dart';
|
||||
import 'package:fladder/util/adaptive_layout.dart';
|
||||
import 'package:fladder/util/router_extension.dart';
|
||||
|
||||
class SettingsScaffold extends ConsumerWidget {
|
||||
final String label;
|
||||
|
|
@ -39,6 +41,7 @@ class SettingsScaffold extends ConsumerWidget {
|
|||
if (AdaptiveLayout.of(context).size == ScreenLayout.single)
|
||||
SliverAppBar.large(
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
leading: context.router.backButton(),
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
titlePadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16)
|
||||
.add(EdgeInsets.only(left: padding.left, right: padding.right)),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import 'package:fladder/screens/shared/fladder_icon.dart';
|
|||
import 'package:fladder/util/adaptive_layout.dart';
|
||||
import 'package:fladder/util/application_info.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/router_extension.dart';
|
||||
import 'package:fladder/util/theme_extensions.dart';
|
||||
import 'package:fladder/widgets/shared/hide_on_scroll.dart';
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
scrollController: scrollController,
|
||||
showUserIcon: true,
|
||||
items: [
|
||||
if (context.router.canPop() && AdaptiveLayout.of(context).size == ScreenLayout.dual)
|
||||
if (context.router.canNavigateBack && AdaptiveLayout.of(context).size == ScreenLayout.dual)
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
|
|
@ -99,7 +100,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
style: IconButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.8),
|
||||
),
|
||||
onPressed: () => context.router.maybePop(),
|
||||
onPressed: () => context.router.popBack(),
|
||||
icon: Padding(
|
||||
padding: EdgeInsets.all(AdaptiveLayout.of(context).inputDevice == InputDevice.pointer ? 0 : 4),
|
||||
child: const Icon(IconsaxOutline.arrow_left_2),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue