Project structure:
my_project:
- lib
- assets
- dark/logo.png
- logo.png
pubspec.yaml:
flutter:
assets:
- assets/logo.png
Code:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
themeMode: ThemeMode.light,
home: Scaffold(
body: Center(
child: Image.asset('assets/logo.png'),
),
),
);
}
}
Whenever I run the app, the variant inside the assets/dark directory is being used, not the main asset. I've tried switching between thememodes but that has not effect.