From 487531f26b7b328df59b887f51c6e35b4669d220 Mon Sep 17 00:00:00 2001 From: Isira-Udantha Date: Tue, 23 Jan 2024 04:54:00 +0530 Subject: [PATCH] just add a user guide page and button --- code/smartchessboard/android/app/build.gradle | 1 + code/smartchessboard/lib/main.dart | 3 +- code/smartchessboard/lib/screens/home.dart | 24 +++++- .../lib/screens/user_guide.dart | 77 +++++++++++++++++++ 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 code/smartchessboard/lib/screens/user_guide.dart diff --git a/code/smartchessboard/android/app/build.gradle b/code/smartchessboard/android/app/build.gradle index 079164b..27e2944 100644 --- a/code/smartchessboard/android/app/build.gradle +++ b/code/smartchessboard/android/app/build.gradle @@ -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 diff --git a/code/smartchessboard/lib/main.dart b/code/smartchessboard/lib/main.dart index 3804b0b..5ee460e 100644 --- a/code/smartchessboard/lib/main.dart +++ b/code/smartchessboard/lib/main.dart @@ -40,7 +40,7 @@ class _MyAppState extends State { 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'); @@ -65,6 +65,7 @@ class _MyAppState extends State { JoinRoomScreen.routeName: (context) => const JoinRoomScreen(), CreateRoomScreen.routeName: (context) => const CreateRoomScreen(), GameScreen.routeName: (context) => const GameScreen(), + } ), )); diff --git a/code/smartchessboard/lib/screens/home.dart b/code/smartchessboard/lib/screens/home.dart index fc95565..cf089be 100644 --- a/code/smartchessboard/lib/screens/home.dart +++ b/code/smartchessboard/lib/screens/home.dart @@ -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'; @@ -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, + ), + ), + ), + ], ) diff --git a/code/smartchessboard/lib/screens/user_guide.dart b/code/smartchessboard/lib/screens/user_guide.dart new file mode 100644 index 0000000..9719a22 --- /dev/null +++ b/code/smartchessboard/lib/screens/user_guide.dart @@ -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!', + ), + ], + ), + ), + ); + } +}