Add initial configuration, tokens, and widgets for M3E components

- Introduced `.gitignore` and `.metadata` for apps and examples.
- Added Flutter/Dart analysis configurations (`analysis_options.yaml`).
- Implemented foundational tokens and themes for M3E (colors, shapes).
- Created base implementations for `IconButtonM3E` and `SplitButtonM3E`.
- Set up CI workflow (`ci.yaml`) to automate testing and analysis.
This commit is contained in:
Emily Pauli 2025-10-21 22:15:15 +02:00
commit 62ecb86b76
184 changed files with 9872 additions and 0 deletions

View file

@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:icon_button_m3e/icon_button_m3e.dart';
void main() {
testWidgets('Semantics exposes label and selected state', (tester) async {
const label = 'Favorite';
await tester.pumpWidget(
const MaterialApp(
home: Material(
child: IconButtonM3E(
icon: Icon(Icons.favorite_border),
selectedIcon: Icon(Icons.favorite),
isSelected: true,
tooltip: label,
),
),
),
);
final semantics = tester.getSemantics(find.byType(IconButtonM3E));
expect(semantics.flagsCollection.hasSelectedState, true);
expect(semantics.label, label);
});
testWidgets('Hit target is at least 48x48 when visual is XS (32)', (
tester,
) async {
await tester.pumpWidget(
const MaterialApp(
home: Material(
child: Center(
child: IconButtonM3E(
size: IconButtonM3ESize.xs,
icon: Icon(Icons.mic),
),
),
),
),
);
final size = tester.getSize(find.byType(IconButtonM3E));
expect(size.width, greaterThanOrEqualTo(48));
expect(size.height, greaterThanOrEqualTo(48));
});
}