Commit 6e851c01 authored by Wijegunarathna K. P. S. G. G.'s avatar Wijegunarathna K. P. S. G. G.

Merge branch 'IT20244170' into 'master'

Change the home screen component names.

See merge request !9
parents a9625880 091e23b1
...@@ -10,32 +10,32 @@ class Comp1Step1First extends StatefulWidget { ...@@ -10,32 +10,32 @@ class Comp1Step1First extends StatefulWidget {
} }
class _Comp1Step1FirstState extends State<Comp1Step1First> { class _Comp1Step1FirstState extends State<Comp1Step1First> {
void nextPage(String route, String image) {
void nextPage(String route,String image) { Navigator.pushNamed(context, route, arguments: {'image': image});
Navigator.pushNamed(context, route, arguments: {
'image':image
});
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
SizedBox(height: 20,), SizedBox(
Header(title: 'කැමති ක්‍රියාකාරකම තෝරන්න'), height: 20,
SizedBox(height: 30,), ),
InkWell( Header(title: 'කැමති පින්තූරය තෝරන්න'),
onTap: ()=>nextPage('/Comp1Step1Second','assets/images/Component 1 - img 03.png'), SizedBox(
child: ImageCard(image: 'assets/images/Component 1 - img 03.png') height: 30,
), ),
SizedBox(height: 30,),
InkWell( InkWell(
onTap: ()=>nextPage('/Comp1Step1Second','assets/images/Component 1 - img 04.png'), onTap: () => nextPage(
child: ImageCard(image: 'assets/images/Component 1 - img 04.png') '/Comp1Step1Second', 'assets/images/Component 1 - img 03.png'),
child: ImageCard(image: 'assets/images/Component 1 - img 03.png')),
SizedBox(
height: 30,
), ),
InkWell(
onTap: () => nextPage(
'/Comp1Step1Second', 'assets/images/Component 1 - img 04.png'),
child: ImageCard(image: 'assets/images/Component 1 - img 04.png')),
], ],
); );
} }
......
...@@ -2,6 +2,46 @@ import 'package:Autism/widgets/ButtonXl.dart'; ...@@ -2,6 +2,46 @@ import 'package:Autism/widgets/ButtonXl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:Autism/MyStyles.dart' as MyStyles; import 'package:Autism/MyStyles.dart' as MyStyles;
class ButtonXL extends StatelessWidget {
final String route;
final String title;
final Color bg;
final double fontSize; // Added fontSize parameter
ButtonXL({
required this.route,
required this.title,
required this.bg,
this.fontSize = 22.0, // Default font size
});
@override
Widget build(BuildContext context) {
return Container(
width: 200.0, // Set the desired width
child: ElevatedButton(
onPressed: () {
Navigator.pushNamedAndRemoveUntil(context, route, (r) => false,
arguments: {});
},
style: ElevatedButton.styleFrom(
primary: bg,
),
child: Center(
child: Text(
title,
textAlign: TextAlign.center, // Center the text horizontally
style: TextStyle(
color: Colors.white,
fontSize: fontSize,
),
),
),
),
);
}
}
class Home extends StatefulWidget { class Home extends StatefulWidget {
const Home({super.key}); const Home({super.key});
...@@ -17,37 +57,47 @@ class _HomeState extends State<Home> { ...@@ -17,37 +57,47 @@ class _HomeState extends State<Home> {
arguments: {}); arguments: {});
} }
double buttonWidth = 350.0; // Adjust the width
double buttonHeight = 110.0; // Adjust the width
return Column( return Column(
children: [ children: [
ButtonXL( Container(
width: buttonWidth,
height: buttonHeight,
child: ButtonXL(
route: '/Comp1Welcome', route: '/Comp1Welcome',
title: 'පළමු කාර්යය', title: 'කථන අසාමාන්‍යතාවයන් හදුනා ගැනීම',
bg: MyStyles.cbtnPrimary), bg: MyStyles.cbtnPrimary,
),
),
SizedBox( SizedBox(
height: 20, height: 40,
), ),
ButtonXL( Container(
width: buttonWidth,
height: buttonHeight,
child: ButtonXL(
route: '/Comp2Page1', route: '/Comp2Page1',
title: 'දෙවන කාර්යය', title: 'උච්චාරණ කුසලතා විශ්ලේෂණය',
bg: MyStyles.cbtnPrimary), bg: MyStyles.cbtnPrimary,
SizedBox( ),
height: 20,
), ),
ButtonXL(
route: '/Comp3Page1',
title: 'තුන්වන කාර්යය',
bg: MyStyles.cbtnPrimary),
SizedBox( SizedBox(
height: 20, height: 40,
), ),
ButtonXL( Container(
width: buttonWidth,
height: buttonHeight,
child: ButtonXL(
route: '/Comp3Page1', route: '/Comp3Page1',
title: 'හතරවන කාර්යය', title: 'පිළිතුරු වල නිරවද්‍යතාවය ඇගයීම',
bg: MyStyles.cbtnPrimary), bg: MyStyles.cbtnPrimary,
),
),
SizedBox( SizedBox(
height: 20, height: 40,
), ),
//ButtonXL(route: '/home', title: 'හතරවන කාර්යය', bg: MyStyles.cbtnPrimary)
], ],
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment