WIP
This commit is contained in:
parent
a92a34062c
commit
9433b391eb
|
@ -26,20 +26,50 @@ class ThrowExceptionWidget extends StatefulWidget {
|
|||
class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||
with TickerProviderStateMixin {
|
||||
late ThrowExceptionModel _model;
|
||||
|
||||
final animationsMap = <String, AnimationInfo>{};
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
Color _getColorByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return FlutterFlowTheme.of(context).error;
|
||||
case EnumThrowException.warning:
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
case EnumThrowException.success:
|
||||
return FlutterFlowTheme.of(context).success;
|
||||
}
|
||||
}
|
||||
IconData _getIconByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return Icons.cancel_outlined;
|
||||
case EnumThrowException.warning:
|
||||
return Icons.warning_amber_outlined;
|
||||
case EnumThrowException.success:
|
||||
return Icons.check_circle_outline;
|
||||
}
|
||||
}
|
||||
String _getTitleByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
||||
case EnumThrowException.warning:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
||||
case EnumThrowException.success:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@override void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => ThrowExceptionModel());
|
||||
|
||||
animationsMap.addAll({
|
||||
'stackOnPageLoadAnimation': AnimationInfo(
|
||||
trigger: AnimationTrigger.onPageLoad,
|
||||
|
@ -55,52 +85,12 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
),
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@override void dispose() {
|
||||
_model.maybeDispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Color _getColorByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return FlutterFlowTheme.of(context).error;
|
||||
case EnumThrowException.warning:
|
||||
return FlutterFlowTheme.of(context).warning;
|
||||
case EnumThrowException.success:
|
||||
return FlutterFlowTheme.of(context).success;
|
||||
}
|
||||
}
|
||||
|
||||
IconData _getIconByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return Icons.cancel_outlined;
|
||||
case EnumThrowException.warning:
|
||||
return Icons.warning_amber_outlined;
|
||||
case EnumThrowException.success:
|
||||
return Icons.check_circle_outline;
|
||||
}
|
||||
}
|
||||
|
||||
String _getTitleByType(BuildContext context) {
|
||||
switch (widget.type) {
|
||||
case EnumThrowException.error:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
||||
case EnumThrowException.warning:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
||||
case EnumThrowException.success:
|
||||
return FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@override Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
key: const ValueKey('ThrowExceptionWidget'),
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -110,11 +100,17 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
onTap: () async {
|
||||
context.pop();
|
||||
},
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: BorderRadius.circular(20.0), // Ajuste o valor conforme necessário
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 20.0),
|
||||
Stack(
|
||||
children: <Widget>[
|
||||
Align(
|
||||
|
@ -143,7 +139,7 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0),
|
||||
child: Text(
|
||||
valueOrDefault<String>(widget.msg, 'Message Not Found'),
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
|
@ -158,6 +154,7 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,6 +201,7 @@ class _AppState extends State<App> {
|
|||
isScrollControlled: true,
|
||||
// barrierColor: theme.primaryBackground.withOpacity(0.2),
|
||||
backgroundColor: theme.primaryBackground,
|
||||
showDragHandle: true,
|
||||
useSafeArea: true,
|
||||
enableDrag: true,
|
||||
// isDismissible: true,
|
||||
|
|
|
@ -141,7 +141,6 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
|||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0, bottom: 0.0),
|
||||
child: Material(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: const BoxConstraints(maxWidth: 570.0),
|
||||
|
@ -245,7 +244,6 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
|||
).animateOnPageLoad(animationsMap['containerOnPageLoadAnimation']!),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Widget _buildPasswordField(BuildContext context, {required TextEditingController? controller, required FocusNode? focusNode, required bool visibility, required VoidCallback onVisibilityToggle, required String hint, required String label, required String? Function(String?)? asValidator}) {
|
||||
|
|
|
@ -28,6 +28,7 @@ class DialogUtil {
|
|||
context: context,
|
||||
builder: (context) {
|
||||
return Dialog(
|
||||
|
||||
child: SizedBox(
|
||||
height: _height,
|
||||
child: Padding(
|
||||
|
|
Loading…
Reference in New Issue