-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: fetch app start in integration instead of event processor (#…
…1905) * Change app start integration in a way that works with ttid as well * Formatting * Update * add visibleForTesting * Update * update * Add app start info test * Remove set app start info null * Review improvements * run on arm mac * Fix integration test
- Loading branch information
Showing
11 changed files
with
181 additions
and
73 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:flutter/scheduler.dart'; | ||
|
||
abstract class FrameCallbackHandler { | ||
void addPostFrameCallback(FrameCallback callback); | ||
} | ||
|
||
class DefaultFrameCallbackHandler implements FrameCallbackHandler { | ||
@override | ||
void addPostFrameCallback(FrameCallback callback) { | ||
try { | ||
/// Flutter >= 2.12 throws if SchedulerBinding.instance isn't initialized. | ||
SchedulerBinding.instance.addPostFrameCallback(callback); | ||
} catch (_) {} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:flutter/scheduler.dart'; | ||
import 'package:sentry_flutter/src/frame_callback_handler.dart'; | ||
|
||
class FakeFrameCallbackHandler implements FrameCallbackHandler { | ||
FrameCallback? storedCallback; | ||
|
||
final Duration _finishAfterDuration; | ||
|
||
FakeFrameCallbackHandler( | ||
{Duration finishAfterDuration = const Duration(milliseconds: 500)}) | ||
: _finishAfterDuration = finishAfterDuration; | ||
|
||
@override | ||
void addPostFrameCallback(FrameCallback callback) async { | ||
// ignore: inference_failure_on_instance_creation | ||
await Future.delayed(_finishAfterDuration); | ||
callback(Duration.zero); | ||
} | ||
} |
Oops, something went wrong.