Skip to content

Commit

Permalink
Merge pull request #116 from ChallengeClub/turtle-training
Browse files Browse the repository at this point in the history
Turtle trainingモードへの対応
  • Loading branch information
EndoNrak authored Oct 15, 2023
2 parents 9c43dc0 + 2026450 commit e872317
Show file tree
Hide file tree
Showing 29 changed files with 624 additions and 834 deletions.
6 changes: 0 additions & 6 deletions app/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
run:
flutter run lib/main.dart -d web-server --web-port=${WEB_SERVER_PORT} --web-hostname 0.0.0.0 \
--dart-define=TETRIS_API=${TETRIS_API} \
--dart-define=TETRIS_COGNITO_USER_POOL_ID=${TETRIS_COGNITO_USER_POOL_ID} \
--dart-define=TETRIS_COGNITO_APP_CLIENT_ID=${TETRIS_COGNITO_APP_CLIENT_ID} \
--dart-define=TETRIS_COGNITO_WEB_DOMAIN=${TETRIS_COGNITO_WEB_DOMAIN} \
--dart-define=TETRIS_FRONTEND_DOMAIN=${TETRIS_FRONTEND_DOMAIN} \
--web-renderer html

Expand All @@ -12,9 +9,6 @@ run:
build:
flutter build web \
--dart-define=TETRIS_API=${TETRIS_API} \
--dart-define=TETRIS_COGNITO_USER_POOL_ID=${TETRIS_COGNITO_USER_POOL_ID} \
--dart-define=TETRIS_COGNITO_APP_CLIENT_ID=${TETRIS_COGNITO_APP_CLIENT_ID} \
--dart-define=TETRIS_COGNITO_WEB_DOMAIN=${TETRIS_COGNITO_WEB_DOMAIN} \
--dart-define=TETRIS_FRONTEND_DOMAIN=${TETRIS_FRONTEND_DOMAIN} \
--web-renderer html

Expand Down
66 changes: 0 additions & 66 deletions app/lib/amplifyconfiguration.dart

This file was deleted.

2 changes: 1 addition & 1 deletion app/lib/components/blocks/custom_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CustomAppbar extends ConsumerWidget implements PreferredSizeWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
ref.watch(userLoginStateNotifierProvider); // this part is only for call auth configure method
// ref.watch(userLoginStateNotifierProvider); // this part is only for call auth configure method
return AppBar(
title: title,
bottom: bottom,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/blocks/training_list_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TrainingListBlock extends ConsumerWidget {
itemCount: _trainings.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () => context.push('/training/${_section}/${_trainings[index].id}'),
onTap: () => context.push('/trainings/${_section}/${_trainings[index].id}'),
child: Container(
padding: EdgeInsets.symmetric(horizontal: _line_width*0.08),
height: _line_height,
Expand Down
44 changes: 8 additions & 36 deletions app/lib/components/blocks/user_menu_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:provider/provider.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:go_router/go_router.dart';

import '../../model/user_model.dart';
import '../../view_model/providers.dart';

class UserMenuDrawer extends ConsumerWidget{

UserMenuDrawer();

@override
Widget build(BuildContext context, WidgetRef ref) {
final _state = ref.watch(userLoginStateNotifierProvider);
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
Expand All @@ -32,39 +25,18 @@ class UserMenuDrawer extends ConsumerWidget{
),
),
),
if (_state==null)
ListTile(
leading: Icon(Icons.account_circle),
title: Text('Profile'),
)
else
ListTile(
leading: Icon(Icons.account_circle),
title: Text('Profile'),
onTap: () {
context.push("/users");
},
),
ListTile(
leading: Icon(Icons.account_circle),
title: Text('Profile')
),
ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
),
if (_state==null)
ListTile(
leading: Icon(Icons.login),
title: Text('Login'),
onTap: () {
ref.read(userLoginStateNotifierProvider.notifier).signIn();
},
)
else
ListTile(
leading: Icon(Icons.logout),
title: Text('Logout'),
onTap: () {
ref.read(userLoginStateNotifierProvider.notifier).signOut();
},
),
ListTile(
leading: Icon(Icons.login),
title: Text('Login'),
),
],
),
);
Expand Down
Loading

0 comments on commit e872317

Please sign in to comment.