Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
Comment thread
jonbhanson marked this conversation as resolved.
Outdated
- uses: subosito/flutter-action@v2
- name: Install Dependencies
run: flutter pub get
Expand Down
4 changes: 1 addition & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ class _MyHomePageState extends State<MyHomePage> {
// wireframe for each widget.
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
const Text('You have pushed the button this many times:'),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
Expand Down
32 changes: 26 additions & 6 deletions test/flutter_native_splash_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,32 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart' as p;

void main() {
test('parseColor parses values correctly', () {
expect(parseColor('#ffffff'), 'ffffff');
expect(parseColor(' FAFAFA '), 'FAFAFA');
expect(parseColor('121212'), '121212');
expect(parseColor(null), null);
expect(() => parseColor('badcolor'), throwsException);
group('parseColor', () {
test('parses string values correctly', () {
expect(parseColor('#ffffff'), 'ffffff');
expect(parseColor(' FAFAFA '), 'FAFAFA');
expect(parseColor('121212'), '121212');
expect(parseColor('#000000'), '000000');
expect(parseColor('F9E524'), 'F9E524');
});

test('returns null for null input', () {
expect(parseColor(null), null);
});

test('throws for invalid color strings', () {
expect(() => parseColor('badcolor'), throwsException);
expect(() => parseColor('#12345'), throwsException);
expect(() => parseColor('1234567'), throwsException);
expect(() => parseColor(''), throwsException);
});

test('handles integer values from YAML parsing', () {
// YAML parses unquoted numeric values like 000000 as int 0
expect(parseColor(0), '000000');
// YAML parses 123456 as int
expect(parseColor(123456), '123456');
Comment on lines +29 to +32

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// YAML parses unquoted numeric values like 000000 as int 0
expect(parseColor(0), '000000');
// YAML parses 123456 as int
expect(parseColor(123456), '123456');
expect(parseColor(0), '000000');
expect(parseColor(123456), '123456');

});
});

group('config file from args', () {
Expand Down