|
|
|
@ -22,139 +22,7 @@ class MeetingDetailsView extends GetView<MeetingDetailsController> { |
|
|
|
() => Scaffold( |
|
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.grey[50], |
|
|
|
appBar: _buildAppBar(isDarkMode), |
|
|
|
body: NestedScrollView( |
|
|
|
controller: controller.scrollController, |
|
|
|
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { |
|
|
|
return [ |
|
|
|
SliverAppBar( |
|
|
|
automaticallyImplyLeading: false, |
|
|
|
expandedHeight: 210.w, |
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
flexibleSpace: FlexibleSpaceBar( |
|
|
|
collapseMode: CollapseMode.pin, |
|
|
|
background: Align( |
|
|
|
alignment: Alignment.topCenter, |
|
|
|
child: Container( |
|
|
|
height: 200.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey[200]!, |
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
bottom: Radius.circular(20.r), |
|
|
|
), |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(bottom: 5.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(8.r), |
|
|
|
), |
|
|
|
child: AudioFileWaveforms( |
|
|
|
size: Size(350.w, 120.w), |
|
|
|
playerController: controller.playerController, |
|
|
|
playerWaveStyle: PlayerWaveStyle( |
|
|
|
fixedWaveColor: Colors.grey[300]!, |
|
|
|
liveWaveColor: Colors.red, |
|
|
|
seekLineColor: Colors.red, |
|
|
|
scaleFactor: 600, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
width: 350.w, |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
StreamBuilder<int>( |
|
|
|
stream: controller.playerController |
|
|
|
.onCurrentDurationChanged, |
|
|
|
builder: (context, snapshot) { |
|
|
|
final position = snapshot.data ?? 0; |
|
|
|
return Text( |
|
|
|
DateUtil.formatDateMs( |
|
|
|
position, |
|
|
|
format: 'HH:mm:ss', |
|
|
|
isUtc: true, |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode |
|
|
|
? Colors.grey[400] |
|
|
|
: Colors.grey[500], |
|
|
|
fontSize: 12.sp, |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
Obx( |
|
|
|
() => Text( |
|
|
|
DateUtil.formatDateMs( |
|
|
|
controller.durationMax.value, |
|
|
|
format: 'HH:mm:ss', |
|
|
|
isUtc: true, |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode |
|
|
|
? Colors.grey[400] |
|
|
|
: Colors.grey[500], |
|
|
|
fontSize: 12.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
children: [ |
|
|
|
Icon( |
|
|
|
Icons.replay_10, |
|
|
|
color: Colors.black, |
|
|
|
size: 30.w, |
|
|
|
), |
|
|
|
StreamBuilder<PlayerState>( |
|
|
|
stream: controller |
|
|
|
.playerController.onPlayerStateChanged, |
|
|
|
builder: (context, snapshot) { |
|
|
|
bool isPlay = |
|
|
|
snapshot.data?.isPlaying ?? false; |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
if (isPlay) { |
|
|
|
controller.playerController |
|
|
|
.pausePlayer(); |
|
|
|
} else { |
|
|
|
controller.playerController |
|
|
|
.startPlayer(); |
|
|
|
} |
|
|
|
}, |
|
|
|
child: Icon( |
|
|
|
isPlay |
|
|
|
? Icons.pause_circle |
|
|
|
: Icons.play_circle, |
|
|
|
color: Colors.black, |
|
|
|
size: 48.w, |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
Icon( |
|
|
|
Icons.forward_10, |
|
|
|
color: Colors.black, |
|
|
|
size: 30.w, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
]; |
|
|
|
}, |
|
|
|
body: _buildBody(context, isDarkMode), |
|
|
|
), |
|
|
|
body: _buildBody(context, isDarkMode), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
@ -295,6 +163,7 @@ class MeetingDetailsView extends GetView<MeetingDetailsController> { |
|
|
|
Widget _buildBody(BuildContext context, bool isDarkMode) { |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
_soundWave(isDarkMode), |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8.w), |
|
|
|
margin: EdgeInsets.symmetric(vertical: 10.w), |
|
|
|
@ -328,6 +197,113 @@ class MeetingDetailsView extends GetView<MeetingDetailsController> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _soundWave(bool isDarkMode) { |
|
|
|
return Container( |
|
|
|
height: 200.w, |
|
|
|
margin: EdgeInsets.only(bottom: 10.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey[200]!, |
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
bottom: Radius.circular(20.r), |
|
|
|
), |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(bottom: 5.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(8.r), |
|
|
|
), |
|
|
|
child: AudioFileWaveforms( |
|
|
|
size: Size(350.w, 120.w), |
|
|
|
playerController: controller.playerController, |
|
|
|
playerWaveStyle: PlayerWaveStyle( |
|
|
|
fixedWaveColor: Colors.grey[300]!, |
|
|
|
liveWaveColor: Colors.red, |
|
|
|
seekLineColor: Colors.red, |
|
|
|
scaleFactor: 600, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
width: 350.w, |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
StreamBuilder<int>( |
|
|
|
stream: controller.playerController.onCurrentDurationChanged, |
|
|
|
builder: (context, snapshot) { |
|
|
|
final position = snapshot.data ?? 0; |
|
|
|
return Text( |
|
|
|
DateUtil.formatDateMs( |
|
|
|
position, |
|
|
|
format: 'HH:mm:ss', |
|
|
|
isUtc: true, |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500], |
|
|
|
fontSize: 12.sp, |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
Obx( |
|
|
|
() => Text( |
|
|
|
DateUtil.formatDateMs( |
|
|
|
controller.durationMax.value, |
|
|
|
format: 'HH:mm:ss', |
|
|
|
isUtc: true, |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500], |
|
|
|
fontSize: 12.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
children: [ |
|
|
|
Icon( |
|
|
|
Icons.replay_10, |
|
|
|
color: Colors.black, |
|
|
|
size: 30.w, |
|
|
|
), |
|
|
|
StreamBuilder<PlayerState>( |
|
|
|
stream: controller.playerController.onPlayerStateChanged, |
|
|
|
builder: (context, snapshot) { |
|
|
|
bool isPlay = snapshot.data?.isPlaying ?? false; |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
if (isPlay) { |
|
|
|
controller.playerController.pausePlayer(); |
|
|
|
} else { |
|
|
|
controller.playerController.startPlayer(); |
|
|
|
} |
|
|
|
}, |
|
|
|
child: Icon( |
|
|
|
isPlay ? Icons.pause_circle : Icons.play_circle, |
|
|
|
color: Colors.black, |
|
|
|
size: 48.w, |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
Icon( |
|
|
|
Icons.forward_10, |
|
|
|
color: Colors.black, |
|
|
|
size: 30.w, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _iconItem(IconData icon, String title, int index) { |
|
|
|
bool isActive = controller.currentIndex.value == index; |
|
|
|
|
|
|
|
|