Technical documentation

This documentation helps users to understand the flow of application.

Product Name: Bytes App
Version: 1.0.0
Phase: Testing
Date: 



Product Overview Eyes

Bytes is currently an android based application, where user can chat with other user, can post image, can like, comment on the post, and search for the post uploaded by user.


Product Objectives Bullseye

  • Sign-in by Google account.
  • Chat one-to-one with other users (send text).
  • Update profile and avatar.
  • Post Image (like, comment)
  • Search for Post


Product Features Puzzle Piece




One Click Login/ Google-Sign IN

One Click Login/ Google-Sign IN
Future signInFunction() async {
GoogleSignInAccount? googleUser = await googleSignIn.signIn();
if (googleUser == null) {
return;
}
final googleAuth = await googleUser.authentication;
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken, idToken: googleAuth.idToken);
UserCredential userCredential =
await FirebaseAuth.instance.signInWithCredential(credential);

DocumentSnapshot userExist =
await firestore.collection('users').doc(userCredential.user!.uid).get();

if (userExist.exists) {
print("User Already Exists in Database");
} else {
try {
await firestore.collection('users').doc(userCredential.user!.uid).set({
'email': userCredential.user!.email,
"username": userCredential.user!.email,
'fullName': userCredential.user!.displayName,
'image': userCredential.user!.photoURL,
'uid': userCredential.user!.uid,
'date': DateTime.now(),
"followers": [],
"followings": [],
"bio": "Enter bio"
});
} on FirebaseException catch (e) {
// TODO
print(e.toString());
}
}

after successful creation of account. we are good to go!

Post Feed

Logged In user can see the post uploaded by the user bytes platform
  • User can Like the post
  • User can Comment on Post
  • Post owner can edit the post
  • Post Owner can delete the post through feed Page
StreamBuilder(
stream: FirebaseFirestore.instance
.collection('posts')
.orderBy('datePublished', descending: true)
.snapshots(),
builder: (context,
AsyncSnapshot<QuerySnapshot<Map<String, dynamic>>> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(
child: CircularProgressIndicator(),
);
} else if (snapshot.connectionState == ConnectionState.active) {
if (snapshot.hasError) {
return Center(
child: Text("Error"),
);
} else if (!snapshot.hasData) {
return Center(
child: Text("No Uploaded Image"),
);
} else {
return ListView.builder(
itemCount: snapshot.data!.docs.length,
itemBuilder: (context, index) =>
PostCard(snap: snapshot.data!.docs[index].data()),
);
}
} else {
return Text('State: ${snapshot.connectionState}');
}
});

Profile Section

In Profile Section
  • User can see the number of posts uploaded
  • User can see Number of Following and followers
  • User can Logout from their account
Snippet of profile section
SafeArea(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(16).copyWith(top: 0),
child: Row(
children: [
Container(
// padding: EdgeInsets.all(10).copyWith(top: 20),
child: CircleAvatar(
backgroundImage: NetworkImage(profileModel.image),
radius: 40,
),
),
Expanded(
child: Column(
children: [
SizedBox(
// width: Constant.width / 2.5,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Padding(padding: EdgeInsets.only(left: 25)),
buildStatColumn('Posts', postLen),
buildStatColumn('followers', followers),
buildStatColumn('following', following),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
child: FirebaseAuth
.instance.currentUser!.uid ==
widget.uid
? FollowButton(
backgroundColor: Colors.transparent,
borderColor: Colors.black,
text: 'Edit Profile',
function: () {
Get.to(() => EditProfileScreen(
snap: profileModel,
));
},
textColor: Colors.black)
: isFollowing
? FollowButton(
backgroundColor:
Colors.transparent,
borderColor: Colors.black,
text: 'unfollow',
textColor: Colors.black)
: FollowButton(
backgroundColor: Colors.blue,
borderColor: Colors.black,
text: 'follow',
textColor: Colors.black),
),
],
),
],
),
),
],
),
),

//full name
Container(
padding: EdgeInsets.symmetric(horizontal: 20),
alignment: Alignment.bottomLeft,
child: Text(
profileModel.fullName,
style: TextStyle(fontWeight: FontWeight.bold),
),
),

//bio
Container(
padding:
EdgeInsets.symmetric(horizontal: 20).copyWith(top: 10),
alignment: Alignment.bottomLeft,
child: Text(
profileModel.bio,
style: TextStyle(fontWeight: FontWeight.bold),
),
),

new Divider(
color: Colors.grey.shade400,
),

//posts or reels

Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
padding: EdgeInsets.symmetric(horizontal: 30),
onPressed: () {},
icon: Icon(
Icons.video_label_outlined,
size: 30,
color: Colors.grey.shade600,
)),
IconButton(
padding: EdgeInsets.symmetric(horizontal: 30),
onPressed: () {},
icon: Icon(Icons.video_library_outlined,
size: 30, color: Colors.grey.shade600)),
],
),

//posts grid

Expanded(
child: FutureBuilder(
future: FirebaseFirestore.instance
.collection('posts')
.where('uid', isEqualTo: widget.uid)
.get(),
builder: (context, snapshot) {
if (snapshot.connectionState ==
ConnectionState.waiting) {
return const Center(
child: CircularProgressIndicator());
} else if (snapshot.connectionState ==
ConnectionState.done) {
if (snapshot.hasError) {
return const Text('Error');
} else if (snapshot.hasData) {
return Padding(
padding: const EdgeInsets.only(
left: 4.0, right: 4.0),
child: GridView.builder(
shrinkWrap: true,
itemCount:
(snapshot.data! as dynamic).docs.length,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 3,
mainAxisSpacing: 3),
itemBuilder: (context, index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(),
borderRadius:
BorderRadius.circular(0),
),
child: Image(
loadingBuilder:
(BuildContext context,
Widget child,
ImageChunkEvent?
loadingProgress) {
if (loadingProgress == null) {
return child;
}
return Center(
child:
CircularProgressIndicator(
value: loadingProgress
.expectedTotalBytes !=
null
? loadingProgress
.cumulativeBytesLoaded /
loadingProgress
.expectedTotalBytes!
: null,
),
);
},
image: NetworkImage(
(snapshot.data! as dynamic)
.docs[index]['postURL']),
fit: BoxFit.cover,
));
}),
);
} else {
return const Text('Empty data');
}
} else {
return SizedBox(
height: Constant.height / 2,
width: Constant.width / 2,
child: const Text("else"));
}
}),
)
],
),
),

Signout snippet

IconButton(
onPressed: () async {
await GoogleSignIn().signOut();
await FirebaseAuth.instance.signOut();
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => SplashScreen()),
(route) => false);
},
icon: Icon(
Icons.logout,
color: Colors.black,
),
),

Edit Profile

Through Profile Editing Section
  • User can update Their name
  • User can update their profile image
  • User can update their bio
Future updateProfile(Uint8List? selectedImage, String name, String username,
String bio) async {
if (_image != null) {
profileController.postImage(
user.username,
user.uid,
_image,
);
}

await firebaseFirestore
.collection('users')
.doc('${Constant.uid}')
.update({"fullName": name, "bio": bio, "username": username});
}


One-to-one chat option

Using our chat service user can communicate to other Bytes Planform users
  • Search friends by their name using search button
  • 
Chat with friend

FAQs Man Raising Hand

Frequently asked questions below.

Is this application available to all platform

Yes, this application is available to all platform soon, but currently available to android only

How to search friends for chat?

In message section, you can find search button in bottom of app,
after clicking search user by their full name (DAKSH JHA).

How many Images can be uploaded at a time?



For now, It only allows 1 images to upload at a time.


Additional Resources Woman Technologist

Technical Support Contact Information Speech Balloon

For technical assistance mail at  imsushantnm@gmail.com 





Make it your own
Once edited to your liking,  save this template to your team’s templates list  by clicking on the three dots on the right of the screen.