| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // Automatic FlutterFlow imports
- import '/backend/schema/structs/index.dart';
- import '/flutter_flow/flutter_flow_theme.dart';
- import '/flutter_flow/flutter_flow_util.dart';
- import 'index.dart'; // Imports other custom actions
- import '/flutter_flow/custom_functions.dart'; // Imports custom functions
- import 'package:flutter/material.dart';
- // Begin custom action code
- // DO NOT REMOVE OR MODIFY THE CODE ABOVE!
- import 'index.dart'; // Imports other custom actions
- import 'package:firebase_crashlytics/firebase_crashlytics.dart';
- /// TIJDELIJK — testknop voor taak 66 (P1-60). Weghalen zodra Crashlytics
- /// bewezen is.
- ///
- /// modus laten staan op Unset -> echte crash (Google's eigen testmethode).
- /// 'melding' -> niet-fatale melding, app blijft gewoon draaien.
- /// 'flutter' -> Flutter-framework-fout, loopt via de
- /// FlutterError.onError-koppeling in main.dart.
- Future crashlyticsTest(String? modus) async {
- final keuze = (modus ?? '').trim().toLowerCase();
- if (keuze == 'melding') {
- // Verschijnt in Crashlytics onder "Non-fatals". Wordt meteen verstuurd,
- // geen herstart nodig.
- await FirebaseCrashlytics.instance.recordError(
- Exception('Uitgaanskrant testmelding (niet-fataal) ${DateTime.now()}'),
- StackTrace.current,
- reason: 'Handmatige test taak 66',
- fatal: false,
- );
- print('CRASHLYTICS: niet-fatale melding verstuurd');
- return;
- }
- if (keuze == 'flutter') {
- // Gaat door FlutterError.onError -> recordFlutterFatalError, precies het
- // pad dat main.dart instelt.
- FlutterError.reportError(FlutterErrorDetails(
- exception: Exception('Uitgaanskrant testfout via FlutterError'),
- stack: StackTrace.current,
- library: 'crashlyticsTest',
- context: ErrorDescription('Handmatige test taak 66'),
- ));
- print('CRASHLYTICS: FlutterError gerapporteerd');
- return;
- }
- // Standaard: echte crash. Het rapport gaat pas mee bij de VOLGENDE start
- // van de app, dus na het tikken de app opnieuw openen.
- print('CRASHLYTICS: nu crashen...');
- FirebaseCrashlytics.instance.crash();
- }
- // Set your action name, define your arguments and return parameter,
- // and then add the boilerplate code using the `</>` button on the right!
|