Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercy811 committed Feb 13, 2024
1 parent dd4f426 commit f274e9b
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 68 deletions.
4 changes: 2 additions & 2 deletions example/lib/deviceid_sessionid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _DeviceIdSessionIdState extends State<DeviceIdSessionId> {
Row(
children: [
FutureBuilder(
future: AppState.of(context).analytics.getDeviceId(),
// future: AppState.of(context).analytics.getDeviceId(),
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
return Text(snapshot.data.toString());
},
Expand All @@ -33,7 +33,7 @@ class _DeviceIdSessionIdState extends State<DeviceIdSessionId> {
),
Row(children: [
FutureBuilder(
future: AppState.of(context).analytics.getSessionId(),
// future: AppState.of(context).analytics.getSessionId(),
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
return Text(snapshot.data.toString());
},
Expand Down
2 changes: 1 addition & 1 deletion example/lib/event_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class _EventFormState extends State<EventForm> {

void onPress() {
AppState.of(context)
..analytics.logEvent(_controller.text)
// ..analytics.logEvent(_controller.text)
..setMessage('Event sent.');
}

Expand Down
4 changes: 2 additions & 2 deletions example/lib/flush_thresholds_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _FlushThresholdFormState extends State<FlushThresholdForm> {

if (eventUploadThresholdInput.text.isNotEmpty && value != null) {
AppState.of(context)
..analytics.setEventUploadThreshold(value)
// ..analytics.setEventUploadThreshold(value)
..setMessage('Event upload threshold set.');
}
}
Expand All @@ -29,7 +29,7 @@ class _FlushThresholdFormState extends State<FlushThresholdForm> {

if (eventUploadPeriodMillisInput.text.isNotEmpty && value != null) {
AppState.of(context)
..analytics.setEventUploadPeriodMillis(value)
// ..analytics.setEventUploadPeriodMillis(value)
..setMessage('Event upload period millis set.');
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/lib/group_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class _GroupFormState extends State<GroupForm> {
void onPress() {
if (groupType.text.isNotEmpty && groupValue.text.isNotEmpty) {
AppState.of(context)
..analytics.setGroup(groupType.text, groupValue.text)
// ..analytics.setGroup(groupType.text, groupValue.text)
..setMessage('Group set.');
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/lib/group_identify_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class _GroupIdentifyFormState extends State<GroupIdentifyForm> {
..set(groupPropertyKey.text, groupPropertyValue.text);

AppState.of(context)
..analytics.groupIdentify(groupType.text, groupValue.text, identify)
// ..analytics.groupIdentify(groupType.text, groupValue.text, identify)
..setMessage('Group Identify sent.');
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/lib/identify_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class _IdentifyFormState extends State<IdentifyForm> {
}

AppState.of(context)
..analytics.identify(identify)
// ..analytics.identify(identify)
..setMessage('Identify sent.');
}

Expand Down
40 changes: 20 additions & 20 deletions example/lib/my_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,35 @@ class _MyAppState extends State<MyApp> {
void initState() {
super.initState();

analytics = Amplitude.getInstance(instanceName: "project");
analytics.setUseDynamicConfig(true);
analytics.setServerUrl("https://api2.amplitude.com");
analytics.init(widget.apiKey);
analytics.enableCoppaControl();
analytics.setUserId("test_user", startNewSession: true);
analytics.trackingSessionEvents(true);
analytics.setMinTimeBetweenSessionsMillis(5000);
analytics.setEventUploadThreshold(5);
analytics.setEventUploadPeriodMillis(30000);
analytics.setServerZone("US");
analytics.logEvent('MyApp startup',
eventProperties: {'event_prop_1': 10, 'event_prop_2': true});
analytics.logEvent('Out of Session Event', outOfSession: true);
analytics.setOptOut(true);
analytics.logEvent('Opt Out Event');
analytics.setOptOut(false);
// analytics = Amplitude.getInstance(instanceName: "project");
// analytics.setUseDynamicConfig(true);
// analytics.setServerUrl("https://api2.amplitude.com");
// analytics.init(widget.apiKey);
// analytics.enableCoppaControl();
// analytics.setUserId("test_user", startNewSession: true);
// analytics.trackingSessionEvents(true);
// analytics.setMinTimeBetweenSessionsMillis(5000);
// analytics.setEventUploadThreshold(5);
// analytics.setEventUploadPeriodMillis(30000);
// analytics.setServerZone("US");
// analytics.logEvent('MyApp startup',
// eventProperties: {'event_prop_1': 10, 'event_prop_2': true});
// analytics.logEvent('Out of Session Event', outOfSession: true);
// analytics.setOptOut(true);
// analytics.logEvent('Opt Out Event');
// analytics.setOptOut(false);

Map<String, dynamic> userProps = {
'date': '01.06.2020',
'name': 'Name',
'buildNumber': '1.1.1',
};
analytics.logRevenueAmount(21.9);
analytics.setUserProperties(userProps);
// analytics.logRevenueAmount(21.9);
// analytics.setUserProperties(userProps);
}

Future<void> _flushEvents() async {
await analytics.uploadEvents();
// await analytics.uploadEvents();

setMessage('Events flushed.');
}
Expand Down
2 changes: 1 addition & 1 deletion example/lib/regenerate_device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RegenerateDeviceBtn extends StatefulWidget {
class _DeviceState extends State<RegenerateDeviceBtn> {
void onPress() {
AppState.of(context)
..analytics.regenerateDeviceId()
// ..analytics.regenerateDeviceId()
..setMessage('Regenerate DeviceId.');
}

Expand Down
14 changes: 7 additions & 7 deletions example/lib/revenue_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class _RevenueFormState extends State<RevenueForm> {
if (productId.text.isNotEmpty &&
double.tryParse(price.text) != null &&
int.tryParse(quantity.text) != null) {
AppState.of(context)
..analytics.logRevenue(
productId.text,
int.tryParse(quantity.text)!,
double.tryParse(price.text)!,
)
..setMessage('Revenue Sent.');
// AppState.of(context)
// // ..analytics.logRevenue(
// productId.text,
// int.tryParse(quantity.text)!,
// double.tryParse(price.text)!,
// )
// ..setMessage('Revenue Sent.');
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/lib/user_id_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class _UserIdFormState extends State<UserIdForm> {
children: <Widget>[
Text('Current User Id', style: Theme.of(context).textTheme.headlineSmall),
FutureBuilder(
future: AppState.of(context).analytics.getUserId(),
// future: AppState.of(context).analytics.getUserId(),
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
return Text(snapshot.data.toString());
},
Expand Down
50 changes: 21 additions & 29 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ packages:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.dev"
source: hosted
version: "2.11.0"
version: "2.10.0"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,10 +28,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.2.1"
clock:
dependency: transitive
description:
Expand All @@ -44,10 +44,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.17.0"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -83,42 +83,42 @@ packages:
dependency: transitive
description:
name: js
sha256: a5e201311cb08bf3912ebbe9a2be096e182d703f881136ec1e81a2338a9e120d
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev"
source: hosted
version: "0.6.4"
version: "0.6.5"
matcher:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.13"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.2.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -128,10 +128,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -168,10 +168,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.4.16"
vector_math:
dependency: transitive
description:
Expand All @@ -180,14 +180,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
dart: ">=2.19.0 <4.0.0"
flutter: ">=2.0.0"
1 change: 0 additions & 1 deletion test/events/base_event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ void main() {
'revenue_type': revenueType,
'extra': extra,
'partner_id': partnerId,
'attempts': attempts,
};

expect(event.toMap(), equals(expectedMap));
Expand Down
1 change: 0 additions & 1 deletion test/events/event_options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ void main() {
expect(eventOptions.revenueType, equals(testRevenueType));
expect(eventOptions.extra, equals(testExtra));
expect(eventOptions.partnerId, equals(testPartnerId));
expect(eventOptions.attempts, equals(testAttempts));
});
});
}

0 comments on commit f274e9b

Please sign in to comment.