Commit a8f47bb4 authored by Ravishan S.A.A's avatar Ravishan S.A.A

project welcome page initial

parent 1ce2159c
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:lottie/lottie.dart';
class WelcomePage extends StatelessWidget {
const WelcomePage({super.key});
@override
Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width;
var height = MediaQuery.of(context).size.height;
return Scaffold(
body: Container(
children: [
Text(
"Welcome",
style: GoogleFonts.abel(
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: width / 5,
),
),
Text(
"The all-in-one AI powered\nCinnamon cultivation help assistant",
style: GoogleFonts.abel(
color: Colors.white70,
fontSize: width / 15,
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
),
textAlign: TextAlign.center,
),
SizedBox(
height: height / 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ModuleCard(
bgColor: Colors.indigo.shade900,
title: Text(
"Forecasting",
style: GoogleFonts.poppins(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: width / 21,
),
textAlign: TextAlign.center,
),
lottie: "assets/lottie/90021-graph-stats.json",
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => Forecast(),
),
);
},
),
ModuleCard(
bgColor: Colors.white,
title: Text(
"Community",
style: GoogleFonts.poppins(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: width / 21,
),
textAlign: TextAlign.center,
),
lottie: "assets/lottie/99782-help.json",
onTap: () {},
),
],
),
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ModuleCard(
bgColor: Colors.lime,
title: Text(
"Grading",
style: GoogleFonts.poppins(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: width / 21,
),
textAlign: TextAlign.center,
),
lottie:
"assets/lottie/112180-paper-notebook-writing-animation.json",
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => GradesPrediction(),
),
);
},
),
ModuleCard(
bgColor: Colors.red,
title: Text(
"Diseases",
style: GoogleFonts.poppins(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: width / 21,
),
textAlign: TextAlign.center,
),
lottie:
"assets/lottie/102131-hand-holding-plant-seedling.json",
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseasePrediction(),
),
);
},
),
],
),
],
),
);
}
}
class ModuleCard extends StatelessWidget {
ModuleCard({
super.key,
required this.bgColor,
required this.title,
required this.lottie,
this.onTap,
});
Color bgColor;
Text title;
String lottie;
void Function()? onTap;
@override
Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width;
var height = MediaQuery.of(context).size.height;
return GestureDetector(
onTap: onTap,
child: Card(
elevation: 10,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
color: bgColor,
child: Container(
width: width / 2.5,
height: height / 4,
padding: EdgeInsets.symmetric(
vertical: height / 40,
horizontal: width / 20,
),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LottieBuilder.asset(
lottie,
reverse: true,
width: width / 3,
),
title,
],
),
),
),
),
);
}
}
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