0

I use flutter_settings_screens flutter plugin for settings screen of my mobile application and I can't change background of each setting. For example, I want to change background of SimpleSettingsTile. How can I do that ?

Here is my code:

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"),
        )),
    );
}
NeoFar
  • 77
  • 1
  • 12
  • AFAIK you can't change the properties of a plugin widget, so you have to create your own widget (you can look at the source code how it was made) – Wouter Jan 06 '22 at 20:11
  • İ looked at the source code and didn't find using of color of background – NeoFar Jan 07 '22 at 21:10
  • yes, but I mean you can make your own widget from scratch where you can choose whatever background color you want. And if you find it difficult to recreate the plugin's widgets, you can take a look at their source code for inspiration – Wouter Jan 07 '22 at 21:15
  • It's not just ui interface widget. There other things which need for me. If I will copy ui interface setting structure from plugin It will not work with other functionality of that plugin. I need all other classes.This will be difficult to collect. – NeoFar Jan 07 '22 at 21:20
  • Fair point, maybe you can find a plugin with similar functionality ... – Wouter Jan 07 '22 at 21:22
  • Fair point, maybe you can find a plugin with similar functionality ... – Wouter Jan 07 '22 at 21:22

1 Answers1

0

look at the plugin look for which defaults colour it is using and look for is it possible to modify it if yes modify it if not then this is not possible through that particular plugin

Vishal_VE
  • 1,852
  • 1
  • 6
  • 9
  • First of all I couldn't find using of backround color in that plugin I also have tried to add to that plugin that color setting but it can't be modified. – NeoFar Jan 07 '22 at 21:15
  • if it can not be modified than you have to mad your ui by your own – Vishal_VE Jan 11 '22 at 06:37