问题
如何更改 ElevatedButton
上的点击波纹效果的持续时间和颜色?可参考DartPad链接中的工作示例。
工作中的 ElevatedButton 代码
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// This is the main application widget.
class MyApp extends StatelessWidget {
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: MyStatelessWidget(),
),
);
}
}
class MyStatelessWidget extends StatelessWidget {
MyStatelessWidget({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: ElevatedButton(
onPressed: () {},
child: const Text('Elevated Button', style: TextStyle(fontSize: 20)),
),
);
}
}
InkWell
,这可能会有所帮助。https://dev59.com/oVUK5IYBdhLWcg3w6zU8 - vIvId_gOat