Skip to content

Commit

Permalink
ui, fixed long username issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbreh committed Feb 3, 2024
1 parent dee0704 commit a1a5073
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 104 deletions.
3 changes: 3 additions & 0 deletions untitled_app/lib/controllers/edit_profile_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class EditProfileController extends ChangeNotifier {
void _pop() {
context.pop("poped");
}
void _popDialog() {
Navigator.of(context, rootNavigator: true).pop();
}

void _popTwice() {
_pop();
Expand Down
11 changes: 3 additions & 8 deletions untitled_app/lib/controllers/settings_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ class SettingsController extends ChangeNotifier {
}

void _pop() {
context.pop();
Navigator.of(context, rootNavigator: true).pop();
}

void _popDialog() {
Navigator.of(context, rootNavigator: true).pop();
}


void _delete() async {
_popDialog();
_pop();
try {
await locator<CurrentUser>().deleteAccount();
locator<NavBarController>().enable();
Expand Down Expand Up @@ -89,7 +84,7 @@ class SettingsController extends ChangeNotifier {
AppLocalizations.of(context)!.goBack,
AppLocalizations.of(context)!.delete
],
[_popDialog, _delete],
[_pop, _delete],
context);
}
}
17 changes: 11 additions & 6 deletions untitled_app/lib/custom_widgets/comment_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,17 @@ class _Card extends StatelessWidget {
minimumSize: const Size(0, 0),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: Text(
"@${post.author.username}",
style: TextStyle(
fontSize: 16,
color:
Theme.of(context).colorScheme.onBackground,
child: SizedBox(
width: width * 0.69,
child: Text(
"@${post.author.username}",
style: TextStyle(
fontSize: 16,
color: Theme.of(context)
.colorScheme
.onBackground,
),
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down
47 changes: 27 additions & 20 deletions untitled_app/lib/custom_widgets/post_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,20 @@ class PostCard extends StatelessWidget {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"@${post.author.username}", //post.author.name,
style: TextStyle(
fontSize: 17,
color: Theme.of(context)
.colorScheme
.onBackground,
SizedBox(
width: isPreview
? width * 0.5
: width * 0.7,
child: Text(
"@${post.author.username}", //post.author.name,
style: TextStyle(
fontSize: 17,
color: Theme.of(context)
.colorScheme
.onBackground,
),
overflow:
TextOverflow.ellipsis,
),
),

Expand Down Expand Up @@ -321,22 +328,22 @@ class PostCard extends StatelessWidget {
const SizedBox(height: 6.0),
if (post.gifURL != null)
InkWell(
onDoubleTap: () {
if (!isPreview) {
if (!Provider.of<
PostCardController>(
context,
listen: false)
.liked) {
Provider.of<PostCardController>(
onDoubleTap: () {
if (!isPreview) {
if (!Provider.of<
PostCardController>(
context,
listen: false)
.likePressed();
.liked) {
Provider.of<PostCardController>(
context,
listen: false)
.likePressed();
}
}
}
},
child: GifWidget(url: post.gifURL!)
),
},
child:
GifWidget(url: post.gifURL!)),
if (post.gifURL != null)
const SizedBox(height: 6.0),
if (post.body?.isNotEmpty ??
Expand Down
2 changes: 1 addition & 1 deletion untitled_app/lib/custom_widgets/profile_page_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ProfileHeader extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 15),
padding: const EdgeInsets.only(left: 15, right: 15),
child: Align(
alignment: Alignment.topLeft,
child: Column(
Expand Down
32 changes: 20 additions & 12 deletions untitled_app/lib/custom_widgets/searched_user_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,26 @@ class UserCard extends StatelessWidget {
ProfileAvatar(
url: user.profilePicture, size: width * 0.115),
Padding(
padding: EdgeInsets.all(width * 0.02),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (user.name != "")
Text(user.name,
style: const TextStyle(
fontWeight: FontWeight.bold)),
Text("@${user.username}")
],
),
),
padding: EdgeInsets.all(width * 0.02),
child: SizedBox(
width: width * 0.45,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (user.name != "")
Text(
user.name,
style: const TextStyle(
fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis,
),
Text(
"@${user.username}",
overflow: TextOverflow.ellipsis,
),
],
),
)),
],
),
if (user.uid == locator<CurrentUser>().getUID())
Expand Down
18 changes: 12 additions & 6 deletions untitled_app/lib/custom_widgets/tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,26 @@ class _Button extends StatelessWidget {
child: Container(
width: width * 0.24,
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 4),
decoration: BoxDecoration(
color: isActive
? Theme.of(context).colorScheme.secondary
: Colors.transparent,
borderRadius: BorderRadius.circular(10),
// color: isActive
// ? Theme.of(context).colorScheme.secondary
// : Colors.transparent,
// borderRadius: BorderRadius.circular(10),
border: isActive
? Border(
bottom: BorderSide(
width: 2.0,
color: Theme.of(context).colorScheme.secondary))
: Border(),
),
child: Text(
text,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: isActive
? Theme.of(context).colorScheme.onSecondary
? Theme.of(context).colorScheme.onBackground
: Theme.of(context).colorScheme.onBackground,
fontWeight: isActive ? FontWeight.bold : FontWeight.w600,
),
Expand Down
4 changes: 2 additions & 2 deletions untitled_app/lib/utilities/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ const int maxPostLines = 12;
const int maxPostChars = 300;
const int maxCommentChars = 160;
const int maxTitleChars = 100;
const int maxBioChars = 20;
const int maxBioChars = 100;
const int maxBioLines = 3;
const int maxNameChars = 20;
const int maxNameChars = 24;
const int maxUsernameChars = 24;
const int searchPageDebounce = 1500;
const int postsOnRefresh = 10;
Expand Down
5 changes: 3 additions & 2 deletions untitled_app/lib/views/edit_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class EditProfile extends StatelessWidget {
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.normal,

color: Theme.of(context).colorScheme.onBackground,
),
),
Expand All @@ -78,7 +77,6 @@ class EditProfile extends StatelessWidget {
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.normal,

color:
Theme.of(context).colorScheme.onBackground,
),
Expand Down Expand Up @@ -154,6 +152,7 @@ class EditProfile extends StatelessWidget {
label: AppLocalizations.of(context)!.name,
maxLength: c.maxNameChars,
),
SizedBox(height: height * 0.01),
ProfileInputFeild(
controller: Provider.of<EditProfileController>(context,
listen: false)
Expand All @@ -164,7 +163,9 @@ class EditProfile extends StatelessWidget {
.checkChanges(),
label: AppLocalizations.of(context)!.bioTitle,
maxLength: c.maxBioChars,
inputType: TextInputType.multiline,
),
SizedBox(height: height * 0.01),
ProfileInputFeild(
onChanged: (s) => Provider.of<EditProfileController>(
context,
Expand Down
2 changes: 1 addition & 1 deletion untitled_app/lib/views/feed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FeedPage extends StatelessWidget {
child: Column(
children: [
const Padding(
padding: EdgeInsets.only(bottom: 6), child: CustomTabBar()),
padding: EdgeInsets.only(bottom: 15), child: CustomTabBar()),
Divider(
color: Theme.of(context).colorScheme.outline,
height: c.dividerWidth,
Expand Down
15 changes: 10 additions & 5 deletions untitled_app/lib/views/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ class LoginPage extends StatelessWidget {
.previousPressed(),
),
SizedBox(
height: height * .25,
height: height * .055,
),
SizedBox(
height: height * .25,
width: width * 0.7,
child: Image.asset((Theme.of(context).brightness == Brightness.light)?'images/eko_logo_light.png':'images/eko_logo.png'),
child: Image.asset(
(Theme.of(context).brightness == Brightness.light)
? 'images/eko_logo_light.png'
: 'images/eko_logo.png'),
),
SizedBox(height: height * .1),
SizedBox(height: height * .05),
CustomInputFeild(
focus: Provider.of<LoginController>(context, listen: false)
.emailFocus,
Expand All @@ -63,7 +69,6 @@ class LoginPage extends StatelessWidget {
.emailController,
inputType: TextInputType.emailAddress,
),
SizedBox(height: height * 0.006),
CustomInputFeild(
textInputAction: TextInputAction.go,
onEditingComplete: () =>
Expand All @@ -78,7 +83,7 @@ class LoginPage extends StatelessWidget {
inputType: TextInputType.visiblePassword,
password: true,
),
SizedBox(height: height * 0.05),
SizedBox(height: height * 0.015),
SizedBox(
width: width * 0.9,
height: width * 0.15,
Expand Down
14 changes: 7 additions & 7 deletions untitled_app/lib/views/other_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ class OtherProfile extends StatelessWidget {
Theme.of(context).colorScheme.onBackground,
),
) : null,
actions: [
IconButton(
onPressed: () {},
icon: const Icon(Icons
.more_horiz_outlined), //this could open a floating menu where you could block, or do something to adjust settings with this profile
)
],
// actions: [
// IconButton(
// onPressed: () {},
// icon: const Icon(Icons
// .more_horiz_outlined), //this could open a floating menu where you could block, or do something to adjust settings with this profile
// )
// ],
bottom: PreferredSize(
preferredSize: const Size.fromHeight(3),
child: Divider(
Expand Down
16 changes: 10 additions & 6 deletions untitled_app/lib/views/profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ class _Header extends StatelessWidget {
padding: const EdgeInsets.only(left: 10),
child: Row(
children: [
Text(
"@${profileController.user.username}",
style: TextStyle(
color: Theme.of(context).colorScheme.onBackground,
fontWeight: FontWeight.bold,
fontSize: 22),
SizedBox(
width: width * 0.75,
child: Text(
"@${profileController.user.username}",
style: TextStyle(
color: Theme.of(context).colorScheme.onBackground,
fontWeight: FontWeight.bold,
fontSize: 22),
overflow: TextOverflow.ellipsis,
),
),
const Spacer(),
InkWell(
Expand Down
Loading

0 comments on commit a1a5073

Please sign in to comment.