This repository has been archived by the owner on Apr 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from CCXXXI/dev
Dev
- Loading branch information
Showing
22 changed files
with
997 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,18 @@ import 'package:window_size/window_size.dart'; | |
|
||
import 'home/home_view.dart'; | ||
import 'settings/theme.dart'; | ||
import 'utils/database.dart' as db; | ||
import 'utils/log.dart'; | ||
import 'utils/sentry.dart'; | ||
import 'utils/string.dart'; | ||
|
||
void main() async { | ||
await Settings.init(); | ||
await db.initDatabase(); | ||
Settings.init(); | ||
initLog(); | ||
if (GetPlatform.isDesktop && !GetPlatform.isWeb) initDesktop(); | ||
await initMessages(); | ||
updateUser(); | ||
await initSentry(const MyApp()); | ||
} | ||
|
||
|
@@ -46,25 +50,3 @@ void initDesktop() { | |
|
||
logInfo('initDesktop end.'); | ||
} | ||
|
||
Future<void> initSentry(Widget app) async { | ||
final id_ = Settings.getValue('ecnu.id', ''); | ||
final id = id_.isEmpty ? null : id_; | ||
final username_ = Settings.getValue('ecnu.name', ''); | ||
final username = username_.isEmpty ? null : username_; | ||
logInfo('id: $id, username: $username'); | ||
logInfo('release: $release'); | ||
|
||
Sentry.configureScope((scope) => scope.user = | ||
SentryUser(id: id, username: username, ipAddress: '{{auto}}')); | ||
|
||
await SentryFlutter.init( | ||
(options) => options | ||
..dsn = | ||
'https://[email protected]/5975191' | ||
..tracesSampleRate = 1 | ||
..sendDefaultPii = true | ||
..release = release, | ||
appRunner: () => runApp(app), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.