This commit is contained in:
Daniel Ponte 2024-08-14 09:26:28 -04:00
parent c411a007e6
commit 3a6ac88685
5 changed files with 23 additions and 18 deletions

View file

@ -7,6 +7,7 @@ class Player {
final player = AudioPlayer();
Player();
Future<void> play(Call call) {
// TODO make a queue
return player.play(BytesSource(Uint8List.fromList(call.audio)));
}
}

View file

@ -95,21 +95,23 @@ class _LoginState extends State<Login> {
userController.text,
passwordController.text)
.then((result) {
if (result == true && mounted) {
Navigator.pushReplacement(
context,
PageRouteBuilder(
pageBuilder: (context, animation,
secondaryAnimation) =>
const CallsHome(),
transitionsBuilder: (context, animation,
secondaryAnimation, child) {
return child;
},
transitionDuration:
const Duration(milliseconds: 0),
),
);
if (result == true) {
if (context.mounted) {
Navigator.pushReplacement(
context,
PageRouteBuilder(
pageBuilder: (context, animation,
secondaryAnimation) =>
const CallsHome(),
transitionsBuilder: (context, animation,
secondaryAnimation, child) {
return child;
},
transitionDuration:
const Duration(milliseconds: 0),
),
);
}
}
});
} else {

View file

@ -14,7 +14,8 @@ class MainRadio extends StatefulWidget {
class _MainRadioState extends State<MainRadio> {
@override
Widget build(BuildContext context) {
return const Scaffold(
return const SafeArea(
child: Scaffold(
body: Center(
child: SizedBox(
width: 500.0,
@ -27,6 +28,6 @@ class _MainRadioState extends State<MainRadio> {
],
)),
),
);
));
}
}

View file

@ -34,7 +34,7 @@ packages:
source: hosted
version: "5.0.2"
audioplayers_linux:
dependency: transitive
dependency: "direct main"
description:
name: audioplayers_linux
sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e"

View file

@ -43,6 +43,7 @@ dependencies:
audioplayers: ^5.2.1
flutter_secure_storage: ^9.2.2
http: ^1.2.2
audioplayers_linux: ^3.1.0
dev_dependencies:
flutter_test: