【发布时间】:2021-06-03 09:06:29
【问题描述】:
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ı"),
],
),
],
);
}
}
我想调用一个页面而不是索引堆栈字段中的文本。例如文本(“消息”);不是消息();作为 我输入了 ListView 语句,但找不到,请帮帮我 我想在索引堆栈字段中调用页面而不是文本。例如文本(“消息”);不是消息();作为 我输入了 ListView 语句,但找不到,请帮帮我 我想在索引堆栈字段中调用页面而不是文本。例如文本(“消息”);不是消息();作为 我输入了 ListView 语句,但找不到,请帮帮我
【问题讨论】:
-
请帮帮我:((
-
您好,请删除您问题中的重复句子。如果这是您的目标,这无助于搜索引擎优化您的问题。
标签: android firebase flutter dart flutter-dependencies