Add the Auth and Analytics plugin, along with any other plugins you may have added as described in the **Project Setup** section;

```dart
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';

import 'amplifyconfiguration.dart';

Future<void> _configureAmplify() async {
  // Add Pinpoint and Cognito Plugins, and any other plugins you want to use
  final analyticsPlugin = AmplifyAnalyticsPinpoint();
  final authPlugin = AmplifyAuthCognito();
  await Amplify.addPlugins([analyticsPlugin, authPlugin]);
}
```

<Callout>

When running your app on MacOS you will need to enable keychain sharing in Xcode, as described in the [Project setup guide](/lib/project-setup/platform-setup/q/platform/flutter/#enable-keychain).

</Callout>

Make sure that the amplifyconfiguration.dart file generated in the project setup is included and sent to Amplify.configure:

```dart
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';

import 'amplifyconfiguration.dart';

Future<void> _configureAmplify() async {
  // ...
  await Amplify.addPlugins([analyticsPlugin, authPlugin]);

  // Once Plugins are added, configure Amplify
  // Note: Amplify can only be configured once.
  try {
    await Amplify.configure(amplifyconfig);
  } on AmplifyAlreadyConfiguredException {
    safePrint(
      'Tried to reconfigure Amplify; this can occur when your app restarts on Android.',
    );
  }
}
```

Your class will look like this:

```dart
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:flutter/material.dart';

import 'amplifyconfiguration.dart';

Future<void> _configureAmplify() async {
  // Add any Amplify plugins you want to use
  final analyticsPlugin = AmplifyAnalyticsPinpoint();
  final authPlugin = AmplifyAuthCognito();
  await Amplify.addPlugins([analyticsPlugin, authPlugin]);

  // Once Plugins are added, configure Amplify
  // Note: Amplify can only be configured once.
  try {
    await Amplify.configure(amplifyconfig);
  } on AmplifyAlreadyConfiguredException {
    safePrint(
      'Tried to reconfigure Amplify; this can occur when your app restarts on Android.',
    );
  }
}

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await _configureAmplify();
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}): super(key: key);
  
  // ...
}
```
