我将flutter_settings_screens颤振插件用于我的移动应用程序的设置屏幕,我无法更改每个设置的背景。例如,我想更改SimpleSettingsTile的背景。我怎样才能做到这一点 ?
这是我的代码:
import 'package:flutter/material.dart';
import 'package:flutter_settings_screens/flutter_settings_screens.dart';
import 'package:torch/widget/icon_widget.dart';
class Settings extends StatefulWidget {
const Settings({Key? key}) : super(key: key);
@override
State<Settings> createState() => _SettingsState();
}
class _SettingsState extends State<Settings> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.indigo[900],
body: SafeArea(
child: ListView(
padding: EdgeInsets.all(24),
children: [
Ink(
color: Colors.indigo[900],
child: SettingsGroup(
title: 'General',
children: [
buildRemoveAds(),
buildRemoveAds(),
// buildSoundControl(),
// buildFlashOnStart(),
]),
)
],
),
),
);
}
Widget buildRemoveAds() => SimpleSettingsTile(
title: 'Remove ads',
subtitle: '',
leading: IconWidget(icon: Icons.login, color: Colors.indigo.shade900, ),
onTap: () => ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
margin: EdgeInsets.only(bottom:20),
behavior: SnackBarBehavior.floating,
content: Text("some message"),
)),
);
}