chore: adjust design
This commit is contained in:
parent
8717f1c430
commit
9512e78441
3 changed files with 51 additions and 35 deletions
|
|
@ -274,6 +274,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
ElevatedButton.icon(
|
ElevatedButton.icon(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
foregroundColor: theme.colorScheme.onPrimary,
|
foregroundColor: theme.colorScheme.onPrimary,
|
||||||
|
iconColor: theme.colorScheme.onPrimary,
|
||||||
backgroundColor: theme.colorScheme.primary,
|
backgroundColor: theme.colorScheme.primary,
|
||||||
),
|
),
|
||||||
icon: _recoveryKeyInputLoading
|
icon: _recoveryKeyInputLoading
|
||||||
|
|
@ -388,6 +389,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: theme.colorScheme.errorContainer,
|
backgroundColor: theme.colorScheme.errorContainer,
|
||||||
foregroundColor: theme.colorScheme.onErrorContainer,
|
foregroundColor: theme.colorScheme.onErrorContainer,
|
||||||
|
iconColor: theme.colorScheme.onErrorContainer,
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.delete_outlined),
|
icon: const Icon(Icons.delete_outlined),
|
||||||
label: Text(L10n.of(context).recoveryKeyLost),
|
label: Text(L10n.of(context).recoveryKeyLost),
|
||||||
|
|
@ -442,7 +444,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
titleText = L10n.of(context).oopsSomethingWentWrong;
|
titleText = L10n.of(context).oopsSomethingWentWrong;
|
||||||
body = const Icon(Icons.error_outline, color: Colors.red, size: 80);
|
body = const Icon(Icons.error_outline, color: Colors.red, size: 80);
|
||||||
buttons.add(
|
buttons.add(
|
||||||
OutlinedButton(
|
ElevatedButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
||||||
child: Text(L10n.of(context).close),
|
child: Text(L10n.of(context).close),
|
||||||
|
|
@ -468,7 +470,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
buttons.add(
|
buttons.add(
|
||||||
OutlinedButton(
|
ElevatedButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
||||||
child: Text(L10n.of(context).close),
|
child: Text(L10n.of(context).close),
|
||||||
|
|
@ -489,13 +491,17 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
title: Text(titleText ?? L10n.of(context).loadingPleaseWait),
|
title: Text(titleText ?? L10n.of(context).loadingPleaseWait),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Column(
|
child: Padding(
|
||||||
mainAxisSize: MainAxisSize.min,
|
padding: const EdgeInsets.all(20.0),
|
||||||
children: [
|
child: Column(
|
||||||
body,
|
mainAxisSize: MainAxisSize.min,
|
||||||
const SizedBox(height: 8),
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
...buttons,
|
children: [
|
||||||
],
|
body,
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
...buttons,
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:matrix/matrix.dart';
|
||||||
import 'package:opus_caf_converter_dart/opus_caf_converter_dart.dart';
|
import 'package:opus_caf_converter_dart/opus_caf_converter_dart.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/pages/chat/events/html_message.dart';
|
import 'package:fluffychat/pages/chat/events/html_message.dart';
|
||||||
import 'package:fluffychat/utils/error_reporter.dart';
|
import 'package:fluffychat/utils/error_reporter.dart';
|
||||||
|
|
@ -350,26 +351,42 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Badge(
|
AnimatedCrossFade(
|
||||||
isLabelVisible: audioPlayer != null,
|
firstChild: Padding(
|
||||||
label: audioPlayer == null
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
? null
|
|
||||||
: Text(
|
|
||||||
'${audioPlayer.speed.toString()}x',
|
|
||||||
),
|
|
||||||
backgroundColor: theme.colorScheme.secondary,
|
|
||||||
textColor: theme.colorScheme.onSecondary,
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: widget.color.withAlpha(128),
|
|
||||||
borderRadius: BorderRadius.circular(64),
|
|
||||||
onTap: audioPlayer == null ? null : _toggleSpeed,
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.mic_none_outlined,
|
Icons.mic_none_outlined,
|
||||||
color: widget.color,
|
color: widget.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
secondChild: Material(
|
||||||
|
color: widget.color.withAlpha(64),
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(AppConfig.borderRadius),
|
||||||
|
onTap: _toggleSpeed,
|
||||||
|
child: SizedBox(
|
||||||
|
width: 32,
|
||||||
|
height: 20,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'${audioPlayer?.speed.toString()}x',
|
||||||
|
style: TextStyle(
|
||||||
|
color: widget.color,
|
||||||
|
fontSize: 9,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
crossFadeState: audioPlayer == null
|
||||||
|
? CrossFadeState.showFirst
|
||||||
|
: CrossFadeState.showSecond,
|
||||||
|
duration: FluffyThemes.animationDuration,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ class RecordingDialogState extends State<RecordingDialog> {
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
||||||
child: Text(
|
child: Text(
|
||||||
L10n.of(context).cancel.toUpperCase(),
|
L10n.of(context).cancel,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
|
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
|
||||||
),
|
),
|
||||||
|
|
@ -194,7 +194,7 @@ class RecordingDialogState extends State<RecordingDialog> {
|
||||||
if (error != true)
|
if (error != true)
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
onPressed: _stopAndSend,
|
onPressed: _stopAndSend,
|
||||||
child: Text(L10n.of(context).send.toUpperCase()),
|
child: Text(L10n.of(context).send),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
@ -205,23 +205,16 @@ class RecordingDialogState extends State<RecordingDialog> {
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
||||||
child: Text(
|
child: Text(
|
||||||
L10n.of(context).cancel.toUpperCase(),
|
L10n.of(context).cancel,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
|
color: theme.colorScheme.error,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (error != true)
|
if (error != true)
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: _stopAndSend,
|
onPressed: _stopAndSend,
|
||||||
child: Row(
|
child: Text(L10n.of(context).send),
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(L10n.of(context).send.toUpperCase()),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
const Icon(Icons.send_outlined, size: 15),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue