Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
shadaab88 committed Jan 16, 2021
1 parent ffa072b commit 7b38c17
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 56 deletions.
30 changes: 4 additions & 26 deletions lib/ComeraV/camera_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:techstagram/main.dart';
import 'package:techstagram/resources/auth.dart';
import 'package:techstagram/resources/uploadimage.dart';
import 'package:techstagram/ui/HomePage.dart';
import 'package:techstagram/yammerly_gallery/gallery.dart';
import 'package:uuid/uuid.dart';

class CameraScreen extends StatefulWidget {
Expand Down Expand Up @@ -477,20 +478,10 @@ class CameraScreenState extends State<CameraScreen>
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => pickImage(),));
pickImage();
if (upload == true){
Navigator.push(
Navigator.push(
context,
MaterialPageRoute(builder: (context) => UploadImage(file: _image),));
}else{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CameraScreen(
cam: 0,
),
));
}
MaterialPageRoute(builder: (context) => gallery()),
);
}

),
Expand Down Expand Up @@ -560,19 +551,6 @@ class CameraScreenState extends State<CameraScreen>
);
}

// Future _turnFlash() async {
// bool hasTorch = await Torch.hasTorch;
// if(hasTorch){
// (flashOn || cam!=null) ? Torch.turnOn() : Torch.turnOff();
// var f = await Torch.hasTorch;
// Torch.flash(Duration(milliseconds: 300));
// setState((){
// _hasFlash = f;
// //flashOn = !flashOn;
// });
// }
// }

Future<FileSystemEntity> getLastImage() async {
final Directory extDir = await getApplicationDocumentsDirectory();
final String dirPath = '${extDir.path}/media';
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/Otheruser/other_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ class _OtherUserProfileState extends State<OtherUserProfile> {
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => postPage(PostUrl: url)),
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: displayName,PostUrl: url,uidX: uid,delete: false,)),
);
},
child: ClipRRect(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/ProfilePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ class _AccountBottomIconScreenState extends State<AccountBottomIconScreen> {
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: displayName,PostUrl: url,uidX: uid)),
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: displayName,PostUrl: url,uidX: uid,delete: true,)),
);
},
child: ClipRRect(
Expand Down
34 changes: 8 additions & 26 deletions lib/ui/post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ class postPage extends StatefulWidget {
final String PostUrl;
final String displayNamecurrentUser;
final String uidX;
final bool delete;

postPage(
{this.PostUrl,
this.displayNamecurrentUser,
this.uidX
this.uidX,
this.delete,
});

@override
_postPageState createState() => _postPageState(displayNamecurrentUser: displayNamecurrentUser,PostUrl: PostUrl,uidX: uidX);
_postPageState createState() => _postPageState(displayNamecurrentUser: displayNamecurrentUser,PostUrl: PostUrl,uidX: uidX,delete: delete);
}

class _postPageState extends State<postPage> {
Expand All @@ -46,8 +48,9 @@ class _postPageState extends State<postPage> {
final String displayNamecurrentUser;
final String PostUrl;
final String uidX;
final bool delete;

_postPageState({this.displayNamecurrentUser,this.PostUrl,this.uidX});
_postPageState({this.displayNamecurrentUser,this.PostUrl,this.uidX,this.delete});
String loadingMessage = "Loading Profile Data";
TextEditingController emailController,urlController,descriptionController,
displayNameController,photoUrlController,
Expand Down Expand Up @@ -159,27 +162,6 @@ class _postPageState extends State<postPage> {



// void _onHorizontalDrag(DragEndDetails details) {
// if (details.primaryVelocity == 0)
// // user have just tapped on screen (no dragging)
// return ;
//
// if (details.primaryVelocity.compareTo(0) == -1) {
//// dispose();
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => HomePage(initialindexg: 3)),
// );
// }
// else {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => HomePage(initialindexg: 1)),
// );
// }
// }


getlikes( String displayNamecurrent, String postId, int index) async {

await Firestore.instance.collection('posts')
Expand Down Expand Up @@ -507,7 +489,7 @@ class _postPageState extends State<postPage> {
],
),

IconButton(
(delete != true)?Container():IconButton(
icon: Icon(Icons.delete),
onPressed: () {
(displayName == displayNamecurrentUser)?showDialog(
Expand Down Expand Up @@ -938,7 +920,7 @@ class _postPageState extends State<postPage> {
),),
],
),
IconButton(
(delete != true)?Container():IconButton(
icon: Icon(Icons.delete),
onPressed: () {
(displayName == displayNamecurrentUser)?showDialog(
Expand Down
5 changes: 3 additions & 2 deletions lib/views/tabs/feeds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ class _FeedsPageState extends State<FeedsPage> {
child: GestureDetector(
onTap: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: OwnerDisplayName,PostUrl: url,uidX: OwnerUid)),
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: OwnerDisplayName,PostUrl: url,uidX: OwnerUid,delete: false)),
// MaterialPageRoute(builder: (context) => postPage(PostUrl: url,)),
),
child: Container(
width: deviceWidth*0.95,
Expand Down Expand Up @@ -636,7 +637,7 @@ class _FeedsPageState extends State<FeedsPage> {
child: GestureDetector(
onTap: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: OwnerDisplayName,PostUrl: url,uidX: OwnerUid)),
MaterialPageRoute(builder: (context) => postPage(displayNamecurrentUser: OwnerDisplayName,PostUrl: url,uidX: OwnerUid,delete:false)),
),
child: Container(
//height: 450.0,
Expand Down

0 comments on commit 7b38c17

Please sign in to comment.