Skip to content

Commit

Permalink
send to BE if integration operating system and cleanup ws closure
Browse files Browse the repository at this point in the history
  • Loading branch information
maxisme committed Nov 16, 2021
1 parent b3499e3 commit 3b78e2d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,19 @@ class MyApp extends StatefulWidget {

class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
void initState() {
super.initState();
Provider.of<User>(context, listen: false).loadUser();
}

@override
void deactivate() async {
await Provider.of<User>(context, listen: false).closeWS();
super.deactivate();
}

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
Expand Down
2 changes: 1 addition & 1 deletion lib/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class User with ChangeNotifier {
'Credentials': _user.credentials,
'Key': _user.credentialKey,
'Version': package.version,
'OS': Platform.operatingSystem,
'OS': getOperatingSystemName(),
};

if (shouldUseFirebase) {
Expand Down
7 changes: 7 additions & 0 deletions lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,10 @@ TextTheme getTextTheme() {
textBaseline: TextBaseline.alphabetic,
fontFamily: 'Inconsolata'));
}

String getOperatingSystemName() {
if (Globals.isIntegration) {
return '${Platform.operatingSystem}-integration';
}
return Platform.operatingSystem;
}

0 comments on commit 3b78e2d

Please sign in to comment.