import 'package:flutter/material.dart';
import 'package:self_cargo/Profile/profil_ayarlari.dart';
import 'package:self_cargo/pages/mesaj.dart';
class ProfilHome extends StatefulWidget {
ProfilHome({Key key}) : super(key: key);
@override
_ProfilHomeState createState() => _ProfilHomeState();
}
class _ProfilHomeState extends State<ProfilHome> {
int selectIndex = 0;
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return Scaffold(
body: sayfaAlani(size),
);
}
Widget sayfaAlani(size) {
return ListView(
children: [
Padding(
padding: const EdgeInsets.only(left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: (size.width - 20) * 0.3,
child: Stack(
children: [
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(width: 1, color: Colors.blue),
image: DecorationImage(
image: AssetImage("assets/images/user.png"),
fit: BoxFit.cover,
),
),
)
],
),
),
Container(
width: (size.width - 50) * 0.7,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
Text(
"61",
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold),
),
Text(
"Kargo İlanı",
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
Column(
children: [
Text(
"61",
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold),
),
Text(
"Yolculuk İlanı",
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
Column(
children: [
Text(
"61",
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold),
),
Text(
"Alışveriş İlanı",
style: TextStyle(
fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
],
))
],
),
SizedBox(height: 15),
Row(
children: [
Icon(Icons.account_circle),
SizedBox(
width: 10,
),
Text(
"Enahra Technology",
style: TextStyle(
fontSize: 16,
),
),
],
),
Row(
children: [
Icon(Icons.location_on),
SizedBox(
width: 10,
),
Text(
"İstanbul-Ataşehir",
style: TextStyle(
fontSize: 16,
),
),
],
),
Row(
children: [
Icon(Icons.work),
SizedBox(
width: 10,
),
Text(
"Yazılımcı",
style: TextStyle(
fontSize: 16,
),
),
],
),
SizedBox(height: 15),
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ProfilAyarlari()),
);
},
child: Container(
height: 35,
width: (size.width - 20),
decoration: BoxDecoration(
border: Border.all(width: 1, color: Colors.grey),
borderRadius: BorderRadius.circular(20),
color: Colors.transparent,
),
child: Center(
child: Text("Profil Ayarları"),
),
),
),
],
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 3),
child: Row(
children: [
Container(
width: (size.width * 0.3),
child: IconButton(
icon: Icon(Icons.view_in_ar),
splashRadius: 25,
iconSize: 30,
color: Colors.redAccent[200],
onPressed: () {
setState(() {
selectIndex = 0;
});
},
),
),
Container(
width: (size.width * 0.4),
child: IconButton(
icon: Icon(Icons.location_on),
splashRadius: 25,
iconSize: 30,
color: Colors.redAccent[200],
onPressed: () {
setState(() {
selectIndex = 1;
});
},
),
),
Container(
width: (size.width * 0.3),
child: IconButton(
icon: Icon(Icons.add_shopping_cart),
splashRadius: 25,
iconSize: 30,
color: Colors.redAccent[200],
onPressed: () {
setState(() {
selectIndex = 2;
});
},
),
),
],
),
),
Column(
children: [
Row(
children: [
Container(
height: 1,
width: (size.width * 0.3),
decoration: BoxDecoration(
color: selectIndex == 0
? Colors.redAccent[200]
: Colors.transparent,
),
),
Container(
height: 1,
width: (size.width * 0.4),
decoration: BoxDecoration(
color: selectIndex == 1
? Colors.redAccent[200]
: Colors.transparent,
),
),
Container(
height: 1,
width: (size.width * 0.3),
decoration: BoxDecoration(
color: selectIndex == 2
? Colors.redAccent[200]
: Colors.transparent,
),
),
],
),
],
),
SizedBox(
height: 3,
),
IndexedStack(
index: selectIndex,
children: [
Text("Kargo İlanları"),
Text("Yolculuk İlanları"),
Text("Alışveriş İlanları"),
],
),
],
);
}
}
Arkadaşlar sayfadaki tüm kodlar bunlar iconbutonların içeriği en altta IndexedStack alanından geliyor ben oraya text yerine Örnegin Mesaj(); sayfasını çagırmak istiyorum ben ama hata alıyor lütfen yardımcı olurmusunuz