fix: add sobre o sistema na tela de configuração
This commit is contained in:
parent
67398d8e83
commit
0951f1c50a
|
@ -9,6 +9,7 @@ import 'package:hub/shared/components/molecules/locals/index.dart';
|
|||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||
import 'package:hub/shared/utils/path_util.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../../shared/utils/snackbar_util.dart';
|
||||
|
@ -238,18 +239,8 @@ class PreferencesPageModel with ChangeNotifier {
|
|||
showAlertDialog(context, title, content, onConfirm);
|
||||
}
|
||||
|
||||
void logout(BuildContext context) async {
|
||||
final String title = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Logout',
|
||||
ptText: 'Sair',
|
||||
);
|
||||
final String content = FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Are you sure you want to logout?',
|
||||
ptText: 'Tem certeza que deseja sair?',
|
||||
);
|
||||
onConfirm() async => AuthenticationService.signOut(context);
|
||||
|
||||
showAlertDialog(context, title, content, onConfirm);
|
||||
void navAboutSystem(BuildContext context) async {
|
||||
PathUtil.nav('/aboutSystemPage');
|
||||
}
|
||||
|
||||
void localUnlink(BuildContext context) {
|
||||
|
|
|
@ -29,9 +29,7 @@ class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
|||
create: (_) => PreferencesPageModel(),
|
||||
child: Consumer<PreferencesPageModel>(
|
||||
builder: (context, model, child) => GestureDetector(
|
||||
onTap: () => model.unfocusNode.canRequestFocus
|
||||
? FocusScope.of(context).requestFocus(model.unfocusNode)
|
||||
: FocusScope.of(context).unfocus(),
|
||||
onTap: () => model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
appBar: AppBar(
|
||||
|
@ -77,7 +75,7 @@ class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
|||
Expanded(
|
||||
flex: 2,
|
||||
child: ListView.builder(
|
||||
itemCount: 8,
|
||||
itemCount: 9,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
|
@ -175,12 +173,12 @@ class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
|||
);
|
||||
break;
|
||||
case 8:
|
||||
icon = Icons.logout;
|
||||
onPressed = () => model.logout(context);
|
||||
icon = Icons.info_outline;
|
||||
onPressed = () => model.navAboutSystem(context);
|
||||
isEnabled = false;
|
||||
content = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Sair da conta',
|
||||
enText: 'Logout',
|
||||
ptText: 'Sobre o Sistema',
|
||||
enText: 'About the System',
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
@ -205,12 +203,10 @@ class _PreferencesPageWidgetState extends State<PreferencesPageWidget> {
|
|||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundColor:
|
||||
isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate,
|
||||
backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate,
|
||||
child: Icon(
|
||||
icon,
|
||||
color:
|
||||
isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary,
|
||||
color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8.0),
|
||||
|
|
|
@ -218,16 +218,6 @@ class MenuEntry implements BaseModule {
|
|||
route: '/preferencesSettings',
|
||||
types: [MenuEntryType.Home, MenuEntryType.Drawer],
|
||||
),
|
||||
MenuEntry(
|
||||
key: 'FRE-HUB-LOGOUT',
|
||||
icon: Icons.exit_to_app,
|
||||
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||
ptText: 'Sair',
|
||||
enText: 'Logout',
|
||||
),
|
||||
route: '/WelcomePage',
|
||||
types: [MenuEntryType.Drawer],
|
||||
),
|
||||
MenuEntry(
|
||||
key: 'FRE-HUB-ABOUT-SYSTEM',
|
||||
icon: Icons.info_outline,
|
||||
|
@ -238,6 +228,16 @@ class MenuEntry implements BaseModule {
|
|||
route: '/aboutSystemPage',
|
||||
types: [MenuEntryType.Drawer],
|
||||
),
|
||||
MenuEntry(
|
||||
key: 'FRE-HUB-LOGOUT',
|
||||
icon: Icons.exit_to_app,
|
||||
name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(
|
||||
ptText: 'Sair',
|
||||
enText: 'Logout',
|
||||
),
|
||||
route: '/WelcomePage',
|
||||
types: [MenuEntryType.Drawer],
|
||||
),
|
||||
];
|
||||
|
||||
static List<MenuEntry> getEntriesByType(MenuEntryType type) {
|
||||
|
|
|
@ -238,19 +238,19 @@ class License {
|
|||
quantity: 0,
|
||||
),
|
||||
Module(
|
||||
key: LicenseKeys.logout.value,
|
||||
key: LicenseKeys.about.value,
|
||||
display: ModuleStatus.active.key,
|
||||
expirationDate: '',
|
||||
startDate: '',
|
||||
quantity: 0,
|
||||
),
|
||||
Module(
|
||||
key: LicenseKeys.about.value,
|
||||
key: LicenseKeys.logout.value,
|
||||
display: ModuleStatus.active.key,
|
||||
expirationDate: '',
|
||||
startDate: '',
|
||||
quantity: 0,
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue