Andriod 2 IOS
Andriod 2 IOS
Code :
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
debugShowCheckedModeBanner: false,
home: Setting(),
),
);
@override
return Scaffold(
appBar: AppBar(
elevation: 0,
actions: [
Switch(
value: setting,
activeColor: Colors.white,
onChanged: (val) {
setState(() {
setting = val;
});
})
],
),
body: (setting)
? ListView(
children: [
const Padding(
child: Text(
"Common",
style: TextStyle(
color: Colors.black38,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
trailing: SizedBox(
width: 100,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: const [
Text(
"English",
style: TextStyle(
color: Colors.black38,
fontSize: 16,
),
),
Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
],
),
),
),
const Divider(
height: 0.5,
color: Color(0xffF3EFF9),
),
ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
trailing: SizedBox(
width: 100,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: const [
Text(
"Production",
style: TextStyle(
color: Colors.black38,
fontSize: 16,
),
),
Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
],
),
),
),
const Padding(
child: Text(
"Accounts",
style: TextStyle(
color: Colors.black38,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
const ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
title: Text("Phone number"),
leading: Icon(CupertinoIcons.phone_solid),
trailing: Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
),
const Divider(
height: 0.5,
color: Color(0xffF3EFF9),
),
const ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
title: Text("Email"),
leading: Icon(CupertinoIcons.mail_solid),
trailing: Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
),
const Divider(
height: 0.5,
color: Color(0xffF3EFF9),
),
const ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
leading: Icon(CupertinoIcons.square_arrow_right),
trailing: Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
),
const Padding(
child: Text(
"Security",
style: TextStyle(
color: Colors.black38,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
ListTile(
horizontalTitleGap: 0,
visualDensity: VisualDensity(vertical: -3),
tileColor: Colors.white,
trailing: CupertinoSwitch(
value: switch1,
onChanged: (val) {
setState(() {
switch1 = val;
});
},
),
),
const Divider(
height: 0.5,
color: Color(0xffF3EFF9),
),
ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
trailing: CupertinoSwitch(
value: switch2,
onChanged: (val) {
setState(() {
switch2 = val;
});
},
),
),
const Divider(
height: 0.5,
color: Color(0xffF3EFF9),
),
ListTile(
horizontalTitleGap: 0,
tileColor: Colors.white,
trailing: CupertinoSwitch(
value: switch3,
onChanged: (val) {
setState(() {
switch3 = val;
});
},
),
),
const Padding(
child: Text(
"Misc",
style: TextStyle(
color: Colors.black38,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
const ListTile(
leading: Icon(CupertinoIcons.doc_text),
horizontalTitleGap: 0,
tileColor: Colors.white,
trailing: Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
),
const Divider(
height: 0.5,
color: Color(0xffF3EFF9),
),
const ListTile(
leading: Icon(Icons.file_copy_outlined),
horizontalTitleGap: 0,
tileColor: Colors.white,
trailing: Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
),
),
],
: ListView(
children: [
Padding(
child: Text(
"Common",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
const ListTile(
title: Text("Language"),
leading: Icon(CupertinoIcons.globe),
subtitle: Text("English"),
),
const Divider(
height: 1,
),
const ListTile(
title: Text("Environment"),
leading: Icon(CupertinoIcons.cloud),
subtitle: Text("Production"),
),
const Padding(
child: Text(
"Account",
style: TextStyle(
color: Color(0xffFF4500),
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
const ListTile(
leading: Icon(CupertinoIcons.phone_solid),
),
const Divider(
height: 1,
),
const ListTile(
title: Text("Email"),
leading: Icon(CupertinoIcons.mail_solid),
),
const Divider(
height: 1,
),
const ListTile(
leading: Icon(CupertinoIcons.square_arrow_right),
),
const Padding(
padding: EdgeInsets.only(left: 10, top: 15, bottom: 10),
child: Text(
"Security",
style: TextStyle(
color: Color(0xffFF4500),
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
ListTile(
trailing: Switch(
value: switch1,
onChanged: (val) {
setState(() {
switch1 = val;
});
},
),
),
ListTile(
title: const Text("Use fingerprint"),
trailing: Switch(
value: switch2,
onChanged: (val) {
setState(() {
switch2 = val;
});
},
),
),
ListTile(
trailing: Switch(
value: switch3,
onChanged: (val) {
setState(() {
switch3 = val;
});
},
),
),
const Padding(
child: Text(
"Misc",
style: TextStyle(
color: Color(0xffFF4500),
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
const ListTile(
leading: Icon(CupertinoIcons.doc_text),
),
const ListTile(
leading: Icon(Icons.file_copy_outlined),
),
],
),
backgroundColor: (setting) ? Color(0xffF3EFF9) : Colors.white,
);