-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BahromjonPolat
committed
Dec 19, 2021
1 parent
ef30066
commit b0e16e8
Showing
7 changed files
with
125 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ProfileTabProvider extends ChangeNotifier { | ||
int _index = 0; | ||
|
||
void changeIndex(int index) { | ||
_index = index; | ||
notifyListeners(); | ||
} | ||
|
||
int get index => _index; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,40 +14,57 @@ class HeaderInfo extends StatelessWidget { | |
left: getProportionateScreenWidth(20.0), | ||
right: getProportionateScreenWidth(20.0), | ||
), | ||
padding: EdgeInsets.symmetric( | ||
horizontal: getProportionateScreenWidth(10.0), | ||
vertical: getProportionateScreenHeight(10.0), | ||
), | ||
height: getProportionateScreenHeight(250.0), | ||
child: Row( | ||
children: [ | ||
_setProfileImage(), | ||
Column( | ||
children: [ | ||
MyTextWidget("Bahrom\nPo'lat", color: ConstColor.textColor, size: 41.0,), | ||
], | ||
) | ||
SizedBox(width: getProportionateScreenWidth(10.0)), | ||
_setRightSideInfo(), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Padding _setProfileImage() => Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: getProportionateScreenWidth(10.0), | ||
vertical: getProportionateScreenHeight(10.0), | ||
), | ||
child: ClipRRect( | ||
borderRadius: _setBorderRadius(), | ||
child: Image.network( | ||
HotelImageUlr.room1, | ||
fit: BoxFit.cover, | ||
height: getProportionateScreenHeight(250.0), | ||
width: getProportionateScreenWidth(154.0), | ||
Expanded _setRightSideInfo() { | ||
return Expanded( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
MyTextWidget( | ||
"Bahrom\nPo'lat", | ||
color: ConstColor.textColor, | ||
size: 41.0, | ||
lines: 2, | ||
), | ||
SizedBox(height: getProportionateScreenHeight(14.0)), | ||
_setAccountInfo('Email', '[email protected]'), | ||
SizedBox(height: getProportionateScreenHeight(14.0)), | ||
_setAccountInfo('Date of birth', 'June, 18, 1994'), | ||
SizedBox(height: getProportionateScreenHeight(14.0)), | ||
_setAccountInfo('Address', 'Tashkent district, Tashkent'), | ||
], | ||
), | ||
); | ||
} | ||
|
||
ClipRRect _setProfileImage() => ClipRRect( | ||
borderRadius: _setBorderRadius(), | ||
child: Image.network( | ||
HotelImageUlr.room1, | ||
fit: BoxFit.cover, | ||
height: getProportionateScreenHeight(250.0), | ||
width: getProportionateScreenWidth(154.0), | ||
), | ||
); | ||
|
||
_setAccountInfo(String title, String data) => Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
MyTextWidget(title, color: ConstColor.lightGrey,size: 9.0), | ||
MyTextWidget(title, color: ConstColor.lightGrey, size: 9.0), | ||
MyTextWidget(data, color: ConstColor.textColor), | ||
], | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_ui/components/exporting_packages.dart'; | ||
import 'package:flutter_ui/provider/profile_tab_bar_provider.dart'; | ||
|
||
class ProfilePageTabBar extends StatelessWidget { | ||
ProfilePageTabBar({Key? key}) : super(key: key); | ||
late int _currentIndex; | ||
late ProfileTabProvider _tabProvider; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
_tabProvider = context.watch(); | ||
_currentIndex = _tabProvider.index; | ||
return Container( | ||
height: getProportionateScreenHeight(32.0), | ||
width: getProportionateScreenWidth(194.0), | ||
padding: EdgeInsets.symmetric( | ||
horizontal: getProportionateScreenWidth(6.0), | ||
vertical: getProportionateScreenHeight(5.0), | ||
), | ||
decoration: BoxDecoration( | ||
borderRadius: _setBorderRadius(), | ||
color: Colors.white, | ||
), | ||
child: Row( | ||
children: [ | ||
_setButton('About', 0), | ||
_setButton('Work', 1), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Expanded _setButton( | ||
String label, | ||
int index, | ||
) => | ||
Expanded( | ||
child: ElevatedButton( | ||
onPressed: () { | ||
_tabProvider.changeIndex(index); | ||
}, | ||
child: MyTextWidget( | ||
label, | ||
color: _checkIndex(index) ? Colors.white : ConstColor.blue, | ||
size: 11.0, | ||
weight: FontWeight.w700, | ||
), | ||
style: ElevatedButton.styleFrom( | ||
elevation: 0.0, | ||
shadowColor: Colors.transparent, | ||
primary: _checkIndex(index) ? ConstColor.blue : Colors.transparent, | ||
shape: RoundedRectangleBorder(borderRadius: _setBorderRadius()), | ||
), | ||
), | ||
); | ||
|
||
bool _checkIndex(int index) => _currentIndex == index ? true : false; | ||
|
||
BorderRadius _setBorderRadius() => BorderRadius.circular( | ||
getProportionateScreenWidth(16.0), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters