|
| 1 | +import 'package:blogapp/NetworkHandler.dart'; |
| 2 | +import 'package:flutter/material.dart'; |
| 3 | + |
| 4 | +class MainProfile extends StatefulWidget { |
| 5 | + MainProfile({Key key}) : super(key: key); |
| 6 | + |
| 7 | + @override |
| 8 | + _MainProfileState createState() => _MainProfileState(); |
| 9 | +} |
| 10 | + |
| 11 | +class _MainProfileState extends State<MainProfile> { |
| 12 | + @override |
| 13 | + Widget build(BuildContext context) { |
| 14 | + return Scaffold( |
| 15 | + appBar: AppBar( |
| 16 | + elevation: 0, |
| 17 | + backgroundColor: Colors.white10, |
| 18 | + leading: IconButton( |
| 19 | + icon: Icon(Icons.arrow_back), |
| 20 | + onPressed: () {}, |
| 21 | + color: Colors.black, |
| 22 | + ), |
| 23 | + actions: <Widget>[ |
| 24 | + IconButton( |
| 25 | + icon: Icon(Icons.edit), |
| 26 | + onPressed: () {}, |
| 27 | + color: Colors.black, |
| 28 | + ), |
| 29 | + ], |
| 30 | + ), |
| 31 | + body: ListView( |
| 32 | + children: <Widget>[ |
| 33 | + head(), |
| 34 | + Divider( |
| 35 | + thickness: 0.8, |
| 36 | + ), |
| 37 | + otherDetails("About", |
| 38 | + " I am a balram rathore a fullstack developer also a web and app developer"), |
| 39 | + otherDetails("Name", "Balram Rathore"), |
| 40 | + Divider( |
| 41 | + thickness: 0.8, |
| 42 | + ), |
| 43 | + ], |
| 44 | + ), |
| 45 | + ); |
| 46 | + } |
| 47 | + |
| 48 | + Widget head() { |
| 49 | + return Padding( |
| 50 | + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 5), |
| 51 | + child: Column( |
| 52 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 53 | + children: <Widget>[ |
| 54 | + Center( |
| 55 | + child: CircleAvatar( |
| 56 | + radius: 50, |
| 57 | + backgroundImage: NetworkHandler().getImage("devStack06"), |
| 58 | + ), |
| 59 | + ), |
| 60 | + Text( |
| 61 | + "DevStack06", |
| 62 | + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), |
| 63 | + ), |
| 64 | + SizedBox( |
| 65 | + height: 10, |
| 66 | + ), |
| 67 | + Text("App Developer || Full Stack Developer, App and Web Developer") |
| 68 | + ], |
| 69 | + ), |
| 70 | + ); |
| 71 | + } |
| 72 | + |
| 73 | + Widget otherDetails(String label, String value) { |
| 74 | + return Padding( |
| 75 | + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 5), |
| 76 | + child: Column( |
| 77 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 78 | + children: <Widget>[ |
| 79 | + Text( |
| 80 | + "$label :", |
| 81 | + style: TextStyle( |
| 82 | + fontSize: 17, |
| 83 | + fontWeight: FontWeight.bold, |
| 84 | + ), |
| 85 | + ), |
| 86 | + SizedBox( |
| 87 | + height: 5, |
| 88 | + ), |
| 89 | + Text( |
| 90 | + value, |
| 91 | + style: TextStyle(fontSize: 15), |
| 92 | + ) |
| 93 | + ], |
| 94 | + ), |
| 95 | + ); |
| 96 | + } |
| 97 | +} |
0 commit comments