88 lines
2.2 KiB
Dart
88 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:freekake/components/characcter_info.dart';
|
|
import 'package:freekake/components/skin_info.dart';
|
|
|
|
class SkinView extends StatefulWidget {
|
|
final String title;
|
|
final String imagePath;
|
|
final String content;
|
|
// caracter info
|
|
final String skinName;
|
|
final String skinOrigin;
|
|
|
|
const SkinView({
|
|
super.key,
|
|
required this.title,
|
|
required this.imagePath,
|
|
required this.content,
|
|
required this.skinName,
|
|
required this.skinOrigin,
|
|
});
|
|
|
|
@override
|
|
_SkinViewState createState() => _SkinViewState();
|
|
}
|
|
|
|
class _SkinViewState extends State<SkinView> {
|
|
late String _content;
|
|
late String _skinName;
|
|
late String _skinOrigin;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_content = widget.content;
|
|
_skinName = widget.skinName;
|
|
_skinOrigin = widget.skinOrigin;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final screenHeight = MediaQuery.of(context).size.height;
|
|
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: AppBar(
|
|
title: Text(widget.title),
|
|
backgroundColor: const Color.fromARGB(255, 79, 76, 182),
|
|
),
|
|
body: Column(
|
|
children: [
|
|
SizedBox(
|
|
height: 20,
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.only(
|
|
bottomLeft: Radius.circular(40),
|
|
bottomRight: Radius.circular(40),
|
|
),
|
|
color: Color.fromARGB(255, 79, 76, 182),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(height: 10),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: SizedBox(
|
|
height: screenHeight / 2,
|
|
width: double.infinity,
|
|
child: Image.asset(widget.imagePath, fit: BoxFit.fitHeight),
|
|
),
|
|
),
|
|
// Konten text scrollable
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
padding: const EdgeInsets.all(18.0),
|
|
child: SkinInfo(
|
|
nama: _skinName,
|
|
asal: _skinOrigin,
|
|
content: _content,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|