added x button back to card error header
This commit is contained in:
parent
cb566d06bc
commit
4b5602b237
3 changed files with 34 additions and 33 deletions
|
|
@ -24,7 +24,7 @@ abstract class AppConfig {
|
|||
static const bool enableRegistration = true;
|
||||
static const double toolbarMaxHeight = 300.0;
|
||||
static const double toolbarMinHeight = 70.0;
|
||||
static const double toolbarMinWidth = 250.0;
|
||||
static const double toolbarMinWidth = 270.0;
|
||||
// #Pangea
|
||||
// static const Color primaryColor = Color(0xFF5625BA);
|
||||
// static const Color primaryColorLight = Color(0xFFCCBDEA);
|
||||
|
|
|
|||
|
|
@ -27,26 +27,26 @@ class CardErrorWidget extends StatelessWidget {
|
|||
constraints: maxWidth != null
|
||||
? BoxConstraints(maxWidth: maxWidth!)
|
||||
: const BoxConstraints(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CardHeader(
|
||||
text: errorCopy.title,
|
||||
botExpression: BotExpression.addled,
|
||||
onClose: () => choreographer?.onMatchError(
|
||||
cursorOffset: offset,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CardHeader(
|
||||
text: errorCopy.title,
|
||||
botExpression: BotExpression.addled,
|
||||
onClose: () => choreographer?.onMatchError(
|
||||
cursorOffset: offset,
|
||||
),
|
||||
const SizedBox(height: 12.0),
|
||||
Text(
|
||||
),
|
||||
const SizedBox(height: 12.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Text(
|
||||
errorCopy.body,
|
||||
style: BotStyle.text(context),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pangea/utils/bot_style.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../common/bot_face_svg.dart';
|
||||
|
|
@ -20,13 +22,12 @@ class CardHeader extends StatelessWidget {
|
|||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 5.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 3.0),
|
||||
child: BotFace(
|
||||
width: 50.0,
|
||||
expression: botExpression,
|
||||
),
|
||||
BotFace(
|
||||
width: 50.0,
|
||||
expression: botExpression,
|
||||
),
|
||||
const SizedBox(width: 12.0),
|
||||
Flexible(
|
||||
|
|
@ -36,17 +37,17 @@ class CardHeader extends StatelessWidget {
|
|||
softWrap: true,
|
||||
),
|
||||
),
|
||||
// const SizedBox(width: 5.0),
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.close_outlined),
|
||||
// onPressed: () {
|
||||
// if (onClose != null) onClose!();
|
||||
// MatrixState.pAnyState.closeOverlay();
|
||||
// },
|
||||
// color: Theme.of(context).brightness == Brightness.dark
|
||||
// ? AppConfig.primaryColorLight
|
||||
// : AppConfig.primaryColor,
|
||||
// ),
|
||||
const SizedBox(width: 5.0),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () {
|
||||
if (onClose != null) onClose!();
|
||||
MatrixState.pAnyState.closeOverlay();
|
||||
},
|
||||
color: Theme.of(context).brightness == Brightness.dark
|
||||
? AppConfig.primaryColorLight
|
||||
: AppConfig.primaryColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue