-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Similar to ElevatedButtonTheme, TextButtonTheme, It would be nice to have IconButtonTheme, to style different icon buttons in a sliver app bar for example.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(useMaterial3: true),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(),
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Theme(
data: Theme.of(context).copyWith(
elevatedButtonTheme: ElevatedButtonThemeData(
style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.orange),
),
),
),
child: Column(
children: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.more_vert),
),
IconButton(
style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.orange),
),
onPressed: () {},
icon: const Icon(Icons.more_vert),
),
ElevatedButton(
onPressed: () {},
child: const Icon(Icons.more_vert),
),
],
),
);
}
}
Metadata
Metadata
Assignees
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds