0% found this document useful (0 votes)
26 views17 pages

Andriod 2 IOS

The document describes how to create a settings page UI in Flutter that can convert between iOS and Android styles. It includes code to build the settings screen with sections for common, account, security and misc settings along with switches and navigation icons.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views17 pages

Andriod 2 IOS

The document describes how to create a settings page UI in Flutter that can convert between iOS and Android styles. It includes code to build the settings screen with sections for common, account, security and misc settings along with switches and navigation icons.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Project 2

Question 1 Create an app which convert to IOS.

Code :
import 'package:flutter/cupertino.dart';

import 'package:flutter/material.dart';

void main() {

runApp(

const MaterialApp(

debugShowCheckedModeBanner: false,

home: Setting(),

),

);

class Setting extends StatefulWidget {

const Setting({Key? key}) : super(key: key);

@override

State<Setting> createState() => _SettingState();

class _SettingState extends State<Setting> {

bool switch1 = false, switch2 = false, switch3 = false, setting =


false;
@override

Widget build(BuildContext context) {

return Scaffold(

appBar: AppBar(

title: const Text("Settings UI"),

backgroundColor: const Color(0xffFF4500),

elevation: 0,

centerTitle: (setting) ? true : false,

actions: [

Switch(

value: setting,

activeColor: Colors.white,

onChanged: (val) {

setState(() {

setting = val;

});

})

],

),

body: (setting)

? ListView(

children: [

const Padding(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 5),

child: Text(

"Common",
style: TextStyle(

color: Colors.black38,

fontSize: 16,

fontWeight: FontWeight.w600,

),

),

),

ListTile(

horizontalTitleGap: 0,

visualDensity: const VisualDensity(vertical: -3),

tileColor: Colors.white,

title: const Text("Language"),

leading: const Icon(CupertinoIcons.globe),

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,

visualDensity: const VisualDensity(vertical: -3),

tileColor: Colors.white,

title: const Text("Environment"),

leading: const Icon(CupertinoIcons.cloud),

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(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 5),

child: Text(

"Accounts",

style: TextStyle(

color: Colors.black38,

fontSize: 16,

fontWeight: FontWeight.w600,

),

),

),

const ListTile(

horizontalTitleGap: 0,

visualDensity: VisualDensity(vertical: -3),

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,

visualDensity: VisualDensity(vertical: -3),

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,

visualDensity: VisualDensity(vertical: -3),

tileColor: Colors.white,

title: Text("Sign out"),

leading: Icon(CupertinoIcons.square_arrow_right),

trailing: Icon(

Icons.arrow_forward_ios_outlined,

size: 20,

),

),

const Padding(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 5),

child: Text(

"Security",

style: TextStyle(

color: Colors.black38,

fontSize: 16,

fontWeight: FontWeight.w600,

),

),

),

ListTile(

title: const Text("Lock app in background"),

leading: const Icon(Icons.phonelink_lock_sharp),

horizontalTitleGap: 0,
visualDensity: VisualDensity(vertical: -3),

tileColor: Colors.white,

trailing: CupertinoSwitch(

activeColor: const Color(0xffFF4500),

value: switch1,

onChanged: (val) {

setState(() {

switch1 = val;

});

},

),

),

const Divider(

height: 0.5,

color: Color(0xffF3EFF9),

),

ListTile(

title: const Text("Use fingerprint"),

leading: const Icon(Icons.fingerprint_sharp),

horizontalTitleGap: 0,

visualDensity: VisualDensity(vertical: -3),

tileColor: Colors.white,

trailing: CupertinoSwitch(

activeColor: const Color(0xffFF4500),

value: switch2,

onChanged: (val) {
setState(() {

switch2 = val;

});

},

),

),

const Divider(

height: 0.5,

color: Color(0xffF3EFF9),

),

ListTile(

title: const Text("Change password"),

leading: const Icon(Icons.lock),

horizontalTitleGap: 0,

visualDensity: VisualDensity(vertical: -3),

tileColor: Colors.white,

trailing: CupertinoSwitch(

activeColor: const Color(0xffFF4500),

value: switch3,

onChanged: (val) {

setState(() {

switch3 = val;

});

},

),

),
const Padding(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 5),

child: Text(

"Misc",

style: TextStyle(

color: Colors.black38,

fontSize: 16,

fontWeight: FontWeight.w600,

),

),

),

const ListTile(

title: Text("Terms of services"),

leading: Icon(CupertinoIcons.doc_text),

horizontalTitleGap: 0,

visualDensity: VisualDensity(vertical: -3),

tileColor: Colors.white,

trailing: Icon(

Icons.arrow_forward_ios_outlined,

size: 20,

),

),

const Divider(

height: 0.5,

color: Color(0xffF3EFF9),
),

const ListTile(

title: Text("Open source licences"),

leading: Icon(Icons.file_copy_outlined),

horizontalTitleGap: 0,

visualDensity: VisualDensity(vertical: -3),

tileColor: Colors.white,

trailing: Icon(

Icons.arrow_forward_ios_outlined,

size: 20,

),

),

],

: ListView(

children: [

Padding(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 10),

child: Text(

"Common",

style: TextStyle(

color: (setting) ? Colors.black38 : const


Color(0xffFF4500),

fontSize: 16,

fontWeight: FontWeight.w600,

),

),
),

const ListTile(

title: Text("Language"),

visualDensity: VisualDensity(vertical: -2.8),

leading: Icon(CupertinoIcons.globe),

subtitle: Text("English"),

),

const Divider(

height: 1,

),

const ListTile(

title: Text("Environment"),

visualDensity: VisualDensity(vertical: -2.8),

leading: Icon(CupertinoIcons.cloud),

subtitle: Text("Production"),

),

const Padding(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 10),

child: Text(

"Account",

style: TextStyle(

color: Color(0xffFF4500),

fontSize: 16,

fontWeight: FontWeight.w600,

),

),
),

const ListTile(

title: Text("Phone number"),

leading: Icon(CupertinoIcons.phone_solid),

visualDensity: VisualDensity(vertical: -2.8),

),

const Divider(

height: 1,

),

const ListTile(

title: Text("Email"),

leading: Icon(CupertinoIcons.mail_solid),

visualDensity: VisualDensity(vertical: -2.8),

),

const Divider(

height: 1,

),

const ListTile(

title: Text("Sign out"),

leading: Icon(CupertinoIcons.square_arrow_right),

visualDensity: VisualDensity(vertical: -2.8),

),

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(

title: const Text("Lock app in background"),

leading: const Icon(Icons.phonelink_lock_sharp),

visualDensity: VisualDensity(vertical: -2.8),

trailing: Switch(

activeColor: const Color(0xffFF4500),

value: switch1,

onChanged: (val) {

setState(() {

switch1 = val;

});

},

),

),

const Divider(height: 1,),

ListTile(
title: const Text("Use fingerprint"),

leading: const Icon(Icons.fingerprint_sharp),

visualDensity: VisualDensity(vertical: -2.8),

trailing: Switch(

activeColor: const Color(0xffFF4500),

value: switch2,

onChanged: (val) {

setState(() {

switch2 = val;

});

},

),

),

const Divider(height: 1,),

ListTile(

title: const Text("Change password"),

leading: const Icon(Icons.lock),

trailing: Switch(

activeColor: const Color(0xffFF4500),

value: switch3,

onChanged: (val) {

setState(() {

switch3 = val;

});

},
),

),

const Padding(

padding: EdgeInsets.only(left: 10, top: 15, bottom: 10),

child: Text(

"Misc",

style: TextStyle(

color: Color(0xffFF4500),

fontSize: 16,

fontWeight: FontWeight.w600,

),

),

),

const ListTile(

title: Text("Terms of services"),

leading: Icon(CupertinoIcons.doc_text),

visualDensity: VisualDensity(vertical: -2.8),

),

const Divider(height: 1,),

const ListTile(

title: Text("Open source licences"),

leading: Icon(Icons.file_copy_outlined),

visualDensity: VisualDensity(vertical: -2.8),

),

],

),
backgroundColor: (setting) ? Color(0xffF3EFF9) : Colors.white,

);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy