Skip to content

Commit

Permalink
just add a user guide page and button
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Udantha committed Jan 22, 2024
1 parent 121279f commit 487531f
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/smartchessboard/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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 flutter.minSdkVersion
minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
3 changes: 2 additions & 1 deletion code/smartchessboard/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _MyAppState extends State<MyApp> {
void _configureAmplify() async {
try {
await Amplify.addPlugin(AmplifyAuthCognito());
await Amplify.configure(amplifyconfig);
// await Amplify.configure(amplifyconfig);
safePrint('Successfully configured');
} on Exception catch (e) {
safePrint('Error configuring Amplify: $e');
Expand All @@ -65,6 +65,7 @@ class _MyAppState extends State<MyApp> {
JoinRoomScreen.routeName: (context) => const JoinRoomScreen(),
CreateRoomScreen.routeName: (context) => const CreateRoomScreen(),
GameScreen.routeName: (context) => const GameScreen(),

}
),
));
Expand Down
24 changes: 23 additions & 1 deletion code/smartchessboard/lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:smartchessboard/screens/login.dart';
import 'package:smartchessboard/screens/mainmenu.dart';
import 'package:smartchessboard/screens/signup.dart';
import 'package:smartchessboard/screens/user_guide.dart';

class HomePage extends StatelessWidget {
static String routeName = '/home';
Expand Down Expand Up @@ -118,7 +119,28 @@ class HomePage extends StatelessWidget {
fontSize: 15
),
),
)
),


Container(height: 10),
// Add User Guide button
TextButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (_){
return UserGuide();
})
);
},
child: Text(
"User Guide",
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.w300,
fontSize: 15,
),
),
),


],
)
Expand Down
77 changes: 77 additions & 0 deletions code/smartchessboard/lib/screens/user_guide.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:flutter/material.dart';

class UserGuide extends StatelessWidget {
const UserGuide({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("User Guide"),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Welcome to the Chess Game User Guide!',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 16),
Text(
'1. Overview',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'Learn how to make moves, customize settings, and enjoy the game.',
),
SizedBox(height: 16),
Text(
'2. Making Moves',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'To make a move, tap on a chess piece and then tap on the destination square.',
),
SizedBox(height: 16),
Text(
'3. Customizing Settings',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'Explore the settings to customize your chessboard appearance and game preferences.',
),
SizedBox(height: 16),
Text(
'4. Enjoy the Game!',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8),
Text(
'Connect with friends, play chess, and have fun!',
),
],
),
),
);
}
}

0 comments on commit 487531f

Please sign in to comment.