Skip to content

Commit a1c1d24

Browse files
committed
chore(flutter): format and fix analyzer issues
1 parent 5ed51ad commit a1c1d24

File tree

56 files changed

+561
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+561
-499
lines changed

flutter/example/integration_test/layout_snapshot_performance_test.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:async';
2-
31
import 'package:flutter/material.dart';
42
import 'package:flutter_test/flutter_test.dart';
53
import 'package:integration_test/integration_test.dart';
@@ -8,8 +6,7 @@ import 'package:measure_flutter/measure_flutter.dart';
86
void main() {
97
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
108

11-
testWidgets('Layout snapshot captureTree performance test',
12-
(WidgetTester tester) async {
9+
testWidgets('Layout snapshot captureTree performance test', (WidgetTester tester) async {
1310
await Measure.instance.init(
1411
() {},
1512
config: const MeasureConfig(
@@ -59,8 +56,7 @@ Widget _buildDeeplyNestedButton(int depth) {
5956
Center(
6057
child: ElevatedButton(
6158
key: const ValueKey('test_button'),
62-
onPressed: () {
63-
},
59+
onPressed: () {},
6460
child: const Text('Tap Me'),
6561
),
6662
),

flutter/example/lib/main.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ import 'package:measure_flutter_example/src/screen_main.dart';
66

77
Future<void> main() async {
88
await Measure.instance.init(
9-
() => runApp(MeasureWidget(child: MyApp())),
9+
() => runApp(MeasureWidget(child: MyApp())),
1010
config: const MeasureConfig(
11-
enableLogging: true,
12-
trackScreenshotOnCrash: true,
13-
trackHttpHeaders: true,
14-
trackHttpBody: true,
15-
httpUrlBlocklist: ['http://localhost'],
16-
autoStart: true,
17-
traceSamplingRate: 1,
18-
samplingRateForErrorFreeSessions: 1,
19-
layoutSnapshotWidgetTypes: {
20-
MyApp : 'MyApp',
21-
MainScreen : 'MainScreen',
22-
}
23-
),
11+
enableLogging: true,
12+
trackScreenshotOnCrash: true,
13+
trackHttpHeaders: true,
14+
trackHttpBody: true,
15+
httpUrlBlocklist: ['http://localhost'],
16+
autoStart: true,
17+
traceSamplingRate: 1,
18+
samplingRateForErrorFreeSessions: 1,
19+
layoutSnapshotWidgetTypes: {
20+
MyApp: 'MyApp',
21+
MainScreen: 'MainScreen',
22+
}),
2423
clientInfo: ClientInfo(
25-
apiKey: "msrsh_0c89033fc9ca86c29ba0300452d65ee441a60aac5adc7c5ee2d5057ebcbb4133_2d215ff0",
24+
apiKey:
25+
"msrsh_0c89033fc9ca86c29ba0300452d65ee441a60aac5adc7c5ee2d5057ebcbb4133_2d215ff0",
2626
apiUrl: "https://staging-ingest.measure.sh",
2727
),
2828
);
@@ -55,4 +55,4 @@ class MyApp extends StatelessWidget {
5555
home: MainScreen(),
5656
);
5757
}
58-
}
58+
}

flutter/example/lib/src/dio_interceptor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ class TraceHeaderInterceptor extends Interceptor {
3232
span?.end();
3333
super.onError(err, handler);
3434
}
35-
}
35+
}

flutter/example/lib/src/toggle_list_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ class _ToggleListItemState extends State<ToggleListItem> {
4343
onTap: () => _handleToggle(!_isToggled),
4444
);
4545
}
46-
}
46+
}

flutter/example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ packages:
159159
source: sdk
160160
version: "0.0.0"
161161
flutter_driver:
162-
dependency: transitive
162+
dependency: "direct dev"
163163
description: flutter
164164
source: sdk
165165
version: "0.0.0"

flutter/example/pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ dev_dependencies:
2323
sdk: flutter
2424
flutter_test:
2525
sdk: flutter
26+
flutter_driver:
27+
sdk: flutter
2628
flutter_lints: ^6.0.0
2729

2830
flutter:

flutter/packages/measure_dio/test/fake_measure.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ class FakeMeasure implements MeasureApi {
189189
}
190190

191191
@override
192-
Future<void> trackLongClick(LongClickData longClickData, LayoutSnapshot? snapshot) async {
192+
Future<void> trackLongClick(
193+
LongClickData longClickData, LayoutSnapshot? snapshot) async {
193194
throw UnimplementedError();
194195
}
195196

flutter/packages/measure_flutter/example/integration_test/layout_snapshot_performance_test.dart

Lines changed: 0 additions & 68 deletions
This file was deleted.

flutter/packages/measure_flutter/lib/measure_flutter.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ class Measure implements MeasureApi {
543543
}) {
544544
if (_isInitialized) {
545545
final details = FlutterErrorDetails(exception: error, stack: stack);
546-
return _measure.trackError(details, handled: true, attributes: attributes);
546+
return _measure.trackError(details,
547+
handled: true, attributes: attributes);
547548
}
548549
return Future.value();
549550
}
@@ -873,7 +874,8 @@ class Measure implements MeasureApi {
873874
attributes: attributes,
874875
);
875876
} else {
876-
developer.log('Failed to open bug report, Measure SDK is not initialized');
877+
developer
878+
.log('Failed to open bug report, Measure SDK is not initialized');
877879
return SizedBox.shrink(key: key);
878880
}
879881
}
@@ -967,7 +969,8 @@ class Measure implements MeasureApi {
967969
/// **Note:** Consider using [MeasureWidget] wrapper for automatic
968970
/// gesture tracking instead of manual tracking.
969971
@override
970-
Future<void> trackLongClick(LongClickData longClickData, LayoutSnapshot? snapshot) async {
972+
Future<void> trackLongClick(
973+
LongClickData longClickData, LayoutSnapshot? snapshot) async {
971974
if (isInitialized) {
972975
return _measure.trackLongClick(longClickData, snapshot);
973976
}
@@ -1123,7 +1126,8 @@ class Measure implements MeasureApi {
11231126
}
11241127
}
11251128

1126-
void _logInputConfig(bool enableLogging, Map<String, dynamic> jsonConfig, Map<String, String> jsonClientInfo) {
1129+
void _logInputConfig(bool enableLogging, Map<String, dynamic> jsonConfig,
1130+
Map<String, String> jsonClientInfo) {
11271131
if (enableLogging) {
11281132
developer.log(
11291133
'Initializing measure-flutter with config: $jsonConfig',

flutter/packages/measure_flutter/lib/src/attribute_builder.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import 'attribute_value.dart';
22

33
/// A fluent builder for creating attribute maps with automatic type conversion.
4-
///
4+
///
55
/// [AttributeBuilder] provides a convenient way to build maps of [AttributeValue]
66
/// objects from native Dart types. It automatically converts String, int, double,
77
/// and bool values to their corresponding [AttributeValue] types.
8-
///
8+
///
99
/// **Example:**
1010
/// ```dart
1111
/// final attributes = AttributeBuilder()
1212
/// .add('user_id', 'abc123') // Becomes StringAttr
13-
/// .add('age', 25) // Becomes IntAttr
13+
/// .add('age', 25) // Becomes IntAttr
1414
/// .add('score', 95.5) // Becomes DoubleAttr
1515
/// .add('is_premium', true) // Becomes BooleanAttr
1616
/// .build();
17-
///
17+
///
1818
/// Measure.instance.trackEvent(
1919
/// name: 'user_profile_updated',
2020
/// attributes: attributes,
@@ -24,25 +24,25 @@ final class AttributeBuilder {
2424
final Map<String, AttributeValue> _attributes = {};
2525

2626
/// Adds a key-value pair to the attributes map.
27-
///
27+
///
2828
/// The [value] is automatically converted to the appropriate [AttributeValue] type:
2929
/// - String → [StringAttr]
3030
/// - int → [IntAttr]
3131
/// - double → [DoubleAttr]
3232
/// - bool → [BooleanAttr]
33-
///
33+
///
3434
/// **Parameters:**
3535
/// - [key]: The attribute key
3636
/// - [value]: The attribute value (String, int, double, or bool)
37-
///
37+
///
3838
/// **Returns:** This [AttributeBuilder] instance for method chaining
3939
AttributeBuilder add(String key, Object value) {
4040
_attributes[key] = value.toAttr();
4141
return this;
4242
}
4343

4444
/// Builds and returns the final attributes map.
45-
///
45+
///
4646
/// **Returns:** A map of attribute keys to [AttributeValue] objects
4747
Map<String, AttributeValue> build() => _attributes;
4848
}

0 commit comments

Comments
 (0)