Skip to content

Instantly share code, notes, and snippets.

@tcd93
Last active January 19, 2021 04:06
Show Gist options
  • Save tcd93/f0934be685545e37d22d64f3cb4370b3 to your computer and use it in GitHub Desktop.
Save tcd93/f0934be685545e37d22d64f3cb4370b3 to your computer and use it in GitHub Desktop.
Flutter inconsistent button colors
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: lightTheme,
//theme: lightScheme,
home: Scaffold(
appBar: AppBar(
title: Text('Action Buttons'),
actions: [
OutlinedButton( // not visible on light theme
child: Icon(Icons.done_outline),
onPressed: () => {},
),
TextButton( // not visible on light theme
child: Icon(Icons.article),
onPressed: () => {},
),
ElevatedButton( // visible on light theme
child: Icon(Icons.done),
onPressed: () => {},
),
]
),
),
);
}
}
final lightTheme = ThemeData.light(); // issue
final lightScheme = ThemeData(
colorScheme: ColorScheme.light(),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment