refactor(ui): Replace default AppBar with FloatingAppBar components

This commit is contained in:
cogwheel0
2025-12-15 20:23:24 +05:30
parent 7619040e27
commit 8fa69fc165
2 changed files with 18 additions and 21 deletions

View File

@@ -478,25 +478,19 @@ class _SsoAuthPageState extends ConsumerState<SsoAuthPage> {
return ErrorBoundary( return ErrorBoundary(
child: Scaffold( child: Scaffold(
backgroundColor: context.conduitTheme.surfaceBackground, backgroundColor: context.conduitTheme.surfaceBackground,
appBar: AppBar( extendBodyBehindAppBar: true,
backgroundColor: context.conduitTheme.surfaceBackground, appBar: FloatingAppBar(
elevation: 0, leading: FloatingAppBarBackButton(
leading: ConduitIconButton( onTap: () => context.pop(),
icon: Platform.isIOS ? CupertinoIcons.back : Icons.arrow_back,
onPressed: () => context.pop(),
tooltip: l10n?.back ?? 'Back',
), ),
title: Text( title: FloatingAppBarTitle(text: l10n?.sso ?? 'SSO'),
l10n?.sso ?? 'SSO',
style: context.conduitTheme.headingMedium,
),
centerTitle: true,
actions: [ actions: [
if (_controller != null) if (_controller != null)
ConduitIconButton( FloatingAppBarAction(
icon: Platform.isIOS ? CupertinoIcons.refresh : Icons.refresh, child: FloatingAppBarIconButton(
onPressed: _refresh, icon: Platform.isIOS ? CupertinoIcons.refresh : Icons.refresh,
tooltip: l10n?.retry ?? 'Retry', onTap: _refresh,
),
), ),
], ],
), ),

View File

@@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io' show Platform;
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -8,6 +9,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../core/providers/app_providers.dart'; import '../../../core/providers/app_providers.dart';
import '../../../core/utils/markdown_to_text.dart'; import '../../../core/utils/markdown_to_text.dart';
import '../../../l10n/app_localizations.dart'; import '../../../l10n/app_localizations.dart';
import '../../../shared/widgets/conduit_components.dart';
import '../providers/chat_providers.dart'; import '../providers/chat_providers.dart';
import '../services/voice_call_service.dart'; import '../services/voice_call_service.dart';
@@ -155,16 +157,17 @@ class _VoiceCallPageState extends ConsumerState<VoiceCallPage>
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( extendBodyBehindAppBar: true,
title: Text(l10n.voiceCallTitle), appBar: FloatingAppBar(
leading: IconButton( leading: FloatingAppBarIconButton(
icon: const Icon(CupertinoIcons.xmark), icon: Platform.isIOS ? CupertinoIcons.xmark : Icons.close,
onPressed: () async { onTap: () async {
await _service?.stopCall(); await _service?.stopCall();
if (!context.mounted) return; if (!context.mounted) return;
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),
title: FloatingAppBarTitle(text: l10n.voiceCallTitle),
), ),
body: SafeArea( body: SafeArea(
child: Column( child: Column(