Change the home screen component names.

parent a399c8c2
......@@ -10,33 +10,33 @@ class Comp1Step1First extends StatefulWidget {
}
class _Comp1Step1FirstState extends State<Comp1Step1First> {
void nextPage(String route,String image) {
Navigator.pushNamed(context, route, arguments: {
'image':image
});
void nextPage(String route, String image) {
Navigator.pushNamed(context, route, arguments: {'image': image});
}
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(height: 20,),
Header(title: 'කැමති ක්‍රියාකාරකම තෝරන්න'),
SizedBox(height: 30,),
InkWell(
onTap: ()=>nextPage('/Comp1Step1Second','assets/images/Component 1 - img 03.png'),
child: ImageCard(image: 'assets/images/Component 1 - img 03.png')
children: [
SizedBox(
height: 20,
),
Header(title: 'කැමති පින්තූරය තෝරන්න'),
SizedBox(
height: 30,
),
SizedBox(height: 30,),
InkWell(
onTap: ()=>nextPage('/Comp1Step1Second','assets/images/Component 1 - img 04.png'),
child: ImageCard(image: 'assets/images/Component 1 - img 04.png')
onTap: () => nextPage(
'/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';
import 'package:flutter/material.dart';
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 {
const Home({super.key});
......@@ -17,37 +57,47 @@ class _HomeState extends State<Home> {
arguments: {});
}
double buttonWidth = 350.0; // Adjust the width
double buttonHeight = 110.0; // Adjust the width
return Column(
children: [
ButtonXL(
Container(
width: buttonWidth,
height: buttonHeight,
child: ButtonXL(
route: '/Comp1Welcome',
title: 'පළමු කාර්යය',
bg: MyStyles.cbtnPrimary),
title: 'කථන අසාමාන්‍යතාවයන් හදුනා ගැනීම',
bg: MyStyles.cbtnPrimary,
),
),
SizedBox(
height: 20,
height: 40,
),
ButtonXL(
Container(
width: buttonWidth,
height: buttonHeight,
child: ButtonXL(
route: '/Comp2Page1',
title: 'දෙවන කාර්යය',
bg: MyStyles.cbtnPrimary),
SizedBox(
height: 20,
title: 'උච්චාරණ කුසලතා විශ්ලේෂණය',
bg: MyStyles.cbtnPrimary,
),
),
ButtonXL(
route: '/Comp3Page1',
title: 'තුන්වන කාර්යය',
bg: MyStyles.cbtnPrimary),
SizedBox(
height: 20,
height: 40,
),
ButtonXL(
Container(
width: buttonWidth,
height: buttonHeight,
child: ButtonXL(
route: '/Comp3Page1',
title: 'හතරවන කාර්යය',
bg: MyStyles.cbtnPrimary),
title: 'පිළිතුරු වල නිරවද්‍යතාවය ඇගයීම',
bg: MyStyles.cbtnPrimary,
),
),
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