appBar method
Implementation
Widget appBar() {
return Container(
color: theme.palette.getAccent200(),
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Obx(
() => Row(
children: [
InkWell(
onTap: () {
willPop();
},
child: Icon(Platform.isAndroid?Icons.arrow_back:Icons.arrow_back_ios,color: theme.palette.getAccent800(),)),
const SizedBox(width: 8),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ProfileView(theme: theme,)),
);
},
child: Obx(() => Common.profileNetworkImage(
borderRadius: 60.0,
height: 40.0,
width: 40.0,
imageUrl: AppStorages.myProfilePicture.value)),
),
const SizedBox(width: 8),
Expanded(
child: Obx(() => Text(
AppStorages.myUserName.value,
style: CustomTextStyles.medium(
fontSize: 16.0, fontColor: theme.palette.getAccent800()),
)),
),
hasCreateGRPPermission.value
? IconButton(
icon: Icon(Icons.group_add,size: 25,color: theme.palette.getAccent800(),),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContactListView(forMakeGroup: true,theme: theme,)),
);
},
)
: const SizedBox.shrink(),
hasOneToOneChatPermission.value
? IconButton(
icon: Icon(Icons.person_add,size: 25,color: theme.palette.getAccent800(),),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContactListView(forMakeGroup: false,theme: theme,)),
).then((v){
getGroupList();
});
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// ContactListView(forMakeGroup: false,theme: theme,)),
},
)
: const SizedBox.shrink(),
],
),
),
);
}