change text artist and title
continuous-integration/drone/push Build is passing Details

MANAGE_COMMENTS_LDE
Lucas Delanier 2 years ago
parent 929f090464
commit 67b4dd0f58

@ -814,6 +814,13 @@
</list>
</value>
</entry>
<entry key="timezone">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/timezone-0.9.2/lib" />
</list>
</value>
</entry>
<entry key="top_snackbar_flutter">
<value>
<list>
@ -1013,6 +1020,7 @@
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/term_glyph-1.2.1/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/test_api-0.5.1/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/text_scroll-0.2.0/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/timezone-0.9.2/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/top_snackbar_flutter-3.1.0/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/tuple-2.0.2/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/typed_data-1.3.2/lib" />

@ -17,11 +17,12 @@ class CommentComponent extends StatelessWidget {
return Container(
width: double.infinity,
decoration: BoxDecoration(color: bgComment, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.all(20),
margin: EdgeInsets.only(bottom: 20),
decoration: BoxDecoration(color: bgComment.withOpacity(0.6), borderRadius: BorderRadius.circular(15)),
padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
margin: EdgeInsets.only(bottom: 13),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
ClipOval(
child: SizedBox.fromSize(
@ -50,7 +51,7 @@ class CommentComponent extends StatelessWidget {
Padding(
padding: EdgeInsets.only(top: 6, left: 10),
child: Text(
"il y a ${difference.inHours}h",
"il y a ${difference.inHours > 0 ? difference.inHours : difference.inMinutes}${difference.inHours > 0 ? "h" : "m"}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.6), fontWeight: FontWeight.w400, fontSize: 10),
),
@ -58,13 +59,13 @@ class CommentComponent extends StatelessWidget {
],
),
SizedBox(
height: 8,
height: 4,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
comment.text,
style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w400, fontSize: 12),
style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15),
),
),
],

@ -10,21 +10,23 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:justmusic/screens/add_friend_screen.dart';
import 'package:justmusic/screens/explanations_screen.dart';
import 'package:justmusic/screens/feed_screen.dart';
import 'package:justmusic/screens/loading_screen.dart';
import 'package:justmusic/screens/login_screen.dart';
import 'package:justmusic/screens/launching_rocker_screen.dart';
import 'package:justmusic/screens/post_screen.dart';
import 'package:justmusic/screens/profile_screen.dart';
import 'package:justmusic/screens/registration_screen.dart';
import 'package:justmusic/screens/welcome_screen.dart';
import 'package:justmusic/values/constants.dart';
import 'package:justmusic/view_model/CommentViewModel.dart';
import 'package:justmusic/view_model/MusicViewModel.dart';
import 'package:justmusic/view_model/PostViewModel.dart';
import 'package:justmusic/view_model/UserViewModel.dart';
import 'package:justmusic/model/User.dart' as userJustMusic;
import 'firebase_options.dart';
import 'package:timezone/data/latest.dart' as tz;
Future<void> main() async {
tz.initializeTimeZones();
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
@ -99,25 +101,21 @@ class _MyAppState extends State<MyApp> {
},
debugShowCheckedModeBanner: false,
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: FirebaseAuth.instance.currentUser != null
? StreamBuilder<userJustMusic.User?>(
stream: userCurrent,
initialData: null,
builder: (context, snapshot) {
if (snapshot.hasData) {
print("hasdata");
home: StreamBuilder<User?>(
stream: FirebaseAuth.instance.authStateChanges(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return LoadingScreen();
} else if (snapshot.hasData) {
return FutureBuilder<userJustMusic.User?>(
future: MyApp.userViewModel.getUser(snapshot.data!.uid),
builder: (context, userSnapshot) {
if (userSnapshot.connectionState == ConnectionState.waiting) {
return LoadingScreen();
} else if (userSnapshot.hasData) {
MyApp.userViewModel.userCurrent = userSnapshot.data!;
return AnimatedSwitcher(
duration: Duration(milliseconds: 1000),
transitionBuilder: (child, animation) {
@ -126,18 +124,15 @@ class _MyAppState extends State<MyApp> {
child: FeedScreen(),
);
} else {
return Scaffold(
backgroundColor: bgColor,
body: Center(
child: Image(
image: AssetImage("assets/images/logo.png"),
width: 130,
),
),
);
return WellcomeScreen();
}
})
: WellcomeScreen());
},
);
} else {
return WellcomeScreen();
}
},
));
},
designSize: Size(390, 844),
);

@ -462,6 +462,14 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
keyboardAppearance: Brightness.dark,
controller: _textController,
focusNode: myFocusNode,
onSubmitted: (value) async {
if (value.isNotEmpty) {
await MyApp.commentViewModel.addComment(value, widget.post.id);
}
setState(() {
_textController.clear();
});
},
cursorColor: primaryColor,
keyboardType: TextInputType.emailAddress,
style: GoogleFonts.plusJakartaSans(color: Colors.white),

@ -16,6 +16,7 @@ import '../components/top_nav_bar_component.dart';
import '../model/Post.dart';
import '../values/constants.dart';
import 'detail_post_screen.dart';
import 'package:timezone/timezone.dart' as tz;
class FeedScreen extends StatefulWidget {
const FeedScreen({Key? key}) : super(key: key);
@ -32,7 +33,6 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
late List<Post> discoveryFeed;
late List<Post> displayFeed;
final DateTime midnight = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1);
bool isDismissed = true;
@override
@ -56,6 +56,15 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
}
Future<void> showCapsuleDot() async {
// Get the timezone for France
final franceTimeZone = tz.getLocation('Europe/Paris');
// Get the current date and time in France timezone
var now = tz.TZDateTime.now(franceTimeZone);
// Calculate the midnight time for the next day in France timezone
var midnight = tz.TZDateTime(franceTimeZone, now.year, now.month, now.day + 1);
bool res = await MyApp.postViewModel.getAvailable();
if (isDismissed) {
if (res) {
@ -116,7 +125,7 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
messageText: Align(
alignment: Alignment.centerLeft,
child: CountdownTimer(
endTime: midnight.millisecondsSinceEpoch - 2 * 60 * 60 * 1000,
endTime: midnight.millisecondsSinceEpoch,
textStyle: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15),
),
),

@ -0,0 +1,20 @@
import 'package:flutter/Material.dart';
import '../values/constants.dart';
class LoadingScreen extends StatelessWidget {
const LoadingScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: bgColor,
body: Center(
child: Image(
image: AssetImage("assets/images/logo.png"),
width: 130,
),
),
);
}
}

@ -5,21 +5,16 @@ import '../main.dart';
class CommentService {
createComment(String text, String idPost) async {
var id = MyApp.userViewModel.userCurrent.id;
final comment = <String, dynamic>{
"user_id": id,
"text": text,
"date": DateTime.now(),
"post_id": idPost
};
final comment = <String, dynamic>{"user_id": id, "text": text, "date": DateTime.now(), "post_id": idPost};
await MyApp.db.collection("comments").add(comment);
}
Future<List<QueryDocumentSnapshot<Map<String, dynamic>>>> getCommentsByPostId(
String id) async {
Future<List<QueryDocumentSnapshot<Map<String, dynamic>>>> getCommentsByPostId(String id) async {
var response = await FirebaseFirestore.instance
.collection("comments")
.where("post_id", isEqualTo: id)
.orderBy("date", descending: true)
.get();
return response.docs;

@ -917,6 +917,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.0"
timezone:
dependency: "direct main"
description:
name: timezone
sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0"
url: "https://pub.dev"
source: hosted
version: "0.9.2"
top_snackbar_flutter:
dependency: "direct main"
description:

@ -72,6 +72,7 @@ dependencies:
animations: ^2.0.7
flutter_svg: ^2.0.7
flutter_keyboard_visibility: ^5.4.1
timezone: ^0.9.2
dev_dependencies:
flutter_test:

Loading…
Cancel
Save