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