-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from fanzru/staging
Bump Main
- Loading branch information
Showing
30 changed files
with
1,064 additions
and
742 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
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
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,23 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mobile/screen/_global/components/shimmer/shimmer_container.dart'; | ||
|
||
class ImageNetworkWShimmer extends StatelessWidget { | ||
final String link; | ||
double? width, height; | ||
BoxFit? fit; | ||
ImageNetworkWShimmer( | ||
{Key? key, required this.link, this.width, this.height, this.fit}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Image.network(link, fit: fit, width: width, height: height, | ||
loadingBuilder: (context, child, ImageChunkEvent? loadingProgress) { | ||
if (loadingProgress == null) return child; | ||
return ShimmerContainer( | ||
width: width, | ||
height: height ?? 300, | ||
); | ||
}); | ||
} | ||
} |
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,80 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mobile/model/profile.dart'; | ||
import "dart:math" as math; | ||
|
||
import 'package:mobile/screen/_global/components/image_network.dart'; | ||
|
||
class ProfileCard extends StatelessWidget { | ||
final Profile data; | ||
// final GlobalKey<NavigatorState> navKey; | ||
final int randomForProfile = math.Random().nextInt(1000); | ||
|
||
ProfileCard({Key? key, required this.data}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 10), | ||
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ | ||
Container( | ||
margin: const EdgeInsets.symmetric(vertical: 30), | ||
height: 100, | ||
width: 100, | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(50), | ||
child: ImageNetworkWShimmer( | ||
link: | ||
"https://www.thiswaifudoesnotexist.net/example-$randomForProfile.jpg", | ||
fit: BoxFit.cover, | ||
), | ||
), | ||
), | ||
Text( | ||
data.user.name.toString(), | ||
textAlign: TextAlign.center, | ||
style: const TextStyle( | ||
fontSize: 25, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
Container( | ||
margin: const EdgeInsets.symmetric( | ||
vertical: 20, | ||
horizontal: 15, | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 20, | ||
vertical: 20, | ||
), | ||
child: Column( | ||
// ignore: prefer_const_literals_to_create_immutables | ||
children: [ | ||
const Text("Total Review"), | ||
Text(data.totalReview.toString()), | ||
], | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 20, | ||
vertical: 20, | ||
), | ||
child: Column( | ||
// ignore: prefer_const_literals_to_create_immutables | ||
children: [ | ||
const Text("Rataan Rating"), | ||
Text(data.avgRating.toStringAsFixed(2)), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
]), | ||
); | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
mobile/lib/screen/_global/components/shimmer/profile_shimmer.dart
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,70 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mobile/screen/_global/components/shimmer/shimmer_container.dart'; | ||
|
||
class ShimmerProfile extends StatelessWidget { | ||
const ShimmerProfile({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 10), | ||
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ | ||
Container( | ||
margin: const EdgeInsets.symmetric(vertical: 30), | ||
height: 100, | ||
width: 100, | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(50), | ||
child: const ShimmerContainer( | ||
width: 50, | ||
height: 50, | ||
)), | ||
), | ||
ShimmerContainer( | ||
width: MediaQuery.of(context).size.width * .4, | ||
), | ||
Container( | ||
margin: const EdgeInsets.symmetric( | ||
vertical: 20, | ||
horizontal: 15, | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 20, | ||
vertical: 20, | ||
), | ||
child: Column( | ||
// ignore: prefer_const_literals_to_create_immutables | ||
children: [ | ||
const ShimmerContainer(width: 50), | ||
const SizedBox(height: 5), | ||
ShimmerContainer( | ||
width: MediaQuery.of(context).size.width * .3) | ||
], | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 20, | ||
vertical: 20, | ||
), | ||
child: Column( | ||
// ignore: prefer_const_literals_to_create_immutables | ||
children: [ | ||
const ShimmerContainer(width: 50), | ||
const SizedBox(height: 5), | ||
ShimmerContainer( | ||
width: MediaQuery.of(context).size.width * .3) | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
]), | ||
); | ||
} | ||
} |
Oops, something went wrong.