From 80fd88490f6e0d27b5590cebd12581f8c21da060 Mon Sep 17 00:00:00 2001 From: Ahmed alaa Date: Fri, 11 Jul 2025 03:09:44 +0300 Subject: [PATCH 1/2] chore: update example app --- example/lib/main.dart | 2 + example/lib/src/app_routes.dart | 4 + .../lib/src/components/network_content.dart | 48 +++++++- example/lib/src/screens/bug_reporting.dart | 40 ++++++ example/lib/src/screens/my_home_page.dart | 100 ++++++++++++++- .../lib/src/screens/session_replay_page.dart | 116 ++++++++++++++++++ example/lib/src/widget/instabug_button.dart | 6 +- 7 files changed, 309 insertions(+), 7 deletions(-) create mode 100644 example/lib/src/screens/session_replay_page.dart diff --git a/example/lib/main.dart b/example/lib/main.dart index 257bdde5b..e3edb3c09 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -22,6 +22,8 @@ part 'src/screens/crashes_page.dart'; part 'src/screens/bug_reporting.dart'; +part 'src/screens/session_replay_page.dart'; + part 'src/screens/complex_page.dart'; part 'src/screens/apm_page.dart'; diff --git a/example/lib/src/app_routes.dart b/example/lib/src/app_routes.dart index f52636cde..dd1a8d58b 100644 --- a/example/lib/src/app_routes.dart +++ b/example/lib/src/app_routes.dart @@ -1,4 +1,5 @@ import 'package:flutter/widgets.dart' show BuildContext; +import 'package:instabug_flutter/instabug_flutter.dart'; import 'package:instabug_flutter_example/main.dart'; final appRoutes = { @@ -12,6 +13,9 @@ final appRoutes = { BugReportingPage.screenName: (BuildContext context) => const BugReportingPage(), ComplexPage.screenName: (BuildContext context) => const ComplexPage(), + SessionReplayPage.screenName: (BuildContext context) => const SessionReplayPage(), + TopTabBarScreen.route: (BuildContext context) => const TopTabBarScreen(), + ApmPage.screenName: (BuildContext context) => const ApmPage(), ScreenLoadingPage.screenName: (BuildContext context) => const ScreenLoadingPage(), diff --git a/example/lib/src/components/network_content.dart b/example/lib/src/components/network_content.dart index 23eaa4dd2..8b6c9b09e 100644 --- a/example/lib/src/components/network_content.dart +++ b/example/lib/src/components/network_content.dart @@ -29,20 +29,62 @@ class _NetworkContentState extends State { const Text("W3C Header Section"), InstabugButton( text: 'Send Request With Custom traceparent header', - onPressed: () => _sendRequestToUrl(endpointUrlController.text, - headers: {"traceparent": "Custom traceparent header"}), + onPressed: () => + _sendRequestToUrl(endpointUrlController.text, + headers: {"traceparent": "Custom traceparent header"}), ), InstabugButton( text: 'Send Request Without Custom traceparent header', onPressed: () => _sendRequestToUrl(endpointUrlController.text), ), + InstabugButton( + text: 'obfuscateLog', + onPressed: () { + NetworkLogger.obfuscateLog((networkData) async { + return networkData.copyWith(url: 'fake url'); + }); + }, + ), + + InstabugButton( + text: 'omitLog', + onPressed: () { + NetworkLogger.omitLog((networkData) async { + return networkData.url.contains('google.com'); + }); + }, + ), + + InstabugButton( + text: 'obfuscateLogWithException', + onPressed: () { + NetworkLogger.obfuscateLog((networkData) async { + throw Exception("obfuscateLogWithException"); + + return networkData.copyWith(url: 'fake url'); + }); + }, + ), + + InstabugButton( + text: 'omitLogWithException', + onPressed: () { + NetworkLogger.omitLog((networkData) async { + throw Exception("OmitLog with exception"); + + return networkData.url.contains('google.com'); + }); + }, + ), ], ); } void _sendRequestToUrl(String text, {Map? headers}) async { try { - String url = text.trim().isEmpty ? widget.defaultRequestUrl : text; + String url = text + .trim() + .isEmpty ? widget.defaultRequestUrl : text; final response = await http.get(Uri.parse(url), headers: headers); // Handle the response here diff --git a/example/lib/src/screens/bug_reporting.dart b/example/lib/src/screens/bug_reporting.dart index 121e24292..0741a1735 100644 --- a/example/lib/src/screens/bug_reporting.dart +++ b/example/lib/src/screens/bug_reporting.dart @@ -106,6 +106,33 @@ class _BugReportingPageState extends State { ); }); } + void setOnDismissCallbackWithException() { + BugReporting.setOnDismissCallback((dismissType, reportType) { + throw Exception("Test crash from dismiss callback"); + }); + } + + void setOnInvokeCallbackWithException() { + BugReporting.setOnInvokeCallback(() { + throw Exception("Test crash from invoke callback"); + }); + } + + void setOnInvoiceCallback() { + BugReporting.setOnInvokeCallback(() { + showDialog( + context: context, + builder: (context) { + return const AlertDialog( + title: Text('On Invoke'), + content: Text( + 'onInvoke callback called', + ), + ); + }, + ); + }); + } void setDisclaimerText() { BugReporting.setDisclaimerText(disclaimerTextController.text); @@ -431,6 +458,19 @@ class _BugReportingPageState extends State { onPressed: setOnDismissCallback, text: 'Set On Dismiss Callback', ), + InstabugButton( + onPressed: setOnInvoiceCallback, + text: 'Set On Invoice Callback', + ), + + InstabugButton( + onPressed: setOnDismissCallbackWithException, + text: 'Set On Dismiss Callback with Exception', + ), + InstabugButton( + onPressed: setOnInvokeCallbackWithException, + text: 'Set On Invoice Callback with Exception' , + ), ], // This trailing comma makes auto-formatting nicer for build methods. ); } diff --git a/example/lib/src/screens/my_home_page.dart b/example/lib/src/screens/my_home_page.dart index 293e2fa18..611afbca0 100644 --- a/example/lib/src/screens/my_home_page.dart +++ b/example/lib/src/screens/my_home_page.dart @@ -169,6 +169,16 @@ class _MyHomePageState extends State { ); } + void _navigateToSessionReplay() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SessionReplayPage(), + settings: const RouteSettings(name: SessionReplayPage.screenName), + ), + ); + } + final _formUserAttributeKey = GlobalKey(); @override @@ -320,6 +330,11 @@ class _MyHomePageState extends State { onPressed: _navigateToComplex, text: 'Complex', ), + InstabugButton( + onPressed: _navigateToSessionReplay, + text: 'Session Replay', + + ), const SectionTitle('Sessions Replay'), InstabugButton( onPressed: getCurrentSessionReplaylink, @@ -397,7 +412,7 @@ class _MyHomePageState extends State { )), ], ), - SizedBox(height: 8,), + const SizedBox(height: 8,), InstabugButton( text: 'Set User attribute', key: const Key('set_user_data_btn'), @@ -417,7 +432,88 @@ class _MyHomePageState extends State { } }, ), - SizedBox(height: 10,), + const SizedBox(height: 10,), + const SectionTitle('Log'), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row( + children: [ + Expanded( + child: InstabugButton( + margin: const EdgeInsets.symmetric(horizontal: 2), + key: const ValueKey('log_hello_debug_btn'), + onPressed: () { + InstabugLog.logDebug("hello Debug"); + }, + text: 'Log Hello Debug', + ), + ), + Expanded( + child: InstabugButton( + margin: const EdgeInsets.symmetric(horizontal: 2), + + key: const ValueKey('log_hello_error_btn'), + onPressed: () { + InstabugLog.logError("hello Error"); + }, + text: 'Log Hello Error', + ), + ), + Expanded( + child: InstabugButton( + margin: const EdgeInsets.symmetric(horizontal: 2), + + key: const ValueKey('hello_warning_btn'), + onPressed: () { + InstabugLog.logWarn("hello Warning"); + }, + text: 'Log Hello Warn', + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row( + children: [ + Expanded( + child: InstabugButton( + margin: const EdgeInsets.symmetric(horizontal: 2), + + key: const ValueKey('log_hello_info_btn'), + onPressed: () { + InstabugLog.logInfo("hello Info"); + }, + text: 'Log Hello Info', + ), + ), + Expanded( + child: InstabugButton( + margin: const EdgeInsets.symmetric(horizontal: 2), + + key: const ValueKey('log_hello_verbose_btn'), + onPressed: () { + InstabugLog.logVerbose("hello Verbose"); + }, + text: 'Log Hello Verbose', + ), + ), + + Expanded( + child: InstabugButton( + margin: const EdgeInsets.symmetric(horizontal: 2), + + key: const ValueKey('clear_logs_btn'), + onPressed: () { + InstabugLog.clearAllLogs(); + }, + text: 'Clear All logs', + ), + ), + ], + ), + ), ], ), diff --git a/example/lib/src/screens/session_replay_page.dart b/example/lib/src/screens/session_replay_page.dart new file mode 100644 index 000000000..74be596e4 --- /dev/null +++ b/example/lib/src/screens/session_replay_page.dart @@ -0,0 +1,116 @@ +part of '../../main.dart'; + +class SessionReplayPage extends StatefulWidget { + static const screenName = 'SessionReplay'; + + const SessionReplayPage({Key? key}) : super(key: key); + + @override + State createState() => _SessionReplayPageState(); +} + +class _SessionReplayPageState extends State { + @override + Widget build(BuildContext context) { + return Page(title: 'Session Replay', children: [ + const SectionTitle('Enabling Session Replay'), + InstabugButton( + key: const Key('instabug_sesssion_replay_disable'), + onPressed: () => SessionReplay.setEnabled(false), + text: "Disable Session Replay", + ), + InstabugButton( + key: const Key('instabug_sesssion_replay_enable'), + onPressed: () => SessionReplay.setEnabled(true), + text: "Enable Session Replay", + ), + const SectionTitle('Enabling Session Replay Network'), + InstabugButton( + key: const Key('instabug_sesssion_replay_network_disable'), + onPressed: () => SessionReplay.setNetworkLogsEnabled(false), + text: "Disable Session Replay Network", + ), + InstabugButton( + key: const Key('instabug_sesssion_replay_network_enable'), + onPressed: () => SessionReplay.setNetworkLogsEnabled(true), + text: "Enable Session Replay Network", + ), + const SectionTitle('Enabling Session Replay User Steps'), + InstabugButton( + key: const Key('instabug_sesssion_replay_user_steps_disable'), + onPressed: () => SessionReplay.setUserStepsEnabled(false), + text: "Disable Session Replay User Steps", + ), + InstabugButton( + key: const Key('instabug_sesssion_replay_user_steps_enable'), + onPressed: () => SessionReplay.setUserStepsEnabled(true), + text: "Enable Session Replay User Steps", + ), + const SectionTitle('Enabling Session Replay Logs'), + InstabugButton( + key: const Key('instabug_sesssion_replay_logs_disable'), + onPressed: () => SessionReplay.setInstabugLogsEnabled(false), + text: "Disable Session Replay Logs", + ), + InstabugButton( + key: const Key('instabug_sesssion_replay_logs_enable'), + onPressed: () => SessionReplay.setInstabugLogsEnabled(true), + text: "Enable Session Replay Logs", + ), + const SectionTitle('Enabling Session Replay Repro steps'), + InstabugButton( + key: const Key('instabug_sesssion_replay_repro_steps_disable'), + onPressed: () => + Instabug.setReproStepsConfig( + sessionReplay: ReproStepsMode.disabled), + text: "Disable Session Replay Repro steps", + ), + InstabugButton( + key: const Key('instabug_sesssion_replay_repro_steps_enable'), + onPressed: () => + Instabug.setReproStepsConfig(sessionReplay: ReproStepsMode.enabled), + text: "Enable Session Replay Repro steps", + ), + InstabugButton( + key: const Key('instabug_sesssion_replay_tab_screen'), + onPressed: () => + Navigator.of(context).pushNamed(TopTabBarScreen.route), + text: 'Open Tab Screen', + ), + ]); + } +} + +class TopTabBarScreen extends StatelessWidget { + static const String route = "/tap"; + + const TopTabBarScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return DefaultTabController( + length: 4, // Number of tabs + child: Scaffold( + appBar: AppBar( + title: const Text('Top TabBar with 4 Tabs'), + bottom: const TabBar( + tabs: [ + Tab(text: 'Home', icon: Icon(Icons.home)), + Tab(text: 'Search', icon: Icon(Icons.search)), + Tab(text: 'Alerts', icon: Icon(Icons.notifications)), + Tab(text: 'Profile', icon: Icon(Icons.person)), + ], + ), + ), + body: const TabBarView( + children: [ + Center(child: Text('Home Screen')), + Center(child: Text('Search Screen')), + Center(child: Text('Alerts Screen')), + Center(child: Text('Profile Screen')), + ], + ), + ), + ); + } +} diff --git a/example/lib/src/widget/instabug_button.dart b/example/lib/src/widget/instabug_button.dart index 97e434061..e2a013dbc 100644 --- a/example/lib/src/widget/instabug_button.dart +++ b/example/lib/src/widget/instabug_button.dart @@ -7,6 +7,7 @@ class InstabugButton extends StatelessWidget { this.onPressed, this.fontSize, this.margin, + this.backgroundColor, }) : super(key: key); const InstabugButton.smallFontSize({ @@ -15,12 +16,13 @@ class InstabugButton extends StatelessWidget { this.onPressed, this.fontSize = 10.0, this.margin, + this.backgroundColor, }) : super(key: key); final String text; final Function()? onPressed; final double? fontSize; - + final Color? backgroundColor; final EdgeInsetsGeometry? margin; @override @@ -34,7 +36,7 @@ class InstabugButton extends StatelessWidget { child: ElevatedButton( onPressed: onPressed, style: ElevatedButton.styleFrom( - backgroundColor: Colors.lightBlue, + backgroundColor: backgroundColor??Colors.lightBlue, foregroundColor: Colors.white, textStyle: Theme.of(context) .textTheme From 71aef1d01d04306eea34eef72d097800f18a28a2 Mon Sep 17 00:00:00 2001 From: Ahmed alaa Date: Sun, 13 Jul 2025 04:42:28 +0300 Subject: [PATCH 2/2] chore: update example app --- example/lib/src/app_routes.dart | 3 +- .../lib/src/components/network_content.dart | 12 ++---- .../components/non_fatal_crashes_content.dart | 22 ++++------- example/lib/src/screens/bug_reporting.dart | 38 +++++++++---------- example/lib/src/screens/my_home_page.dart | 21 ++++------ .../lib/src/screens/session_replay_page.dart | 8 ++-- example/lib/src/widget/instabug_button.dart | 2 +- 7 files changed, 41 insertions(+), 65 deletions(-) diff --git a/example/lib/src/app_routes.dart b/example/lib/src/app_routes.dart index dd1a8d58b..bfc429dab 100644 --- a/example/lib/src/app_routes.dart +++ b/example/lib/src/app_routes.dart @@ -13,7 +13,8 @@ final appRoutes = { BugReportingPage.screenName: (BuildContext context) => const BugReportingPage(), ComplexPage.screenName: (BuildContext context) => const ComplexPage(), - SessionReplayPage.screenName: (BuildContext context) => const SessionReplayPage(), + SessionReplayPage.screenName: (BuildContext context) => + const SessionReplayPage(), TopTabBarScreen.route: (BuildContext context) => const TopTabBarScreen(), ApmPage.screenName: (BuildContext context) => const ApmPage(), diff --git a/example/lib/src/components/network_content.dart b/example/lib/src/components/network_content.dart index 8b6c9b09e..e5380a85c 100644 --- a/example/lib/src/components/network_content.dart +++ b/example/lib/src/components/network_content.dart @@ -29,9 +29,8 @@ class _NetworkContentState extends State { const Text("W3C Header Section"), InstabugButton( text: 'Send Request With Custom traceparent header', - onPressed: () => - _sendRequestToUrl(endpointUrlController.text, - headers: {"traceparent": "Custom traceparent header"}), + onPressed: () => _sendRequestToUrl(endpointUrlController.text, + headers: {"traceparent": "Custom traceparent header"}), ), InstabugButton( text: 'Send Request Without Custom traceparent header', @@ -45,7 +44,6 @@ class _NetworkContentState extends State { }); }, ), - InstabugButton( text: 'omitLog', onPressed: () { @@ -54,7 +52,6 @@ class _NetworkContentState extends State { }); }, ), - InstabugButton( text: 'obfuscateLogWithException', onPressed: () { @@ -65,7 +62,6 @@ class _NetworkContentState extends State { }); }, ), - InstabugButton( text: 'omitLogWithException', onPressed: () { @@ -82,9 +78,7 @@ class _NetworkContentState extends State { void _sendRequestToUrl(String text, {Map? headers}) async { try { - String url = text - .trim() - .isEmpty ? widget.defaultRequestUrl : text; + String url = text.trim().isEmpty ? widget.defaultRequestUrl : text; final response = await http.get(Uri.parse(url), headers: headers); // Handle the response here diff --git a/example/lib/src/components/non_fatal_crashes_content.dart b/example/lib/src/components/non_fatal_crashes_content.dart index 8d3bb7fb3..25e5ab790 100644 --- a/example/lib/src/components/non_fatal_crashes_content.dart +++ b/example/lib/src/components/non_fatal_crashes_content.dart @@ -55,28 +55,24 @@ class _NonFatalCrashesContentState extends State { InstabugButton( text: 'Throw ArgumentError', key: const Key('non_fatal_argument_exception'), - onPressed: () => throwHandledException(ArgumentError('This is an ArgumentError.')), ), InstabugButton( text: 'Throw RangeError', key: const Key('non_fatal_range_exception'), - onPressed: () => throwHandledException( RangeError.range(5, 0, 3, 'Index out of range')), ), InstabugButton( text: 'Throw FormatException', key: const Key('non_fatal_format_exception'), - onPressed: () => throwHandledException(UnsupportedError('Invalid format.')), ), InstabugButton( text: 'Throw NoSuchMethodError', key: const Key('non_fatal_no_such_method_exception'), - onPressed: () { dynamic obj; throwHandledException(obj.methodThatDoesNotExist()); @@ -85,7 +81,6 @@ class _NonFatalCrashesContentState extends State { const InstabugButton( text: 'Throw Handled Native Exception', key: Key('non_fatal_native_exception'), - onPressed: InstabugFlutterExampleMethodChannel.sendNativeNonFatalCrash, ), @@ -113,9 +108,8 @@ class _NonFatalCrashesContentState extends State { Expanded( child: InstabugTextField( label: "User Attribute key", - key: const Key("non_fatal_user_attribute_key_textfield"), - - controller: crashUserAttributeKeyController, + key: const Key("non_fatal_user_attribute_key_textfield"), + controller: crashUserAttributeKeyController, validator: (value) { if (crashUserAttributeValueController.text.isNotEmpty) { if (value?.trim().isNotEmpty == true) return null; @@ -128,9 +122,8 @@ class _NonFatalCrashesContentState extends State { Expanded( child: InstabugTextField( label: "User Attribute Value", - key: const Key("non_fatal_user_attribute_value_textfield"), - - controller: crashUserAttributeValueController, + key: const Key("non_fatal_user_attribute_value_textfield"), + controller: crashUserAttributeValueController, validator: (value) { if (crashUserAttributeKeyController.text.isNotEmpty) { if (value?.trim().isNotEmpty == true) return null; @@ -147,9 +140,9 @@ class _NonFatalCrashesContentState extends State { Expanded( child: InstabugTextField( label: "Fingerprint", - key: const Key("non_fatal_user_attribute_fingerprint_textfield"), - - controller: crashfingerPrintController, + key: const Key( + "non_fatal_user_attribute_fingerprint_textfield"), + controller: crashfingerPrintController, )), ], ), @@ -161,7 +154,6 @@ class _NonFatalCrashesContentState extends State { flex: 5, child: DropdownButtonHideUnderline( key: const Key("non_fatal_crash_level_dropdown"), - child: DropdownButtonFormField( value: crashType, diff --git a/example/lib/src/screens/bug_reporting.dart b/example/lib/src/screens/bug_reporting.dart index 0741a1735..6581a5345 100644 --- a/example/lib/src/screens/bug_reporting.dart +++ b/example/lib/src/screens/bug_reporting.dart @@ -10,7 +10,11 @@ class BugReportingPage extends StatefulWidget { } class _BugReportingPageState extends State { - List reportTypes = [ReportType.bug,ReportType.feedback,ReportType.question]; + List reportTypes = [ + ReportType.bug, + ReportType.feedback, + ReportType.question + ]; List invocationOptions = []; final disclaimerTextController = TextEditingController(); @@ -63,9 +67,7 @@ class _BugReportingPageState extends State { } else { reportTypes.add(reportType); } - setState(() { - - }); + setState(() {}); BugReporting.setReportTypes(reportTypes); } @@ -106,6 +108,7 @@ class _BugReportingPageState extends State { ); }); } + void setOnDismissCallbackWithException() { BugReporting.setOnDismissCallback((dismissType, reportType) { throw Exception("Test crash from dismiss callback"); @@ -323,7 +326,6 @@ class _BugReportingPageState extends State { title: const Text("Screenshot"), subtitle: const Text('Enable attachment for screenShot'), key: const Key('attachment_option_screenshot'), - ), CheckboxListTile( value: attachmentsOptionsExtraScreenshot, @@ -332,12 +334,10 @@ class _BugReportingPageState extends State { attachmentsOptionsExtraScreenshot = value ?? false; }); addAttachmentOptions(); - }, title: const Text("Extra Screenshot"), subtitle: const Text('Enable attachment for extra screenShot'), key: const Key('attachment_option_extra_screenshot'), - ), CheckboxListTile( value: attachmentsOptionsGalleryImage, @@ -346,12 +346,10 @@ class _BugReportingPageState extends State { attachmentsOptionsGalleryImage = value ?? false; }); addAttachmentOptions(); - }, title: const Text("Gallery"), subtitle: const Text('Enable attachment for gallery'), key: const Key('attachment_option_gallery'), - ), CheckboxListTile( value: attachmentsOptionsScreenRecording, @@ -360,17 +358,14 @@ class _BugReportingPageState extends State { attachmentsOptionsScreenRecording = value ?? false; }); addAttachmentOptions(); - }, title: const Text("Screen Recording"), subtitle: const Text('Enable attachment for screen Recording'), key: const Key('attachment_option_screen_recording'), - ), ], ), const SectionTitle('Bug reporting type'), - ButtonBar( mainAxisSize: MainAxisSize.min, alignment: MainAxisAlignment.start, @@ -378,8 +373,9 @@ class _BugReportingPageState extends State { ElevatedButton( key: const Key('bug_report_type_bug'), style: ElevatedButton.styleFrom( - backgroundColor: reportTypes.contains(ReportType.bug)?Colors.grey.shade400:null - ), + backgroundColor: reportTypes.contains(ReportType.bug) + ? Colors.grey.shade400 + : null), onPressed: () => toggleReportType(ReportType.bug), child: const Text('Bug'), ), @@ -387,16 +383,18 @@ class _BugReportingPageState extends State { key: const Key('bug_report_type_feedback'), onPressed: () => toggleReportType(ReportType.feedback), style: ElevatedButton.styleFrom( - backgroundColor: reportTypes.contains(ReportType.feedback)?Colors.grey.shade400:null - ), + backgroundColor: reportTypes.contains(ReportType.feedback) + ? Colors.grey.shade400 + : null), child: const Text('Feedback'), ), ElevatedButton( key: const Key('bug_report_type_question'), onPressed: () => toggleReportType(ReportType.question), style: ElevatedButton.styleFrom( - backgroundColor: reportTypes.contains(ReportType.question)?Colors.grey.shade400:null - ), + backgroundColor: reportTypes.contains(ReportType.question) + ? Colors.grey.shade400 + : null), child: const Text('Question'), ), ], @@ -419,7 +417,6 @@ class _BugReportingPageState extends State { onPressed: () => setDisclaimerText, child: const Text('set disclaimer text'), ), - const SectionTitle('Extended Bug Reporting'), ButtonBar( mainAxisSize: MainAxisSize.min, @@ -462,14 +459,13 @@ class _BugReportingPageState extends State { onPressed: setOnInvoiceCallback, text: 'Set On Invoice Callback', ), - InstabugButton( onPressed: setOnDismissCallbackWithException, text: 'Set On Dismiss Callback with Exception', ), InstabugButton( onPressed: setOnInvokeCallbackWithException, - text: 'Set On Invoice Callback with Exception' , + text: 'Set On Invoice Callback with Exception', ), ], // This trailing comma makes auto-formatting nicer for build methods. ); diff --git a/example/lib/src/screens/my_home_page.dart b/example/lib/src/screens/my_home_page.dart index 611afbca0..29e2f66d7 100644 --- a/example/lib/src/screens/my_home_page.dart +++ b/example/lib/src/screens/my_home_page.dart @@ -333,7 +333,6 @@ class _MyHomePageState extends State { InstabugButton( onPressed: _navigateToSessionReplay, text: 'Session Replay', - ), const SectionTitle('Sessions Replay'), InstabugButton( @@ -380,9 +379,7 @@ class _MyHomePageState extends State { onPressed: () => removeAllFeatureFlags(), text: 'RemoveAllFeatureFlags', ), - const SectionTitle('Set User Attribute'), - Form( key: _formUserAttributeKey, child: Column( @@ -412,7 +409,9 @@ class _MyHomePageState extends State { )), ], ), - const SizedBox(height: 8,), + const SizedBox( + height: 8, + ), InstabugButton( text: 'Set User attribute', key: const Key('set_user_data_btn'), @@ -428,11 +427,14 @@ class _MyHomePageState extends State { key: const Key('remove_user_data_btn'), onPressed: () { if (_formUserAttributeKey.currentState?.validate() == true) { - Instabug.removeUserAttribute(userAttributeKeyController.text); + Instabug.removeUserAttribute( + userAttributeKeyController.text); } }, ), - const SizedBox(height: 10,), + const SizedBox( + height: 10, + ), const SectionTitle('Log'), Padding( padding: const EdgeInsets.symmetric(horizontal: 20), @@ -451,7 +453,6 @@ class _MyHomePageState extends State { Expanded( child: InstabugButton( margin: const EdgeInsets.symmetric(horizontal: 2), - key: const ValueKey('log_hello_error_btn'), onPressed: () { InstabugLog.logError("hello Error"); @@ -462,7 +463,6 @@ class _MyHomePageState extends State { Expanded( child: InstabugButton( margin: const EdgeInsets.symmetric(horizontal: 2), - key: const ValueKey('hello_warning_btn'), onPressed: () { InstabugLog.logWarn("hello Warning"); @@ -480,7 +480,6 @@ class _MyHomePageState extends State { Expanded( child: InstabugButton( margin: const EdgeInsets.symmetric(horizontal: 2), - key: const ValueKey('log_hello_info_btn'), onPressed: () { InstabugLog.logInfo("hello Info"); @@ -491,7 +490,6 @@ class _MyHomePageState extends State { Expanded( child: InstabugButton( margin: const EdgeInsets.symmetric(horizontal: 2), - key: const ValueKey('log_hello_verbose_btn'), onPressed: () { InstabugLog.logVerbose("hello Verbose"); @@ -499,11 +497,9 @@ class _MyHomePageState extends State { text: 'Log Hello Verbose', ), ), - Expanded( child: InstabugButton( margin: const EdgeInsets.symmetric(horizontal: 2), - key: const ValueKey('clear_logs_btn'), onPressed: () { InstabugLog.clearAllLogs(); @@ -514,7 +510,6 @@ class _MyHomePageState extends State { ], ), ), - ], ), ), diff --git a/example/lib/src/screens/session_replay_page.dart b/example/lib/src/screens/session_replay_page.dart index 74be596e4..34d0d6d71 100644 --- a/example/lib/src/screens/session_replay_page.dart +++ b/example/lib/src/screens/session_replay_page.dart @@ -60,9 +60,8 @@ class _SessionReplayPageState extends State { const SectionTitle('Enabling Session Replay Repro steps'), InstabugButton( key: const Key('instabug_sesssion_replay_repro_steps_disable'), - onPressed: () => - Instabug.setReproStepsConfig( - sessionReplay: ReproStepsMode.disabled), + onPressed: () => Instabug.setReproStepsConfig( + sessionReplay: ReproStepsMode.disabled), text: "Disable Session Replay Repro steps", ), InstabugButton( @@ -73,8 +72,7 @@ class _SessionReplayPageState extends State { ), InstabugButton( key: const Key('instabug_sesssion_replay_tab_screen'), - onPressed: () => - Navigator.of(context).pushNamed(TopTabBarScreen.route), + onPressed: () => Navigator.of(context).pushNamed(TopTabBarScreen.route), text: 'Open Tab Screen', ), ]); diff --git a/example/lib/src/widget/instabug_button.dart b/example/lib/src/widget/instabug_button.dart index e2a013dbc..5bdb31eef 100644 --- a/example/lib/src/widget/instabug_button.dart +++ b/example/lib/src/widget/instabug_button.dart @@ -36,7 +36,7 @@ class InstabugButton extends StatelessWidget { child: ElevatedButton( onPressed: onPressed, style: ElevatedButton.styleFrom( - backgroundColor: backgroundColor??Colors.lightBlue, + backgroundColor: backgroundColor ?? Colors.lightBlue, foregroundColor: Colors.white, textStyle: Theme.of(context) .textTheme