beautifull app when empty friend list and fix empty description

pull/30/head
Lucas Delanier 2 years ago
parent 0cebb7bbef
commit 0115e2d29f

@ -156,13 +156,6 @@
</list>
</value>
</entry>
<entry key="convert">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/convert-3.1.1/lib" />
</list>
</value>
</entry>
<entry key="cross_file">
<value>
<list>
@ -191,6 +184,13 @@
</list>
</value>
</entry>
<entry key="custom_refresh_indicator">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/custom_refresh_indicator-2.2.1/lib" />
</list>
</value>
</entry>
<entry key="fake_async">
<value>
<list>
@ -324,13 +324,6 @@
</list>
</value>
</entry>
<entry key="flutter_countdown_timer">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_countdown_timer-4.1.0/lib" />
</list>
</value>
</entry>
<entry key="flutter_lints">
<value>
<list>
@ -527,13 +520,6 @@
</list>
</value>
</entry>
<entry key="intl">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.18.1/lib" />
</list>
</value>
</entry>
<entry key="ionicons">
<value>
<list>
@ -562,13 +548,6 @@
</list>
</value>
</entry>
<entry key="lottie">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/lottie-2.5.0/lib" />
</list>
</value>
</entry>
<entry key="matcher">
<value>
<list>
@ -681,13 +660,6 @@
</list>
</value>
</entry>
<entry key="pointycastle">
<value>
<list>
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.7.3/lib" />
</list>
</value>
</entry>
<entry key="sky_engine">
<value>
<list>
@ -850,6 +822,7 @@
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/crypto-3.0.3/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.5/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/custom_draggable_widget-0.0.2/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/custom_refresh_indicator-2.2.1/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/ffi-2.0.2/lib" />
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/file-6.1.4/lib" />

@ -1,7 +1,4 @@
import 'dart:js_interop';
import 'package:auto_size_text/auto_size_text.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';
@ -338,7 +335,7 @@ class _PostComponentState extends State<PostComponent> with TickerProviderStateM
fit: BoxFit.fitHeight,
width: double.infinity,
),
widget.post.description.isNull
widget.post.description == null
? Container()
: Padding(
padding: EdgeInsets.all(15),

@ -1,5 +1,4 @@
import 'package:circular_reveal_animation/circular_reveal_animation.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -49,6 +48,14 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
);
}
Future _refresh() async {
print("refresh");
discoveryFeed = await MyApp.postViewModel.getBestPosts();
setState(() {
displayFeed = discoveryFeed.reversed.toList();
});
}
void changeFeed(bool choice) {
// Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre
if (choice) {
@ -120,9 +127,14 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
index: index,
),
Container(height: 5),
Text('${displayFeed[index].description ?? ""}',
style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w200)),
Container(height: 20),
displayFeed[index].description == null
? Container()
: Padding(
padding: const EdgeInsets.only(bottom: 20),
child: Text('${displayFeed[index].description ?? ""}',
style: GoogleFonts.plusJakartaSans(
color: Colors.white, fontWeight: FontWeight.w200)),
),
Align(
child: RichText(
text: TextSpan(
@ -275,6 +287,10 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
child: Container(
constraints: BoxConstraints(maxWidth: 600),
padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0),
child: RefreshIndicator(
displacement: 20,
triggerMode: RefreshIndicatorTriggerMode.onEdge,
onRefresh: _refresh,
child: ListView.builder(
physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast),
clipBehavior: Clip.none,
@ -287,6 +303,7 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
PostComponent(callback: openDetailPost, post: displayFeed[index], index: index),
);
},
),
)),
),
),

@ -34,7 +34,7 @@ class PostViewModel {
throw new Error();
}
getBestPosts() async {
Future<List<Post>> getBestPosts() async {
try {
var responseData = await _postService.getPopularPosts();
List<String> ids = [];
@ -47,8 +47,10 @@ class PostViewModel {
for (int i = 0; i < _bestPosts.length; i++) {
_bestPosts[i].music = musics[i];
}
return _bestPosts;
} catch (e) {
print(e);
return [];
}
}

@ -209,6 +209,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.0.2"
custom_refresh_indicator:
dependency: "direct main"
description:
name: custom_refresh_indicator
sha256: "65a463f09623f6baf75e45e0c9034e9304810be3f5dfb00a54edde7252f4a524"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
fake_async:
dependency: transitive
description:

@ -68,6 +68,7 @@ dependencies:
flutter_countdown_timer: ^4.1.0
intl: ^0.18.1
lottie: ^2.5.0
custom_refresh_indicator: ^2.2.1
dev_dependencies:
flutter_test:

Loading…
Cancel
Save