post capsule

posts_EKA-DDA
Lucas Delanier 2 years ago
parent de013faa30
commit 60ee9d2700

@ -248,7 +248,7 @@ class _EditablePostComponentState extends State<EditablePostComponent>
)), )),
Container(width: 10), Container(width: 10),
AutoSizeText( AutoSizeText(
"2013", widget.music?.date.toString() ?? "unknown",
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.5), color: Colors.white.withOpacity(0.5),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,

@ -81,81 +81,83 @@ class _PostButtonComponentState extends State<PostButtonComponent>
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.transparent, color: Colors.transparent,
borderRadius: BorderRadius.circular(1000)), borderRadius: BorderRadius.circular(1000)),
child: Stack( child: Align(
children: [ child: Stack(
AnimatedBuilder( children: [
animation: _controller, AnimatedBuilder(
builder: (context, child) { animation: _controller,
return Transform.translate( builder: (context, child) {
offset: Offset( return Transform.translate(
_controller.value * offset: Offset(
(MediaQuery.of(context).size.width - 200), 20 + _controller.value * (240),
0, 0,
),
child: child,
);
},
child: Container(
width: 120,
height: 80,
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Color(0xFF9E78FF).withOpacity(0.0),
Color(0xFFFDFDFF),
Color(0xFFFFFFFF),
Color(0xFF9E78FF).withOpacity(0.0)
], stops: const [
0,
0.4,
0.5,
1
]),
), ),
child: child,
);
},
child: Container(
width: 120,
height: 80,
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Color(0xFF9E78FF).withOpacity(0.0),
Color(0xFFFDFDFF),
Color(0xFFFFFFFF),
Color(0xFF9E78FF).withOpacity(0.0)
], stops: const [
0,
0.4,
0.5,
1
]),
), ),
), ),
), BackdropFilter(
BackdropFilter( filter: ImageFilter.blur(
filter: ImageFilter.blur( sigmaX: 10.0,
sigmaX: 10.0, sigmaY: 10.0,
sigmaY: 10.0, ),
), child: Opacity(
child: Opacity( opacity: 0.9,
opacity: 0.9, child: Container(
child: Container( constraints: BoxConstraints(maxWidth: 400),
constraints: BoxConstraints(maxWidth: 400), decoration: BoxDecoration(
decoration: BoxDecoration( gradient: LinearGradient(colors: [
gradient: LinearGradient(colors: [ Color(0xFF633AF4),
Color(0xFF633AF4), Color(0xFF9367FF),
Color(0xFF9367FF), Color(0xFF633AF4)
Color(0xFF633AF4) ]),
]), border:
border: Border.all(width: 5, color: Color(0xFF1C1C1C)), Border.all(width: 5, color: Color(0xFF1C1C1C)),
borderRadius: BorderRadius.circular(10000)), borderRadius: BorderRadius.circular(10000)),
padding: EdgeInsets.symmetric(vertical: 25), padding: EdgeInsets.symmetric(vertical: 25),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 100), padding: EdgeInsets.only(left: 100),
child: Text( child: Text(
"Publier la capsule", "Publier la capsule",
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
fontSize: 22), fontSize: 22),
),
), ),
), ),
)),
ClipOval(
child: Padding(
padding: const EdgeInsets.only(left: 5, top: 5),
child: Image(
image: AssetImage("assets/images/rocket_button.png"),
height: 65,
), ),
)),
ClipOval(
child: Padding(
padding: const EdgeInsets.only(left: 5, top: 5),
child: Image(
image: AssetImage("assets/images/rocket_button.png"),
height: 65,
), ),
), )
) ],
], ),
), ),
), ),
); );

@ -94,10 +94,8 @@ class _PostScreenState extends State<PostScreen>
} }
handleSubmit() async { handleSubmit() async {
print("ccccccccccccc");
await MyApp.postViewModel.addPost( await MyApp.postViewModel.addPost(
description, (selectedMusic?.id)!, selectedImage, selectedCity); description, (selectedMusic?.id)!, selectedImage, selectedCity);
print("ccccccccccccc");
quit(); quit();
} }

@ -19,16 +19,12 @@ class PostService {
}; };
var postAdd = await MyApp.db.collection("posts").add(post); var postAdd = await MyApp.db.collection("posts").add(post);
print("cc");
if (image != null) { if (image != null) {
print("cc3");
var imageRef = FirebaseStorage.instance.ref('$id${postAdd.id}.jpg'); var imageRef = FirebaseStorage.instance.ref('$id${postAdd.id}.jpg');
await imageRef.putFile(image); await imageRef.putFile(image);
var imageUrl = await imageRef.getDownloadURL(); var imageUrl = await imageRef.getDownloadURL();
print(imageUrl);
postAdd.update({"selfie": imageUrl}); postAdd.update({"selfie": imageUrl});
} }
print("cc2");
} }
deletePost() {} deletePost() {}

Loading…
Cancel
Save