part. fix velocidade na navegação entre telas
This commit is contained in:
parent
24c1c0ccb9
commit
cf8d789c2b
|
@ -9,17 +9,17 @@ import '../../../shared/services/localization/localization_service.dart';
|
|||
class MenuButtonWidget extends MenuEntry {
|
||||
const MenuButtonWidget({
|
||||
super.key,
|
||||
this.action,
|
||||
this.title,
|
||||
this.icon,
|
||||
});
|
||||
required this.action,
|
||||
required this.title,
|
||||
required this.icon,
|
||||
}) : super(action: action, title: title, icon: icon);
|
||||
|
||||
@override
|
||||
final Function()? action;
|
||||
final Function() action;
|
||||
@override
|
||||
final String? title;
|
||||
final String title;
|
||||
@override
|
||||
final IconData? icon;
|
||||
final IconData icon;
|
||||
|
||||
@override
|
||||
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
||||
|
@ -39,19 +39,9 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
|||
onTap: _isProcessing
|
||||
? null
|
||||
: () async {
|
||||
setState(() {
|
||||
_isProcessing = true;
|
||||
});
|
||||
await LocalizationService.processLocals(context).then((value) async {
|
||||
if (value) {
|
||||
await widget.action?.call();
|
||||
} else {
|
||||
DialogUnavailable.unavailableCredentials(context);
|
||||
}
|
||||
});
|
||||
setState(() {
|
||||
_isProcessing = false;
|
||||
});
|
||||
setState(() { _isProcessing = true; });
|
||||
await widget.action.call();
|
||||
setState(() { _isProcessing = false; });
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
|
||||
|
|
|
@ -9,17 +9,17 @@ import '../../../shared/services/localization/localization_service.dart';
|
|||
class MenuCardItem extends MenuEntry {
|
||||
const MenuCardItem({
|
||||
super.key,
|
||||
this.action,
|
||||
this.title,
|
||||
this.icon,
|
||||
});
|
||||
required this.action,
|
||||
required this.title,
|
||||
required this.icon,
|
||||
}) : super(action: action, title: title, icon: icon);
|
||||
|
||||
@override
|
||||
final Function()? action;
|
||||
final Function() action;
|
||||
@override
|
||||
final String? title;
|
||||
final String title;
|
||||
@override
|
||||
final IconData? icon;
|
||||
final IconData icon;
|
||||
|
||||
@override
|
||||
_MenuCardItemState createState() => _MenuCardItemState();
|
||||
|
@ -39,19 +39,9 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
|||
onTap: _isProcessing
|
||||
? null
|
||||
: () async {
|
||||
setState(() {
|
||||
_isProcessing = true;
|
||||
});
|
||||
await LocalizationService.processLocals(context).then((value) async {
|
||||
if (value) {
|
||||
await widget.action?.call();
|
||||
} else {
|
||||
DialogUnavailable.unavailableCredentials(context);
|
||||
}
|
||||
});
|
||||
setState(() {
|
||||
_isProcessing = false;
|
||||
});
|
||||
setState(() { _isProcessing = true; });
|
||||
await widget.action.call();
|
||||
setState(() { _isProcessing = false; });
|
||||
},
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
|
|
|
@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
|
|||
abstract class MenuEntry extends StatefulWidget {
|
||||
const MenuEntry({
|
||||
super.key,
|
||||
this.action,
|
||||
this.title,
|
||||
this.icon,
|
||||
required this.action,
|
||||
required this.title,
|
||||
required this.icon,
|
||||
});
|
||||
|
||||
final Function()? action;
|
||||
final String? title;
|
||||
final IconData? icon;
|
||||
final Function() action;
|
||||
final String title;
|
||||
final IconData icon;
|
||||
}
|
|
@ -562,7 +562,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
|||
ptText: 'Sair da Conta',
|
||||
),
|
||||
),
|
||||
MenuCardItem(icon: null, action: () {}, title: ''),
|
||||
];
|
||||
}();
|
||||
|
||||
|
|
Loading…
Reference in New Issue