0

我将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"),
        )),
    );
}
4

1 回答 1

0

查看插件查找它正在使用的默认颜色并查找是否可以修改它如果是则修改它如果不是那么通过该特定插件是不可能的

于 2022-01-07T13:38:33.693 回答