125 lines
3.8 KiB
Dart
125 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:google_fonts/google_fonts.dart'; // Tambahkan ini!
|
|
|
|
import '../controllers/start_controller.dart';
|
|
|
|
class StartView extends GetView<StartController> {
|
|
const StartView({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Stack(
|
|
children: [
|
|
// Background atas bergelombang
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
child: CustomPaint(
|
|
size: Size(MediaQuery.of(context).size.width, 150),
|
|
painter: WavePainter(isTop: true),
|
|
),
|
|
),
|
|
// Background bawah bergelombang
|
|
Positioned(
|
|
bottom: 0,
|
|
left: 0,
|
|
right: 0,
|
|
child: CustomPaint(
|
|
size: Size(MediaQuery.of(context).size.width, 100),
|
|
painter: WavePainter(isTop: false),
|
|
),
|
|
),
|
|
// Isi utama
|
|
Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const Text(
|
|
'Selamat Datang',
|
|
style: TextStyle(
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.black87,
|
|
),
|
|
),
|
|
const SizedBox(height: 8),
|
|
const Text(
|
|
'Masuk ke Beranda.',
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
const SizedBox(height: 30),
|
|
Image.asset(
|
|
'assets/images/kacamatapintar.png',
|
|
width: 150,
|
|
height: 150,
|
|
),
|
|
const SizedBox(height: 40),
|
|
SizedBox(
|
|
width: 200,
|
|
height: 50,
|
|
child: ElevatedButton(
|
|
onPressed: () {
|
|
controller.goToHome();
|
|
},
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: Colors.blue,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
),
|
|
child: Text(
|
|
'Masuk',
|
|
style: GoogleFonts.poppins(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// Widget untuk membuat efek gelombang di atas dan bawah
|
|
class WavePainter extends CustomPainter {
|
|
final bool isTop;
|
|
WavePainter({required this.isTop});
|
|
|
|
@override
|
|
void paint(Canvas canvas, Size size) {
|
|
Paint paint = Paint()..color = Colors.blue;
|
|
Path path = Path();
|
|
|
|
if (isTop) {
|
|
path.moveTo(0, 0);
|
|
path.quadraticBezierTo(size.width * 0.25, 100, size.width * 0.5, 60);
|
|
path.quadraticBezierTo(size.width * 0.75, 10, size.width, 40);
|
|
path.lineTo(size.width, 0);
|
|
} else {
|
|
path.moveTo(0, size.height);
|
|
path.quadraticBezierTo(size.width * 0.25, size.height - 100, size.width * 0.5, size.height - 60);
|
|
path.quadraticBezierTo(size.width * 0.75, size.height - 10, size.width, size.height - 40);
|
|
path.lineTo(size.width, size.height);
|
|
}
|
|
|
|
path.close();
|
|
canvas.drawPath(path, paint);
|
|
}
|
|
|
|
@override
|
|
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
|
}
|