-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Presentation] Minor ui changes and improvements
- Loading branch information
Showing
13 changed files
with
176 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 25 additions & 32 deletions
57
CastIt.Client/lib/presentation/play/widgets/play_progress_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,36 @@ | ||
import 'package:castit/application/bloc.dart'; | ||
import 'package:castit/domain/extensions/duration_extensions.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class PlayProgressText extends StatelessWidget { | ||
const PlayProgressText(); | ||
final double? currentSeconds; | ||
final double? duration; | ||
|
||
const PlayProgressText({ | ||
required this.currentSeconds, | ||
required this.duration, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocBuilder<PlayBloc, PlayState>( | ||
builder: (ctx, state) { | ||
final theme = Theme.of(context); | ||
final isDarkTheme = theme.brightness == Brightness.dark; | ||
return state.maybeMap( | ||
playing: (state) { | ||
final current = Duration(seconds: (state.currentSeconds ?? 0).round()).formatDuration(); | ||
final total = Duration(seconds: state.duration!.round()).formatDuration(); | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
Text( | ||
current, | ||
style: TextStyle(color: isDarkTheme ? Colors.white : Colors.black), | ||
), | ||
Text( | ||
total, | ||
style: TextStyle(color: isDarkTheme ? Colors.white : Colors.black), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
orElse: () => const Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 16.0), | ||
final theme = Theme.of(context); | ||
final isDarkTheme = theme.brightness == Brightness.dark; | ||
final current = Duration(seconds: (currentSeconds ?? 0).round()).formatDuration(); | ||
final total = Duration(seconds: (duration ?? 0).round()).formatDuration(); | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
Text( | ||
current, | ||
style: TextStyle(color: isDarkTheme ? Colors.white : Colors.black), | ||
), | ||
Text( | ||
total, | ||
style: TextStyle(color: isDarkTheme ? Colors.white : Colors.black), | ||
), | ||
); | ||
}, | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.