Skip to content

Commit

Permalink
Merge pull request #103 from roohaani786/version1.6.8
Browse files Browse the repository at this point in the history
Version1.6.8
  • Loading branch information
roohaani786 authored Jan 16, 2021
2 parents 1a0fee3 + a5284c9 commit 6000e7d
Show file tree
Hide file tree
Showing 24 changed files with 1,200 additions and 626 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (flutterRoot == null) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '18'
flutterVersionCode = '20'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
FlutterApplication and put your custom class here. -->

<application
android:requestLegacyExternalStorage="true"
android:name="io.flutter.app.FlutterApplication"
android:label="Yammerly"
android:icon="@mipmap/ic_launcher">
Expand Down Expand Up @@ -78,5 +79,8 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.R EAD_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.permission.GALLERY" />

</manifest>
2 changes: 1 addition & 1 deletion android/key.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
storePassword=46224622
keyPassword=46224622
keyAlias=key
storeFile=home/aman/key.jks
storeFile=key.jks
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
}
93 changes: 48 additions & 45 deletions lib/ComeraV/cam.dart
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
import 'package:flutter/material.dart';
import 'package:techstagram/ComeraV/camera_screen.dart';

const Color barColor = const Color(0x20000000);


class CameraS extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Camera',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
//brightness: Brightness.dark,
backgroundColor: Colors.black,
bottomAppBarColor: barColor,
),
home: CameraClass(),
);
}
}

class CameraClass extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}



class _HomePageState extends State<CameraClass> {
final _cameraKey = GlobalKey<CameraScreenState>();

@override
Widget build(BuildContext context) {
return Scaffold(
extendBody: true,
backgroundColor: Theme.of(context).backgroundColor,
body: CameraScreen(
cam: 0,
key: _cameraKey,
),
);
}
}
// import 'package:flutter/material.dart';
// import 'package:techstagram/ComeraV/camera_screen.dart';
//
// const Color barColor = const Color(0x20000000);
//
//
// class CameraS extends StatelessWidget {
// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// title: 'Camera',
// debugShowCheckedModeBanner: false,
// theme: ThemeData(
// primarySwatch: Colors.blue,
// //brightness: Brightness.dark,
// backgroundColor: Colors.black,
// bottomAppBarColor: barColor,
// ),
// home: CameraClass(),
// );
// }
// }
//
// class CameraClass extends StatefulWidget {
// @override
// _HomePageState createState() => _HomePageState();
// }
//
//
//
// class _HomePageState extends State<CameraClass> {
// final _cameraKey = GlobalKey<CameraScreenState>();
//
// @override
// Widget build(BuildContext context) {
// return WillPopScope(
// onWillPop: () async => false,
// child: Scaffold(
// extendBody: true,
// backgroundColor: Theme.of(context).backgroundColor,
// body: CameraScreen(
// cam: 0,
// key: _cameraKey,
// ),
// ),
// );
// }
// }
111 changes: 60 additions & 51 deletions lib/ComeraV/camera_screen.dart
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
import 'dart:io';

import 'package:camera/camera.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:techstagram/ComeraV/cam.dart';
import 'package:uuid/uuid.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:image/image.dart' as ImD;
import 'package:image_picker/image_picker.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:techstagram/ComeraV/gallery.dart';
import 'package:techstagram/ComeraV/video_timer.dart';
import 'package:techstagram/main.dart';
import 'package:techstagram/resources/auth.dart';
import 'package:techstagram/resources/uploadimage.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:techstagram/ui/HomePage.dart';
import 'package:image/image.dart' as ImD;
import 'package:techstagram/yammerly_gallery/gallery.dart';
import 'package:uuid/uuid.dart';

class CameraScreen extends StatefulWidget {
final int cam;
final bool check;

const CameraScreen({Key key,this.cam}) : super(key: key);
const CameraScreen({Key key,this.cam,this.check}) : super(key: key);

@override
CameraScreenState createState() => CameraScreenState(cam: cam);
CameraScreenState createState() => CameraScreenState(cam: cam,check: check);
}

class CameraScreenState extends State<CameraScreen>
with AutomaticKeepAliveClientMixin {

CameraScreenState({this.cam});
CameraScreenState({this.cam,this.check});
CameraController _controller;
List<CameraDescription> _cameras;
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
Expand All @@ -40,6 +43,7 @@ class CameraScreenState extends State<CameraScreen>
Map<String, dynamic> _profile;
bool _loading = false;
int cam;
bool check = false;



Expand Down Expand Up @@ -302,14 +306,15 @@ class CameraScreenState extends State<CameraScreen>
);
}
Future<bool> _onWillPop() {
return Navigator.push(
context,
MaterialPageRoute(
builder: (context) {
return HomePage(initialindexg: 1);
},
),
);
Navigator.pop(context);
// return Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) {
// return HomePage(initialindexg: 1);
// },
// ),
// );
}

if (!_controller.value.isInitialized) {
Expand Down Expand Up @@ -357,8 +362,28 @@ class CameraScreenState extends State<CameraScreen>
// MaterialPageRoute(builder: (context) => HomePage()),);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => HomePage()),
MaterialPageRoute(builder: (context) => MyApp()),
);
//Navigator.pushNamed(context, '/HomePage');
//Navigator.of(context, rootNavigator: true).pop(context);
//Navigator.of(context).maybePop();
// if(check == true){
// Navigator.pop(context);
// }else{
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// backgroundColor: Colors.white,
// title: Text("Note"),
// content: Text(
// "Please left swipe for back",
// style: TextStyle(
// color: Colors.deepPurple
// )),
// );
// });
// }
},
),
),
Expand Down Expand Up @@ -453,23 +478,17 @@ class CameraScreenState extends State<CameraScreen>
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => pickImage(),));
pickImage();
if (upload == true){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => UploadImage(file: _image),));
}else{
Navigator.push(
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CameraS(),));
}
MaterialPageRoute(builder: (context) => gallery()),
);
}

),

FlatButton(
color: Colors.transparent,
onPressed: () async => null,
onPressed: () async => null,
child: CircleAvatar(
backgroundColor: Colors.white,
radius: 28.0,
Expand All @@ -483,17 +502,19 @@ class CameraScreenState extends State<CameraScreen>
color: (_isRecording) ? Colors.red : Colors.black,
),
onPressed: () {
print("$_isRecordingMode");

if (!_isRecordingMode) {
print("alam");
print(cam);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Gallery(filePath: currentCityController.text,cam:cam),
),
);
// print("alam");
// print(cam);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Gallery(filePath: currentCityController.text,cam:cam),
// ),
// );
_captureImage();
if(flashOn){
if (flashOn) {
print("dhjfh");
}
} else {
Expand Down Expand Up @@ -530,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 All @@ -560,7 +568,7 @@ class CameraScreenState extends State<CameraScreen>
// String thumb = await Thumbnails.getThumbnail(
// videoFile: lastFile.path, imageType: ThumbFormat.PNG, quality: 100);
// return File(thumb);
print("dfdf");
print("dfdf");
}
}

Expand Down Expand Up @@ -602,6 +610,8 @@ class CameraScreenState extends State<CameraScreen>

void _captureImage() async {
print('_captureImage');
print('${_controller.value.isInitialized}');

if (_controller.value.isInitialized) {
SystemSound.play(SystemSoundType.click);
final Directory extDir = await getApplicationDocumentsDirectory();
Expand All @@ -616,7 +626,6 @@ class CameraScreenState extends State<CameraScreen>
MaterialPageRoute(
builder: (context) => Gallery(filePath: filePath,cam: cam,)),
);

}
}

Expand Down
Loading

0 comments on commit 6000e7d

Please sign in to comment.