Skip to content

Commit

Permalink
Merge pull request #69 from roohaani786/CLEANCODE2
Browse files Browse the repository at this point in the history
Cleancode2
  • Loading branch information
roohaani786 authored Nov 26, 2020
2 parents 7773a12 + fda1924 commit d57281d
Show file tree
Hide file tree
Showing 116 changed files with 1,000 additions and 5,211 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if (flutterRoot == null) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = '2'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = '1.1.0'
}

apply plugin: 'com.android.application'
Expand Down
Binary file removed assets/blankimage.png
Binary file not shown.
Binary file removed assets/cod.png
Binary file not shown.
Binary file removed assets/flash.png
Binary file not shown.
Binary file removed assets/flashapp.png
Binary file not shown.
Binary file removed assets/flashu.png
Binary file not shown.
Binary file removed assets/google-logo.png
Binary file not shown.
Binary file removed assets/images/follower2.jpg
Binary file not shown.
Binary file removed assets/images/follower3.jpeg
Binary file not shown.
Binary file removed assets/images/home_page.png
Binary file not shown.
Binary file modified assets/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/logo.png
Binary file not shown.
Binary file removed assets/images/man1.jpg
Binary file not shown.
Binary file removed assets/images/man2.jpg
Binary file not shown.
Binary file removed assets/images/man3.jpg
Binary file not shown.
Binary file removed assets/images/man4.jpg
Binary file not shown.
Binary file removed assets/images/man5.jpg
Binary file not shown.
Binary file removed assets/images/p.jpg
Binary file not shown.
Binary file removed assets/images/profile3.png
Binary file not shown.
Binary file removed assets/images/profile4.png
Binary file not shown.
Binary file removed assets/images/profile6.jpg
Binary file not shown.
Binary file removed assets/images/social.jpg
Binary file not shown.
Binary file removed assets/images/their_profile.jpeg
Binary file not shown.
Binary file removed assets/images/woman1.jpg
Binary file not shown.
Binary file removed assets/images/woman2.jpg
Binary file not shown.
Binary file removed assets/images/woman3.jpg
Binary file not shown.
Binary file removed assets/images/woman4.jpg
Diff not rendered.
Binary file removed assets/images/woman5.jpg
Diff not rendered.
Binary file removed assets/insta_logo.png
Diff not rendered.
Binary file removed assets/intu
Binary file not shown.
Binary file removed assets/pmmodi1.jpg
Diff not rendered.
Binary file removed assets/pmmodi2.jpg
Diff not rendered.
Binary file removed assets/pmmodi3.jpg
Diff not rendered.
Binary file removed assets/sd.png
Diff not rendered.
Binary file removed assets/sj.png
Diff not rendered.
21 changes: 8 additions & 13 deletions lib/Changepassword/components/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ import 'package:responsive_layout_builder/responsive_layout_builder.dart';
import 'package:rxdart/rxdart.dart';
import 'package:techstagram/Login/components/background.dart';
import 'package:techstagram/Login/login_screen.dart';
import 'package:techstagram/Signup/components/or_divider.dart';
import 'package:techstagram/Signup/components/social_icon.dart';
import 'package:techstagram/Signup/signup_screen.dart';
import 'package:techstagram/components/already_have_an_account_acheck.dart';
import 'package:techstagram/components/rounded_button.dart';
import 'package:techstagram/resources/auth.dart';
import 'package:techstagram/ui/HomePage.dart';
import '../../constants.dart';
import '../../forgotpassword.dart';

Expand Down Expand Up @@ -113,10 +108,11 @@ class _BodyState extends State<Body> {
}

String emailValidator(String value) {

Pattern pattern =
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regex = new RegExp(pattern);
// var hu = value;

if (!regex.hasMatch(value) && value.length == null) {
setState(() {
errordikhaoL = true;
Expand Down Expand Up @@ -318,10 +314,9 @@ class _BodyState extends State<Body> {

@override
Widget build(BuildContext context) {

bool loginfail = false;
Size size = MediaQuery
.of(context)
.size;

return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
Expand Down Expand Up @@ -480,7 +475,7 @@ class _BodyState extends State<Body> {
focusNode: _pwd,
onFieldSubmitted: (value) {
_pwd.unfocus();
RoundedButton;
RoundedButtonX();
},
style: TextStyle(
fontSize: 12.0,
Expand Down Expand Up @@ -555,7 +550,7 @@ class _BodyState extends State<Body> {
focusNode: _apwd,
onFieldSubmitted: (value) {
_apwd.unfocus();
RoundedButton;
RoundedButtonX();
},
style: TextStyle(
fontSize: 12.0,
Expand Down Expand Up @@ -630,7 +625,7 @@ class _BodyState extends State<Body> {
focusNode: _cpwd,
onFieldSubmitted: (value) {
_cpwd.unfocus();
RoundedButton;
RoundedButtonX();
},
style: TextStyle(
fontSize: 12.0,
Expand All @@ -643,7 +638,7 @@ class _BodyState extends State<Body> {
),
Padding(
padding: const EdgeInsets.only(top: 15.0),
child: RoundedButton(
child: RoundedButtonX(
text: "Change Password",
press: () {
if(newpwdInputController.text == CnewpwdInputController.text){
Expand Down
19 changes: 3 additions & 16 deletions lib/ComeraV/camera_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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:fluro/fluro.dart';
import 'package:techstagram/ComeraV/cam.dart';
import 'package:torch_compat/torch_compat.dart';
import 'package:uuid/uuid.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand All @@ -15,18 +13,10 @@ import 'package:techstagram/ComeraV/gallery.dart';
import 'package:techstagram/ComeraV/video_timer.dart';
import 'package:techstagram/resources/auth.dart';
import 'package:techstagram/resources/uploadimage.dart';
import 'dart:io';
//import 'package:torch_compat/torch_compat.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:techstagram/ui/HomePage.dart';
//import 'package:thumbnails/thumbnails.dart';
//import 'package:lamp/lamp.dart';
//import 'package:torch/torch.dart';
import 'package:image/image.dart' as ImD;
//import 'package:holding_gesture/holding_gesture.dart';

import 'application.dart';

class CameraScreen extends StatefulWidget {
final int cam;
Expand All @@ -46,9 +36,7 @@ class CameraScreenState extends State<CameraScreen>
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
bool _isRecordingMode = false;
bool _isRecording = false;
// bool _isButtonPressed = false;
final _timerKey = GlobalKey<VideoTimerState>();
bool _hasFlash = false;
Map<String, dynamic> _profile;
bool _loading = false;
int cam;
Expand Down Expand Up @@ -298,8 +286,6 @@ class CameraScreenState extends State<CameraScreen>

@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;

super.build(context);
if (_controller != null) {
Expand Down Expand Up @@ -483,7 +469,7 @@ class CameraScreenState extends State<CameraScreen>

FlatButton(
color: Colors.transparent,
// onPressed: () async => await Lamp.flash(new Duration(seconds: 2)),
onPressed: () async => null,
child: CircleAvatar(
backgroundColor: Colors.white,
radius: 28.0,
Expand Down Expand Up @@ -588,7 +574,8 @@ class CameraScreenState extends State<CameraScreen>
setState(() {
cam = 0;
});
};
}

final CameraDescription cameraDescription = _cameras[cam];
//(_controller.description == _cameras[0]) ? _cameras[1] : _cameras[0];
if (_controller != null) {
Expand Down
123 changes: 123 additions & 0 deletions lib/ComeraV/cropper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_cropper/image_cropper.dart';
import 'package:image_picker/image_picker.dart';

//void main() => runApp(MyApp());


class CropperPage extends StatefulWidget {

File file;
int cam;
CropperPage({this.file,this.cam});
@override
_CropperPageState createState() => _CropperPageState(file: file,cam: cam);
}

class _CropperPageState extends State<CropperPage> {
File file;
bool _inProcess = false;
int cam;
File selectedFile;

_CropperPageState({this.file,this.cam});

// Widget getImageWidget() {
// if (_selectedFile != null) {
// return Image.file(
// _selectedFile,
// width: 250,
// height: 250,
// fit: BoxFit.cover,
// );
// } else {
// return Image.asset(
// "assets/placeholder.jpg",
// width: 250,
// height: 250,
// fit: BoxFit.cover,
// );
// }
// }

getImage() async {
this.setState((){
_inProcess = true;
});
//File image = await ImagePicker.pickImage(source: source);
if(file != null){
File cropped = await ImageCropper.cropImage(
sourcePath: file.path,
aspectRatio: CropAspectRatio(
ratioX: 1, ratioY: 1),
compressQuality: 100,
maxWidth: 700,
maxHeight: 700,
compressFormat: ImageCompressFormat.jpg,
androidUiSettings: AndroidUiSettings(
toolbarColor: Colors.deepOrange,
toolbarTitle: "RPS Cropper",
statusBarColor: Colors.deepOrange.shade900,
backgroundColor: Colors.white,
)
);

this.setState((){
selectedFile = cropped;
_inProcess = false;
});
} else {
this.setState((){
_inProcess = false;
});
}
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: getImage(),
// body: Stack(
// children: <Widget>[
// Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// getImageWidget(),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: <Widget>[
// MaterialButton(
// color: Colors.green,
// child: Text(
// "Camera",
// style: TextStyle(color: Colors.white),
// ),
// onPressed: () {
// getImage(ImageSource.camera);
// }),
// MaterialButton(
// color: Colors.deepOrange,
// child: Text(
// "Device",
// style: TextStyle(color: Colors.white),
// ),
// onPressed: () {
// getImage(ImageSource.gallery);
// })
// ],
// )
// ],
// ),
// (_inProcess)?Container(
// color: Colors.white,
// height: MediaQuery.of(context).size.height * 0.95,
// child: Center(
// child: CircularProgressIndicator(),
// ),
// ):Center()
// ],
// )
);
}
}
Loading

0 comments on commit d57281d

Please sign in to comment.