|
| 1 | +import 'package:cached_network_image/cached_network_image.dart'; |
| 2 | +/** |
| 3 | + * Author: Damodar Lohani |
| 4 | + * profile: https://github.com/lohanidamodar |
| 5 | + */ |
| 6 | + |
| 7 | +import 'package:flutter/material.dart'; |
| 8 | +import 'package:flutter_ui_challenges/core/presentation/res/assets.dart'; |
| 9 | + |
| 10 | +class SettingsThreePage extends StatelessWidget { |
| 11 | + static final String path = "lib/src/pages/settings/settings3.dart"; |
| 12 | + final TextStyle headerStyle = TextStyle( |
| 13 | + color: Colors.grey.shade800, |
| 14 | + fontWeight: FontWeight.bold, |
| 15 | + fontSize: 20.0, |
| 16 | + ); |
| 17 | + @override |
| 18 | + Widget build(BuildContext context) { |
| 19 | + return Scaffold( |
| 20 | + backgroundColor: Colors.grey.shade200, |
| 21 | + appBar: AppBar( |
| 22 | + backgroundColor: Colors.green, |
| 23 | + title: Text( |
| 24 | + 'Settings', |
| 25 | + ), |
| 26 | + ), |
| 27 | + body: SingleChildScrollView( |
| 28 | + padding: const EdgeInsets.all(16.0), |
| 29 | + child: Column( |
| 30 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 31 | + children: <Widget>[ |
| 32 | + Text( |
| 33 | + "ACCOUNT", |
| 34 | + style: headerStyle, |
| 35 | + ), |
| 36 | + const SizedBox(height: 10.0), |
| 37 | + Card( |
| 38 | + elevation: 0.5, |
| 39 | + margin: const EdgeInsets.symmetric( |
| 40 | + vertical: 4.0, |
| 41 | + horizontal: 0, |
| 42 | + ), |
| 43 | + child: Column( |
| 44 | + children: <Widget>[ |
| 45 | + ListTile( |
| 46 | + leading: CircleAvatar( |
| 47 | + backgroundImage: NetworkImage(avatars[4]), |
| 48 | + ), |
| 49 | + title: Text("Damodar Lohani"), |
| 50 | + onTap: () {}, |
| 51 | + ), |
| 52 | + _buildDivider(), |
| 53 | + SwitchListTile( |
| 54 | + activeColor: Colors.purple, |
| 55 | + value: true, |
| 56 | + title: Text("Private Account"), |
| 57 | + onChanged: (val) {}, |
| 58 | + ), |
| 59 | + ], |
| 60 | + ), |
| 61 | + ), |
| 62 | + const SizedBox(height: 20.0), |
| 63 | + Text( |
| 64 | + "PUSH NOTIFICATIONS", |
| 65 | + style: headerStyle, |
| 66 | + ), |
| 67 | + Card( |
| 68 | + margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 0,), |
| 69 | + child: Column( |
| 70 | + children: <Widget>[ |
| 71 | + SwitchListTile( |
| 72 | + activeColor: Colors.purple, |
| 73 | + value: true, |
| 74 | + title: Text("Received notification"), |
| 75 | + onChanged: (val) {}, |
| 76 | + ), |
| 77 | + _buildDivider(), |
| 78 | + SwitchListTile( |
| 79 | + activeColor: Colors.purple, |
| 80 | + value: false, |
| 81 | + title: Text("Received newsletter"), |
| 82 | + onChanged: null, |
| 83 | + ), |
| 84 | + _buildDivider(), |
| 85 | + SwitchListTile( |
| 86 | + activeColor: Colors.purple, |
| 87 | + value: true, |
| 88 | + title: Text("Received Offer Notification"), |
| 89 | + onChanged: (val) {}, |
| 90 | + ), |
| 91 | + _buildDivider(), |
| 92 | + SwitchListTile( |
| 93 | + activeColor: Colors.purple, |
| 94 | + value: true, |
| 95 | + title: Text("Received App Updates"), |
| 96 | + onChanged: null, |
| 97 | + ), |
| 98 | + ], |
| 99 | + ), |
| 100 | + ), |
| 101 | + Card( |
| 102 | + margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 0,), |
| 103 | + child: ListTile( |
| 104 | + leading: Icon(Icons.exit_to_app), |
| 105 | + title: Text("Logout"), |
| 106 | + onTap: (){}, |
| 107 | + ), |
| 108 | + ), |
| 109 | + const SizedBox(height: 60.0), |
| 110 | + ], |
| 111 | + ), |
| 112 | + ), |
| 113 | + ); |
| 114 | + } |
| 115 | + |
| 116 | + Container _buildDivider() { |
| 117 | + return Container( |
| 118 | + margin: const EdgeInsets.symmetric( |
| 119 | + horizontal: 8.0, |
| 120 | + ), |
| 121 | + width: double.infinity, |
| 122 | + height: 1.0, |
| 123 | + color: Colors.grey.shade300, |
| 124 | + ); |
| 125 | + } |
| 126 | +} |
0 commit comments