beautifull app when empty friend list and fix empty description

pull/30/head
Lucas Delanier 2 years ago
parent 0115e2d29f
commit 26cae65b42

@ -35,8 +35,7 @@ class EditablePostComponent extends StatefulWidget {
State<EditablePostComponent> createState() => _EditablePostComponentState(); State<EditablePostComponent> createState() => _EditablePostComponentState();
} }
class _EditablePostComponentState extends State<EditablePostComponent> class _EditablePostComponentState extends State<EditablePostComponent> with TickerProviderStateMixin {
with TickerProviderStateMixin {
final ImagePicker picker = ImagePicker(); final ImagePicker picker = ImagePicker();
late Animation<double> animation; late Animation<double> animation;
late AnimationController animationController; late AnimationController animationController;
@ -64,7 +63,10 @@ class _EditablePostComponentState extends State<EditablePostComponent>
Future pickImage(ImageSource source) async { Future pickImage(ImageSource source) async {
try { try {
final image = await ImagePicker().pickImage(source: source); final image = await ImagePicker().pickImage(
source: source,
imageQuality: 25,
);
if (image == null) return; if (image == null) return;
final imageTemp = File(image.path); final imageTemp = File(image.path);
setState(() { setState(() {
@ -102,12 +104,10 @@ class _EditablePostComponentState extends State<EditablePostComponent>
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
topLeft: Radius.circular(20), topRight: Radius.circular(20))),
builder: ((context) { builder: ((context) {
return ClipRRect( return ClipRRect(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
topLeft: Radius.circular(20), topRight: Radius.circular(20)),
child: SearchCityScreen(callback: _selectLocation)); child: SearchCityScreen(callback: _selectLocation));
}), }),
); );
@ -153,8 +153,7 @@ class _EditablePostComponentState extends State<EditablePostComponent>
width: double.infinity, width: double.infinity,
) )
: Image( : Image(
image: image: NetworkImage(widget.music?.cover ?? ""),
NetworkImage(widget.music?.cover ?? ""),
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
), ),
@ -178,10 +177,7 @@ class _EditablePostComponentState extends State<EditablePostComponent>
), ),
color: grayColor, color: grayColor,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
border: Border.all( border: Border.all(style: BorderStyle.solid, color: Colors.white, width: 4)),
style: BorderStyle.solid,
color: Colors.white,
width: 4)),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
child: InstaImageViewer( child: InstaImageViewer(
@ -209,18 +205,13 @@ class _EditablePostComponentState extends State<EditablePostComponent>
child: TextScroll( child: TextScroll(
(widget.music?.title)!, (widget.music?.title)!,
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
height: 1, height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h),
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 26.h),
mode: TextScrollMode.endless, mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500), pauseBetween: Duration(milliseconds: 500),
velocity: velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
Velocity(pixelsPerSecond: Offset(20, 0)),
)), )),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w),
bottom: 10.h, right: 5.w, left: 5.w),
child: ClipOval( child: ClipOval(
child: Container( child: Container(
width: 5.h, width: 5.h,
@ -236,13 +227,9 @@ class _EditablePostComponentState extends State<EditablePostComponent>
child: TextScroll( child: TextScroll(
(widget.music?.artists[0].name)!, (widget.music?.artists[0].name)!,
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
height: 1, height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h),
color: Colors.white,
fontWeight: FontWeight.w300,
fontSize: 16.h),
mode: TextScrollMode.endless, mode: TextScrollMode.endless,
velocity: velocity: Velocity(pixelsPerSecond: Offset(50, 20)),
Velocity(pixelsPerSecond: Offset(50, 20)),
pauseBetween: Duration(milliseconds: 500), pauseBetween: Duration(milliseconds: 500),
), ),
)), )),
@ -250,9 +237,7 @@ class _EditablePostComponentState extends State<EditablePostComponent>
AutoSizeText( AutoSizeText(
widget.music?.date.toString() ?? "unknown", 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, fontSize: 16.h),
fontWeight: FontWeight.w300,
fontSize: 16.h),
textAlign: TextAlign.end, textAlign: TextAlign.end,
maxFontSize: 20, maxFontSize: 20,
), ),
@ -306,35 +291,25 @@ class _EditablePostComponentState extends State<EditablePostComponent>
keyboardAppearance: Brightness.dark, keyboardAppearance: Brightness.dark,
minLines: 1, minLines: 1,
cursorColor: primaryColor, cursorColor: primaryColor,
style: GoogleFonts.plusJakartaSans( style:
color: Colors.white, GoogleFonts.plusJakartaSans(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w300),
fontSize: 13,
fontWeight: FontWeight.w300),
maxLines: 4, maxLines: 4,
maxLength: 120, maxLength: 120,
decoration: InputDecoration( decoration: InputDecoration(
counterStyle: GoogleFonts.plusJakartaSans( counterStyle: GoogleFonts.plusJakartaSans(color: grayText, fontSize: 9),
color: grayText, fontSize: 9),
focusedBorder: const OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderSide: borderSide: BorderSide(width: 0, color: Colors.transparent),
BorderSide(width: 0, color: Colors.transparent), borderRadius: BorderRadius.all(Radius.circular(10))),
borderRadius: contentPadding: const EdgeInsets.only(top: 0, bottom: 0, left: 0),
BorderRadius.all(Radius.circular(10))),
contentPadding:
const EdgeInsets.only(top: 0, bottom: 0, left: 0),
fillColor: Colors.transparent, fillColor: Colors.transparent,
filled: true, filled: true,
focusColor: Colors.transparent, focusColor: Colors.transparent,
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: borderSide: BorderSide(width: 0, color: Colors.transparent),
BorderSide(width: 0, color: Colors.transparent), borderRadius: BorderRadius.all(Radius.circular(10))),
borderRadius:
BorderRadius.all(Radius.circular(10))),
hintText: 'Description...', hintText: 'Description...',
hintStyle: GoogleFonts.plusJakartaSans( hintStyle:
color: grayText, GoogleFonts.plusJakartaSans(color: grayText, fontSize: 13, fontWeight: FontWeight.w300),
fontSize: 13,
fontWeight: FontWeight.w300),
), ),
), ),
)), )),

Loading…
Cancel
Save