add switch on post

WORK-LDE
Lucas Delanier 2 years ago
parent abd5313870
commit 3403373224

@ -0,0 +1,34 @@
import 'package:flutter/Material.dart';
import '../values/constants.dart';
class BackButtonComponent extends StatefulWidget {
const BackButtonComponent({Key? key}) : super(key: key);
@override
State<BackButtonComponent> createState() => _BackButtonComponentState();
}
class _BackButtonComponentState extends State<BackButtonComponent> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: ClipOval(
child: Container(
height: 40,
width: 40,
color: Colors.white,
child: Center(
child: Icon(
Icons.arrow_back_outlined,
color: bgColor,
),
),
),
),
);
}
}

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:justmusic/screens/post_screen.dart';
import 'package:justmusic/screens/feed_screen.dart';
import 'package:justmusic/view_model/UserViewModel.dart';
void main() {
@ -34,7 +34,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
),
home: const SafeArea(
child: PostScreen(),
child: FeedScreen(),
));
},
designSize: Size(390, 844),

@ -2,6 +2,7 @@ import 'package:circular_reveal_animation/circular_reveal_animation.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import '../components/comment_component.dart';
import '../components/post_component.dart';
import '../components/top_nav_bar_component.dart';
@ -83,10 +84,7 @@ class _FeedScreenState extends State<FeedScreen>
builder: ((context) {
return Container(
height: 720.h,
margin: const EdgeInsets.only(
top: defaultPadding,
left: defaultPadding,
right: defaultPadding),
margin: const EdgeInsets.only(top: 10),
child: Column(
children: [
Align(
@ -98,22 +96,42 @@ class _FeedScreenState extends State<FeedScreen>
borderRadius: BorderRadius.circular(20))),
),
const SizedBox(
height: 10,
height: 20,
),
Expanded(
child: ClipRRect(
borderRadius: BorderRadius.only(
topRight: Radius.circular(15),
topLeft: Radius.circular(15)),
child: Padding(
padding: EdgeInsets.only(
left: defaultPadding, right: defaultPadding),
child: SingleChildScrollView(
child: Wrap(
// to apply margin in the main axis of the wrap
runSpacing: 10,
children: [
const PostComponent(
PostComponent(
callback: null,
),
Container(height: 40),
Container(height: 10),
Align(
child: RichText(
text: TextSpan(
text: "3",
style: GoogleFonts.plusJakartaSans(
color: Colors.white,
fontWeight: FontWeight.w600),
children: [
TextSpan(
text: " commentaires",
style: GoogleFonts.plusJakartaSans(
color: Colors.white,
fontWeight: FontWeight.w300),
)
])),
),
SizedBox(height: 20),
CommentComponent(),
CommentComponent(),
CommentComponent(),
@ -123,8 +141,17 @@ class _FeedScreenState extends State<FeedScreen>
),
),
),
),
Container(
padding: EdgeInsets.only(top: 300),
height: 70,
width: double.infinity,
color: Colors.grey,
child: TextField(),
),
],
));
),
);
}),
);
}

@ -1,12 +1,10 @@
import 'dart:ui';
import 'package:flutter/Material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:justmusic/components/back_button.dart';
import 'package:justmusic/screens/search_song_screen.dart';
import '../components/editable_post_component.dart';
import '../components/post_button_component.dart';
import '../components/search_bar_component.dart';
import '../values/constants.dart';
class PostScreen extends StatefulWidget {
@ -66,6 +64,21 @@ class _PostScreenState extends State<PostScreen>
return Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: bgColor,
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size(double.infinity, 80),
child: SafeArea(
child: Padding(
padding: const EdgeInsets.only(
left: defaultPadding,
right: defaultPadding,
top: defaultPadding),
child: Row(
children: [BackButtonComponent()],
),
),
),
),
body: Container(
padding:
const EdgeInsets.only(left: defaultPadding, right: defaultPadding),
@ -88,9 +101,12 @@ class _PostScreenState extends State<PostScreen>
mainAxisAlignment: MainAxisAlignment.end,
children: [
SizedBox(
height: 150.h,
height: 100.h,
),
GestureDetector(
onTap: openDetailPost,
child: EditablePostComponent(),
),
EditablePostComponent(),
SizedBox(
height: 40.h,
),
@ -102,12 +118,6 @@ class _PostScreenState extends State<PostScreen>
),
),
),
Padding(
padding: EdgeInsets.only(top: defaultPadding),
child: SearchBarComponent(
callback: openDetailPost,
),
),
],
),
),

@ -34,8 +34,8 @@ class _SearchSongScreenState extends State<SearchSongScreen> {
},
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 25.0,
sigmaY: 25.0,
sigmaX: 60.0,
sigmaY: 60.0,
),
child: Container(
color: bgAppBar.withOpacity(0.5),
@ -49,7 +49,7 @@ class _SearchSongScreenState extends State<SearchSongScreen> {
width: 60,
height: 5,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.3),
color: Color(0xFF3A3A3A).withOpacity(0.6),
borderRadius: BorderRadius.circular(20))),
),
const SizedBox(

@ -406,6 +406,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
top_snackbar_flutter:
dependency: "direct main"
description:
name: top_snackbar_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
typed_data:
dependency: transitive
description:

@ -52,6 +52,7 @@ dependencies:
flutter_animated_play_button: ^0.3.0
audioplayers: ^4.1.0
ionicons: ^0.2.2
top_snackbar_flutter: ^3.1.0
dev_dependencies:
flutter_test:

Loading…
Cancel
Save