Skip to content

Commit

Permalink
remove some padding to see if that helps
Browse files Browse the repository at this point in the history
  • Loading branch information
btrautmann committed Sep 16, 2024
1 parent 510ae08 commit 363f8d6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 51 deletions.
8 changes: 1 addition & 7 deletions lib/src/golden_test_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,7 @@ class FlutterGoldenTestAdapter extends GoldenTestAdapter {
minHeight: constraints.minHeight,
maxWidth: constraints.maxWidth,
maxHeight: constraints.maxHeight,
child: Center(
child: Padding(
key: childKey,
padding: const EdgeInsets.all(8),
child: widget,
),
),
child: Center(child: widget),
),
);
},
Expand Down
41 changes: 19 additions & 22 deletions lib/src/golden_test_scenario.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,27 @@ class GoldenTestScenario extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
name,
style: const TextStyle(fontSize: 18),
textHeightBehavior: const TextHeightBehavior(
applyHeightToFirstAscent: false,
),
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
name,
style: const TextStyle(fontSize: 18),
textHeightBehavior: const TextHeightBehavior(
applyHeightToFirstAscent: false,
),
const SizedBox(height: 8),
ConstrainedBox(
constraints: constraints ??
GoldenTestScenarioConstraints.maybeOf(context) ??
const BoxConstraints(),
child: Builder(
builder: builder,
),
),
const SizedBox(height: 8),
ConstrainedBox(
constraints: constraints ??
GoldenTestScenarioConstraints.maybeOf(context) ??
const BoxConstraints(),
child: Builder(
builder: builder,
),
],
),
),
],
);
}
}
Expand Down
41 changes: 19 additions & 22 deletions test/smoke_tests/interactions_smoke_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,27 @@ void main() {
),
GoldenTestScenario(
name: 'scenario_button',
child: Padding(
padding: const EdgeInsets.all(16),
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
const Color(0xFF2196F3),
),
foregroundColor: MaterialStateProperty.all(
const Color(0xFFFFFFFF),
),
shadowColor: MaterialStateProperty.all(
const Color(0xFFFF0000),
),
surfaceTintColor: MaterialStateProperty.all(
const Color(0xFF00FF00),
),
overlayColor: MaterialStateProperty.all(
const Color(0xFF0000FF),
),
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
const Color(0xFF2196F3),
),
foregroundColor: MaterialStateProperty.all(
const Color(0xFFFFFFFF),
),
shadowColor: MaterialStateProperty.all(
const Color(0xFFFF0000),
),
surfaceTintColor: MaterialStateProperty.all(
const Color(0xFF00FF00),
),
overlayColor: MaterialStateProperty.all(
const Color(0xFF0000FF),
),
onPressed: () {},
onLongPress: () {},
child: const Text('button'),
),
onPressed: () {},
onLongPress: () {},
child: const Text('button'),
),
),
],
Expand Down

0 comments on commit 363f8d6

Please sign in to comment.