Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

What is this white spaces in stack and how to fix it

$
0
0

Can someone explain why is there white spaces on top and bottom of this stack widget despite of no padding here?enter image description hereI have a stack of progress bar and music details. Although I didn't add any padding but why is there the whitespaces in my widget? Is there anyway to fix this.My code: mini_player.dart

import 'package:audio_video_progress_bar/audio_video_progress_bar.dart';import 'package:flutter/material.dart';import 'package:flutter_riverpod/flutter_riverpod.dart';import 'package:webtoon/miniplayer/widgets/progress_bar.dart';import '../riverpod/song_provider.dart';import 'widgets/control_button.dart';class MiniPlayer extends ConsumerWidget {  const MiniPlayer({super.key});  @override  Widget build(BuildContext context, WidgetRef ref) {    final audioPlayer = ref.watch(audioHandlerProvider);    return GestureDetector(      child: Align(        alignment: const AlignmentDirectional(0, 1),        child: Container(          color: Theme.of(context).scaffoldBackgroundColor,          height: 80,          child: Stack(            children: [              Align(                alignment: Alignment.bottomLeft,                child: Row(                  children: <Widget>[                    Image.asset('assets/artwork.jpg',                        width: 60, height: 60, fit: BoxFit.cover),                    Padding(                      padding: const EdgeInsets.all(16.0),                      child: Column(                        children: <Widget>[                          Text('The Weeknd',                            style: TextStyle(                                fontWeight: FontWeight.bold,                                color: Theme.of(context).primaryColor,                                fontSize: 18),                          ),                          Text('Blinding Lights',                            style: TextStyle(                                fontWeight: FontWeight.normal,                                color: Theme.of(context).secondaryHeaderColor,                                fontSize: 13),                          ),                        ],                      ),                    ),                    const Spacer(),                    Control(                      audioPlayer: audioPlayer,                      size: 20.0,                    )                  ],                ),              ),              StreamBuilder<PositionData>(                  stream: PositionData.positionDataStream(audioPlayer),                  builder: (context, snapshot) {                    final positionData = snapshot.data;                    return ProgressBar(                      barHeight: 5,                      baseBarColor: Colors.black,                      bufferedBarColor: Theme.of(context).secondaryHeaderColor,                      progressBarColor: Theme.of(context).primaryColor,                      thumbColor: Theme.of(context).primaryColor,                      timeLabelTextStyle: TextStyle(                        color: Theme.of(context).primaryColor,                        fontSize: 0,                      ),                      progress: positionData?.position ?? Duration.zero,                      buffered: positionData?.bufferedPosition ?? Duration.zero,                      total: positionData?.duration ?? Duration.zero,                      onSeek: audioPlayer.seek,                    );                  }),            ],          ),        ),      ),      onTap: () => Navigator.of(context).pushNamed('/play'),    );  }}

I have thought about changing the Container height from 80 to 60 to match the image height, the whitespaces did got away but instead i got overflow like thisenter image description hereHow to fix this T_T, thanks very much.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>