-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
## 0.2.0 | ||
|
||
* Add `NestedHeader` widget. | ||
|
||
### Breaking changes | ||
|
||
* `FHeaderActionStyle.action` parameter has been renamed to `FHeaderStyle.actionStyle`. | ||
* `FHeaderActionStyle.padding` parameter has been moved to `FHeaderStyle.actionSpacing`. | ||
|
||
## 0.1.0 | ||
|
||
* Initial release! 🚀 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
forui/test/src/widgets/nested_header/nested_header_golden_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
@Tags(['golden']) | ||
library; | ||
|
||
import 'package:flutter/widgets.dart'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:forui/forui.dart'; | ||
import '../../test_scaffold.dart'; | ||
|
||
void main() { | ||
group('FNestedHeader', () { | ||
for (final (name, theme, _) in TestScaffold.themes) { | ||
testWidgets('$name with FNestedHeader actions', (tester) async { | ||
await tester.pumpWidget( | ||
TestScaffold( | ||
data: theme, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: FNestedHeader( | ||
title: 'Title', | ||
rightActions: [ | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.alarmClock, | ||
onPress: null, | ||
), | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.plus, | ||
onPress: () {}, | ||
), | ||
], | ||
onPop: () {}, | ||
), | ||
), | ||
), | ||
); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('nested-header/$name-header.png'), | ||
); | ||
}); | ||
|
||
testWidgets('$name with raw title', (tester) async { | ||
await tester.pumpWidget( | ||
TestScaffold( | ||
data: theme, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: FNestedHeader( | ||
rawTitle: const Text('Title'), | ||
rightActions: [ | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.alarmClock, | ||
onPress: null, | ||
), | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.plus, | ||
onPress: () {}, | ||
), | ||
], | ||
onPop: null, | ||
), | ||
), | ||
), | ||
); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('nested-header/$name-raw-title.png'), | ||
); | ||
}); | ||
|
||
testWidgets('$name with raw constructor', (tester) async { | ||
await tester.pumpWidget( | ||
TestScaffold( | ||
data: theme, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: FNestedHeader.raw( | ||
rawTitle: const Text('Title'), | ||
leftActions: [ | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.orbit, | ||
onPress: () {}, | ||
), | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.airVent, | ||
onPress: () {}, | ||
), | ||
], | ||
rightActions: [ | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.alarmClock, | ||
onPress: null, | ||
), | ||
FNestedHeaderAction( | ||
icon: FAssets.icons.plus, | ||
onPress: () {}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('nested-header/$name-raw-constructor.png'), | ||
); | ||
}); | ||
} | ||
}); | ||
} |
41 changes: 41 additions & 0 deletions
41
forui/test/src/widgets/nested_header/nested_header_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:forui/forui.dart'; | ||
|
||
void main() { | ||
group('FNestedHeader', () { | ||
for (final (title, rawTitle) in [ | ||
('', null), | ||
(null, const SizedBox()), | ||
]) { | ||
testWidgets('constructor does not throw error', (tester) async { | ||
expect( | ||
() => FNestedHeader( | ||
title: title, | ||
rawTitle: rawTitle, | ||
onPop: null, | ||
), | ||
returnsNormally, | ||
); | ||
}); | ||
} | ||
|
||
for (final (title, rawTitle) in [ | ||
(null, null), | ||
('', const SizedBox()), | ||
]) { | ||
testWidgets('constructor throws error', (tester) async { | ||
expect( | ||
() => FNestedHeader( | ||
title: title, | ||
rawTitle: rawTitle, | ||
onPop: () {}, | ||
), | ||
throwsAssertionError, | ||
); | ||
}); | ||
} | ||
}); | ||
} |