I have a simple flutter app available on github having both Light and dark themes with a "Theme switch" button. On the main page, I have a Scaffold widget that takes it's background color property from the theme. Is there a way to check the background color of the Scaffold before and after switching themes during integration test with driver ?
Tried checking the active theme before and after switching themes, but fails:
group('Theme Test', () {
final themeButton = find.byValueKey('Button');
final themeProvider = ThemeProvider();
test('Switch between light and dark themes', () async {
expect(themeProvider.mode, ThemeMode.light); //check initial theme
await driver.tap(themeButton);
expect(themeProvider.mode, ThemeMode.dark); //check new theme
});
});
My goal is getting the background color of the Scaffold before and after switching themes with driver