## Record event The Amplify analytics plugin also makes it easy to record custom events within the app. The plugin handles retry logic in the event the device looses network connectivity and automatically batches requests to reduce network bandwidth. ```dart Future recordCustomEvent() async { final event = AnalyticsEvent('PasswordReset'); event.properties ..addStringProperty('Channel', 'SMS') ..addBoolProperty('Successful', true); // You can also add the properties one by one like the following event.properties.addIntProperty('ProcessDuration', 792); event.properties.addDoubleProperty('doubleKey', 120.3); await Amplify.Analytics.recordEvent(event: event); } ``` ## Flush events To manually flush events, call: ```dart await Amplify.Analytics.flushEvents(); ``` ## Global Properties You can register global properties which will be sent along with all invocations of `Amplify.Analytics.recordEvent`. ```dart Future registerGlobalProperties() async { final properties = AnalyticsProperties() ..addStringProperty('AppStyle', 'DarkMode'); await Amplify.Analytics.registerGlobalProperties( globalProperties: properties, ); } ``` To unregister a global property, call `Amplify.Analytics.unregisterGlobalProperties()`: ```dart Future unregisterGlobalProperties() async { await Amplify.Analytics.unregisterGlobalProperties( propertyNames: ['AppStyle', 'OtherProperty'], ); } ```