-
Notifications
You must be signed in to change notification settings - Fork 0
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 #69 from roohaani786/CLEANCODE2
Cleancode2
- Loading branch information
Showing
116 changed files
with
1,000 additions
and
5,211 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
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,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() | ||
// ], | ||
// ) | ||
); | ||
} | ||
} |
Oops, something went wrong.