Skip to content

Commit

Permalink
Fix edit team was not reflecting on member add (#75)
Browse files Browse the repository at this point in the history
* edit team was not reflecting on member add

* set target to 34 in android
  • Loading branch information
cp-sidhdhi-p committed Jul 10, 2024
1 parent f60ca81 commit 7866908
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions khelo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (flutterVersionName == null) {

android {
namespace "com.canopas.khelo"
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 34
ndkVersion flutter.ndkVersion

compileOptions {
Expand All @@ -47,7 +47,7 @@ android {
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
android.applicationVariants.all { variant ->
Expand Down
13 changes: 10 additions & 3 deletions khelo/lib/ui/flow/team/add_team/add_team_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:data/api/team/team_model.dart';
import 'package:data/api/user/user_models.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -152,9 +153,15 @@ class _AddTeamScreenState extends ConsumerState<AddTeamScreen> {
const SizedBox(width: 16),
actionButton(
context,
onPressed: () =>
AppRoute.addTeamMember(team: widget.editTeam!)
.push(context),
onPressed: () async {
final members = await AppRoute.addTeamMember(
team: widget.editTeam!
.copyWith(players: state.teamMembers))
.push<List<UserModel>>(context);
if (context.mounted && (members ?? []).isNotEmpty) {
notifier.updatePlayersList(members!);
}
},
icon: Icon(
CupertinoIcons.add,
color: context.colorScheme.textPrimary,
Expand Down
2 changes: 1 addition & 1 deletion khelo/lib/ui/flow/team/add_team/add_team_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AddTeamViewNotifier extends StateNotifier<AddTeamState> {
state = state.copyWith(currentUser: user);
}

Future<void> updatePlayersList(List<UserModel> players) async {
void updatePlayersList(List<UserModel> players) {
if (state.editTeam == null) {
return;
}
Expand Down

0 comments on commit 7866908

Please sign in to comment.