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: [
const Icon(
Icons.link,
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: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => const AboutSetting(),
),
);
},
child: Container(
child: Row(
children: [
const Icon(
Icons.android,
color: Colors.black,
size: 25,
),
SizedBox(width: MediaQuery.of(context).size.width * 0.02),
const Text(
"About",
style:
TextStyle(fontSize: 25, fontWeight: FontWeight.w500),
)
],
),
),
)
], ],
), ),
), ),
); );
} }
InkWell listSetting(
BuildContext context, String title, IconData icons, Widget route) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => route,
),
);
},
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(
children: [
Icon(
icons,
color: Colors.black,
size: 25,
),
SizedBox(width: MediaQuery.of(context).size.width * 0.02),
Text(
title,
style: const 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