Commit c4c60993 authored by Dio Maulana's avatar Dio Maulana

mempersimple code

parent 77f560c3
...@@ -19,90 +19,51 @@ class SettingsMenu extends StatelessWidget { ...@@ -19,90 +19,51 @@ class SettingsMenu extends StatelessWidget {
margin: EdgeInsets.all(MediaQuery.of(context).size.width * 0.02), margin: EdgeInsets.all(MediaQuery.of(context).size.width * 0.02),
child: Column( child: Column(
children: [ children: [
InkWell( // format listSetting(context, 'nama setting', icon, widget(ketika di pencet mau diarahkan kemana))
onTap: () { listSetting(context, "General", Icons.settings_applications,
Navigator.push( const GeneralSetting()),
context, listSetting(context, "Base Url", Icons.link, const InputBaseUrl()),
MaterialPageRoute( listSetting(context, "About", Icons.android, const AboutSetting()),
builder: (BuildContext context) => const GeneralSetting(),
),
);
},
child: Row(
children: [
const Icon(
Icons.settings_applications,
color: Colors.black,
size: 25,
),
SizedBox(width: MediaQuery.of(context).size.width * 0.02),
const Text(
"General",
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
)
], ],
), ),
), ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => const InputBaseUrl(),
),
); );
}, }
child: Row(
children: [ InkWell listSetting(
const Icon( BuildContext context, String title, IconData icons, Widget route) {
Icons.link, return InkWell(
color: Colors.black,
size: 25,
),
SizedBox(width: MediaQuery.of(context).size.width * 0.02),
const Text(
"Base Url",
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
)
],
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
),
InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => const AboutSetting(), builder: (BuildContext context) => route,
), ),
); );
}, },
child: Container( child: listSettingData(context, title, icons),
);
}
Container listSettingData(
BuildContext context, String title, IconData icons) {
return Container(
margin: const EdgeInsets.only(bottom: 15),
// color: Colors.red,
child: Row( child: Row(
children: [ children: [
const Icon( Icon(
Icons.android, icons,
color: Colors.black, color: Colors.black,
size: 25, size: 25,
), ),
SizedBox(width: MediaQuery.of(context).size.width * 0.02), SizedBox(width: MediaQuery.of(context).size.width * 0.02),
const Text( Text(
"About", title,
style: style: const TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
) )
], ],
), ),
),
)
],
),
),
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment