提问人:settipalli sudheendra 提问时间:9/2/2023 更新时间:9/2/2023 访问量:28
我无法让 renderflex 继续运行
I am not able to get the renderflex to go
问:
我真的是fluuter的新手。这是我下面的代码。我尝试制作一个个人资料页面,但后来简历和其他东西溢出来,我无法让它显示在另一行下方的一行。A您的帮助将不胜感激。
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async { Navigator.push(context, PageRouteBuilder(pageBuilder: (context,animation1,animation2)=>Homescreen(),transitionDuration: Duration.zero,reverseTransitionDuration: Duration.zero)); return true; },
child: Scaffold(
appBar: AppBar(
title: const Text('Profile'),
),
bottomNavigationBar: Container(
color: Colors.black,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20),
child: GNav(
onTabChange: (index) {
if (index == 0) {
Navigator.push(
context,
PageRouteBuilder(pageBuilder: (context,animation1,animation2)=>Homescreen(),transitionDuration: Duration.zero,reverseTransitionDuration: Duration.zero));
}
if (index == 1) {
Navigator.push(context,
PageRouteBuilder(pageBuilder: (context,animation1,animation2)=>Forum_categories(),transitionDuration: Duration.zero,reverseTransitionDuration: Duration.zero));
}
if (index == 2) {
Navigator.push(context,
PageRouteBuilder(pageBuilder: (context,animation1,animation2)=>Chatbot(),transitionDuration: Duration.zero,reverseTransitionDuration: Duration.zero));
}
if (index == 3) {
Navigator.push(context,
PageRouteBuilder(pageBuilder: (context,animation1,animation2)=>Setting(),transitionDuration: Duration.zero,reverseTransitionDuration: Duration.zero));
}
},
backgroundColor: Colors.black,
color: Colors.white,
activeColor: Colors.white,
tabBorderRadius: 10,
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
tabBackgroundColor: Colors.blueGrey.shade900,
duration: Duration(milliseconds: 900),
tabs: const [
GButton(
icon: Icons.home,
text: 'Home',
gap: 10,
),
GButton(
icon: Icons.question_answer,
text: 'Forum',
gap: 10,
),
GButton(
icon: Icons.chat_rounded,
text: 'Chatbot',
gap: 10,
),
GButton(
icon: Icons.settings,
text: 'settings',
gap: 10,
),
],
),
),
),
body:
SingleChildScrollView(
child: Container(
padding: EdgeInsets.fromLTRB(20, 30, 30, 30),
child: Column(
children: [
imagepicker(
onpickedimage: (pickedimage) async {
_selectedimage = pickedimage;
final storageref = FirebaseStorage.instance
.ref()
.child('User-images')
.child('${FirebaseAuth.instance.currentUser!.uid}.jpg');
TaskSnapshot snap = await storageref.putData(_selectedimage!);
String imageurl = await snap.ref.getDownloadURL();
print(imageurl);
FirebaseFirestore.instance
.collection('users')
.doc(user.uid)
.update({'image_url': imageurl});
},
),
const SizedBox(
height: 20,
),
StreamBuilder(
stream: FirebaseFirestore.instance
.collection('users')
.doc(user.uid)
.snapshots(),
builder: (context, snapshot) {
if (snapshot.hasError) {
return const Text('Something went wrong');
}
if (snapshot.connectionState ==
ConnectionState.waiting) {
return const Center(
child: CircularProgressIndicator(),
);
} else {
Map<String, dynamic> doc =
snapshot.data!.data() as Map<String, dynamic>;
return Column(
children: [Row(children: [const Text('USERNAME:',style: TextStyle(fontWeight: FontWeight.bold)),SizedBox(width: 5,),Text(doc['username'],maxLines: 1,),],),
const SizedBox(
height: 20,
),
Row(children: [const Text('Bio:',style: TextStyle(fontWeight: FontWeight.bold)),SizedBox(width: 5,),Column(
children: [
Text(doc['Bio'],maxLines: 4,overflow: TextOverflow.clip,),
],
),],),
const SizedBox(
height: 20,
),
Row(children: [const Text('Email-Id:',style: TextStyle(fontWeight: FontWeight.bold)),SizedBox(width: 5,),Text(doc['email_id'],maxLines: 1,),],),
const SizedBox(
height: 20,
),
Row(children: [const Text('Company:',style: TextStyle(fontWeight: FontWeight.bold)),SizedBox(width: 5,),doc['Company']==null?Text('Add Company name'):Text(doc['Company'],maxLines: 1,),],),
const SizedBox(
height: 20,
),
Row(children: [const Text('Position:',style: TextStyle(fontWeight: FontWeight.bold)),SizedBox(width: 5,),doc['Position']==null?Text('Add Position'):Text(doc['Position'],maxLines: 1,),],),
const SizedBox(
height: 20,
),
Row(mainAxisSize:MainAxisSize.min,children: [const Text('About-Company:',style: TextStyle(fontWeight: FontWeight.bold),),SizedBox(width: 5,),doc['About_company']==null?Text('Add Company Information'):Text(doc['About_company'],maxLines: 4,overflow: TextOverflow.ellipsis,),],),
const SizedBox(
height: 20,
),
],
);
}
},
),
TextButton(
onPressed: () {
signout();
// Navigator.of(context).pop();
},
child: const Text('Logout'))
],
),
),
),
),
);
}
}
这是配置文件页面的外观,在此处输入图像描述
我尝试在它周围添加一个扩展的小部件,我尝试给文本一个maxline功能,我尝试为文本设置溢出参数,但似乎没有任何效果。
答: 暂无答案
评论