可以使用copyWith方法。
在Flutter的最新版本中,ThemeData中的primaryColor和accentColor不起作用是正确的。相反,您应该使用...
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( // theme: ThemeData( // colorScheme: ColorScheme.fromSwatch( // primarySwatch: Colors.pink, // accentColor: Colors.purple, // accent color here is the secondary in copy with, there are other properties like that /...