-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated flutter project to session -> lobby changes
- Loading branch information
1 parent
d716155
commit 3ab37ee
Showing
6 changed files
with
121 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import 'package:duo_client/pb/lobby.pb.dart'; | ||
|
||
abstract class AbstractServerConnection { | ||
LobbyStatus? lobbyStatus; | ||
|
||
AbstractServerConnection(); | ||
Future<int> registerUser(String username); | ||
Future<int> loginUser(String uuid); | ||
Future<int> createSession(String token, String pin); | ||
Future<int> joinSession(String token, int sessionId); | ||
Future<int> disconnectSession(String token, int sessionId); | ||
Future<int> createLobby(String token); | ||
Future<int> joinLobby(String token, int sessionId); | ||
Future<int> disconnectLobby(String token, int sessionId); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'package:duo_client/pb/user.pb.dart'; | ||
import 'package:duo_client/utils/constants.dart'; | ||
import 'package:duo_client/widgets/duo_container.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
class UserTile extends StatelessWidget { | ||
const UserTile({ | ||
super.key, | ||
required this.user, | ||
}); | ||
|
||
final User user; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
double width = MediaQuery.of(context).size.width; | ||
double height = MediaQuery.of(context).size.height; | ||
return DuoContainer( | ||
width: width / 3.5, | ||
height: height / 4.5, | ||
child: Material( | ||
color: Colors.transparent, | ||
child: InkWell( | ||
borderRadius: BorderRadius.circular(Constants.defaultRadius), | ||
child: Padding( | ||
padding: const EdgeInsets.all(Constants.defaultPadding), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
SvgPicture.asset( | ||
'res/icons/user.svg', | ||
colorFilter: ColorFilter.mode( | ||
Theme.of(context).colorScheme.onPrimary, | ||
BlendMode.srcIn, | ||
), | ||
), | ||
const SizedBox(height: 10), | ||
Text( | ||
user.name, | ||
style: TextStyle( | ||
color: Theme.of(context).colorScheme.onPrimary, | ||
fontSize: 20, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |