-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d65c5c
commit a830cbb
Showing
10 changed files
with
950 additions
and
1 deletion.
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
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,83 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:cosanostr/all_imports.dart'; | ||
|
||
class CardPicture extends StatelessWidget { | ||
CardPicture({super.key, this.onTap, this.imagePath}); | ||
|
||
final Function()? onTap; | ||
final String? imagePath; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final Size size = MediaQuery.of(context).size; | ||
|
||
if (imagePath != null) { | ||
return Card( | ||
child: Container( | ||
height: 300, | ||
padding: const EdgeInsets.all(10.0), | ||
width: size.width * .70, | ||
decoration: BoxDecoration( | ||
borderRadius: const BorderRadius.all(Radius.circular(4.0)), | ||
image: DecorationImage( | ||
fit: BoxFit.cover, | ||
image: FileImage( | ||
File(imagePath!), | ||
), | ||
), | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.end, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
DecoratedBox( | ||
decoration: const BoxDecoration( | ||
shape: BoxShape.circle, | ||
color: Colors.redAccent, | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Colors.black, | ||
offset: Offset(3.0, 3.0), | ||
blurRadius: 2.0, | ||
) | ||
]), | ||
child: IconButton( | ||
onPressed: () { | ||
print('icon press'); | ||
}, | ||
icon: const Icon(Icons.delete, color: Colors.white), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
|
||
return Card( | ||
elevation: 3, | ||
child: InkWell( | ||
onTap: onTap, | ||
child: Container( | ||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 25), | ||
width: size.width * .70, | ||
height: 100, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
'Attach Picture', | ||
style: TextStyle(fontSize: 17.0, color: Colors.grey[600]), | ||
), | ||
Icon( | ||
Icons.photo_camera, | ||
color: Colors.indigo[400], | ||
) | ||
], | ||
), | ||
), | ||
)); | ||
} | ||
} |
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
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
Oops, something went wrong.