Compare commits

..

38 Commits

Author SHA1 Message Date
c7105d6110 Merge branch 'unity_embed' of https://git.probindo.com/Probindo/FreekakeApp into unity_embed 2025-05-10 23:14:31 +07:00
e15bfc0bef gradle config 2025-05-10 23:14:18 +07:00
442e56294f pubspec 2025-05-10 23:14:18 +07:00
2b7778b152 sebelum unity 2025-05-10 23:14:18 +07:00
d9b5e53e18 pubspec.lock 2025-05-10 23:11:03 +07:00
740f137913 mobile 2025-05-10 23:10:12 +07:00
89dbf1a900 mobile 2025-05-10 22:49:55 +07:00
9899809c18 config gradle unity 2025-05-10 22:38:40 +07:00
4040e8f91a mobile 2025-05-10 22:38:40 +07:00
fe2d68e786 mobile 2025-05-10 22:38:06 +07:00
f7ed9f5035 pubspec.lock 2025-05-10 22:37:32 +07:00
7cea1ea4c5 mobile 2025-05-10 22:36:22 +07:00
501d417b95 mobile 2025-05-10 22:33:16 +07:00
db213c151c config gradle unity 2025-05-10 22:24:42 +07:00
72aa4f9dfe mobile 2025-05-10 22:24:42 +07:00
7946df58d8 mobile 2025-05-10 22:24:22 +07:00
c08aeb999c mobile 2025-05-10 22:17:35 +07:00
206f99b561 main 2025-05-10 22:08:29 +07:00
e7945b1074 updated 2025-05-10 22:08:29 +07:00
dbafded5d2 mobile 2025-05-10 22:08:29 +07:00
fe66f466a2 mobile 2025-05-10 22:08:29 +07:00
06fe0bdd7e config gradle unity 2025-05-10 22:08:29 +07:00
00749179f6 mobile 2025-05-10 22:08:29 +07:00
15e85fc0dd mobile 2025-05-10 22:08:29 +07:00
52df106632 mobile 2025-05-10 22:08:29 +07:00
da4f3f9243 pubspec 2025-05-10 22:08:29 +07:00
5f8305289c updated 2025-05-10 22:08:29 +07:00
ecdad52570 Update README.md 2025-05-10 22:04:54 +07:00
1bd2a67868 Update README.md 2025-05-10 22:04:54 +07:00
fa47208e4e config gradle unity 2025-05-10 22:04:54 +07:00
41e0248b67 mobile 2025-05-10 22:04:54 +07:00
b330c207b7 mobile 2025-05-10 22:04:54 +07:00
17e955e3a9 pubspec.lock 2025-05-10 22:04:54 +07:00
ce76938284 gitignore dan beberapa yang terlewat 2025-05-10 22:04:54 +07:00
316d1937b4 config gradle unity 2025-05-10 22:04:54 +07:00
85a2655457 mobile 2025-05-10 22:04:54 +07:00
='fauz
a3c27a23b9 okey 2025-05-10 16:14:57 +07:00
='fauz
8478822f4a halaman baru 2025-05-10 14:48:08 +07:00
14 changed files with 717 additions and 49 deletions

View File

@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:freekake/components/bottom_navbar.dart';
import 'package:freekake/components/menu_button.dart';
import 'package:freekake/providers/menu_selection_provider.dart';
import 'package:freekake/components/scan_button.dart';
import 'package:freekake/screen/Home_screen.dart';
import 'package:freekake/screen/koleksi_screen.dart';
import 'package:freekake/screen/pustaka_screen.dart';
import 'package:freekake/screen/saya/profile_screen.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MainMenu extends StatefulWidget {
const MainMenu({super.key});

View File

@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:freekake/providers/point_provider.dart';
import 'package:provider/provider.dart';
class PointsHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
final points = context.watch<PointsProvider>().points;
return Container(
padding: EdgeInsets.all(12),
color: const Color.fromARGB(99, 255, 255, 255),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
"Activity", //${points.xp}/${points.xpToNextLevel()}",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
Text(
"",
// "🔥 Level: ${points.level}",
// style: TextStyle(color: Colors.orangeAccent),
),
Text(
"🏆",
// "💎 GP: ${points.gp}",
style: TextStyle(color: Colors.lightBlue),
),
Text(
"🟡",
// "🎯" SP: ${points.sp}",
style: TextStyle(color: Colors.greenAccent),
),
],
),
);
}
}

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:freekake/components/navbar_container.dart';
import 'package:freekake/providers/character_provider.dart';
import 'package:freekake/providers/menu_selection_provider.dart';
import 'package:freekake/providers/point_provider.dart';
import 'package:freekake/screen/Home_screen.dart';
import 'package:provider/provider.dart';
@ -27,6 +28,7 @@ class MyApp extends StatelessWidget {
providers: [
ChangeNotifierProvider(create: (context) => CharacterProvider()),
ChangeNotifierProvider(create: (context) => MenuSelectionProvider()),
ChangeNotifierProvider(create: (_) => PointsProvider()),
],
child: MaterialApp(
debugShowCheckedModeBanner: false,

View File

@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:freekake/util/player_point.dart';
class PointsProvider with ChangeNotifier {
PlayerPoints _points = PlayerPoints(xp: 0, gp: 0, sp: 0, level: 1);
PlayerPoints get points => _points;
void gainXP(int value) {
_points.addXP(value);
notifyListeners();
}
void gainGP(int value) {
_points.addGP(value);
notifyListeners();
}
void gainSP(int value) {
_points.addSP(value);
notifyListeners();
}
}

View File

@ -242,9 +242,12 @@ class _HomeScreenState extends State<HomeScreen> {
class _MenuItems {
static const List<MenuItem> firstItems = [like, share, download];
static const List<MenuItem> secondItems = [cancel];
static const like = MenuItem(text: 'Like', icon: Icons.favorite);
static const share = MenuItem(text: 'Share', icon: Icons.share);
static const download = MenuItem(text: 'Download', icon: Icons.download);
static const like = MenuItem(text: 'Hello', icon: Icons.favorite);
static const share = MenuItem(text: 'Furikake', icon: Icons.share);
static const download = MenuItem(
text: 'Makanan Bergizi',
icon: Icons.download,
);
static const cancel = MenuItem(text: 'Cancel', icon: Icons.cancel);
static Widget buildItem(MenuItem item) {

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:freekake/components/collection_container.dart';
import 'package:freekake/screen/collection/character_view.dart';
class CollectionCaraterScreen extends StatefulWidget {
const CollectionCaraterScreen({super.key});
@ -23,13 +22,7 @@ class _CollectionCaraterScreenState extends State<CollectionCaraterScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Favorite",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Text("Favorit", style: TextStyle(color: Colors.black)),
Divider(height: 20, color: Colors.transparent),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
@ -77,13 +70,7 @@ class _CollectionCaraterScreenState extends State<CollectionCaraterScreen> {
),
),
Divider(height: 20, color: Colors.transparent),
Text(
"All",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Text("Semua", style: TextStyle(color: Colors.black)),
Divider(height: 20, color: Colors.transparent),
SingleChildScrollView(
scrollDirection: Axis.horizontal,

View File

@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:freekake/components/collection_container.dart';
import 'package:freekake/screen/collection/character_view.dart';
import 'package:freekake/screen/collection/skin_view.dart';
class CollectionSkinScreen extends StatefulWidget {
const CollectionSkinScreen({super.key});

View File

@ -2,13 +2,13 @@ import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:freekake/components/buildcard_info.dart';
import 'package:freekake/components/card_list.dart';
import 'package:freekake/components/collection_container%20copy.dart';
import 'package:freekake/components/main_menu.dart';
import 'package:freekake/components/topbar_container.dart';
import 'package:freekake/screen/pustaka/pustaka_detail_screen.dart';
import 'package:freekake/helpers/color_helper.dart';
import 'package:list_detail_extension/list_detail_extension.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
class ListEducation extends StatefulWidget {
const ListEducation({super.key});

View File

@ -124,16 +124,15 @@ class _AkunSayaState extends State<AkunSaya> {
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "Jl. Sentosa jaya",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Alamat',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
// TextFormField(
// initialValue: "Jl. Sentosa jaya",
// decoration: const InputDecoration(
// border: UnderlineInputBorder(),
// labelText: 'Alamat',
// labelStyle: TextStyle(color: Colors.black),
// ),
// style: TextStyle(color: Colors.black),
// ),
TextFormField(
initialValue: "******",
decoration: const InputDecoration(
@ -143,15 +142,6 @@ class _AkunSayaState extends State<AkunSaya> {
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "+62923",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'No. HP',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
],
),
),

View File

@ -0,0 +1,260 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:freekake/components/bottom_navbar.dart';
import 'package:freekake/components/main_menu.dart';
import 'package:freekake/components/scan_button.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';
// import 'package:image_picker_web/image_picker_web.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
class DataSaya extends StatefulWidget {
const DataSaya({super.key});
@override
_DataSayaState createState() => _DataSayaState();
}
class _DataSayaState extends State<DataSaya> {
dynamic _profileImage;
dynamic _headerImage;
ImageProvider? imageProvider;
final ImagePicker _picker = ImagePicker();
Future<void> _pickImage(bool isProfile) async {
if (kIsWeb) {
// Uint8List? bytesFromPicker = await ImagePickerWeb.getImageAsBytes();
// if (bytesFromPicker != null) {
// setState(() {
// if (isProfile) {
// _profileImage = bytesFromPicker;
// } else {
// _headerImage = bytesFromPicker;
// }
// });
// }
} else {
final pickedFile = await _picker.pickImage(source: ImageSource.gallery);
if (pickedFile != null) {
final imageFile = File(pickedFile.path);
setState(() {
if (isProfile) {
_profileImage = imageFile;
} else {
_headerImage = imageFile;
}
imageProvider =
kIsWeb ? MemoryImage(_profileImage) : FileImage(_profileImage);
});
} else {
imageProvider = AssetImage("assets/images/luffy.png");
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Data Pribadi"),
backgroundColor: Color.fromARGB(225, 79, 76, 182),
),
resizeToAvoidBottomInset: false,
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
body: Stack(
children: [
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(top: 0.0, left: 20, right: 20),
child: Container(
height: MediaQuery.of(context).size.height * 0.7,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: const Color.fromARGB(255, 212, 211, 208),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
),
),
),
),
Column(
children: [
SizedBox(
height: 80,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(40),
bottomRight: Radius.circular(40),
),
color: Color.fromARGB(225, 79, 76, 182),
),
),
),
SizedBox(height: 70),
Expanded(
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 40),
children: [
TextFormField(
initialValue: "Hasan",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Nama Siswa',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "Jawa Barat",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Provinsi',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "Bandung",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Kabupaten',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "SDN 1 Bandung Barat",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Sekolah',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "Laki-laki",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Jenis Kelamin',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "Bandung 13-05-2025",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Sekolah',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "56 Kg",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Berat Badan',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
TextFormField(
initialValue: "170",
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Tinggi Badan',
labelStyle: TextStyle(color: Colors.black),
),
style: TextStyle(color: Colors.black),
),
],
),
),
),
],
),
// Profile Picture (bisa diubah)
Positioned(
top: 25,
left: MediaQuery.of(context).size.width / 2 - 50,
child: GestureDetector(
onTap: () => _pickImage(true),
child: Stack(
alignment: Alignment.bottomRight,
children: [
CircleAvatar(
radius: 50,
backgroundColor: Colors.grey[300],
backgroundImage:
_profileImage != null
? (kIsWeb
? MemoryImage(_profileImage) as ImageProvider
: FileImage(_profileImage) as ImageProvider)
: null,
child:
_profileImage == null
? Image.asset("assets/images/luffy.png")
: null,
),
CircleAvatar(
radius: 15,
backgroundColor: Colors.blue,
child: Icon(Icons.edit, color: Colors.white, size: 15),
),
],
),
),
),
Positioned(
top: 130,
left: MediaQuery.of(context).size.width / 2 - 30,
child: GestureDetector(
onTap: () => _pickImage(true),
child: Stack(
alignment: Alignment.bottomRight,
children: [
Text(
"Luffy kun",
style: TextStyle(
color: Colors.deepPurple,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
],
),
);
}
Widget _buildListItem(IconData icon, String label, {bool isLogout = false}) {
return ListTile(
leading: Icon(
icon,
color:
isLogout
? const Color.fromARGB(255, 181, 47, 47)
: const Color.fromARGB(255, 255, 255, 255),
),
title: Text(label, style: TextStyle(fontSize: 16, color: Colors.black)),
trailing: Icon(Icons.arrow_forward_ios, size: 16),
onTap: () {},
);
}
}

View File

@ -0,0 +1,305 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:freekake/components/bottom_navbar.dart';
import 'package:freekake/components/main_menu.dart';
import 'package:freekake/components/point_header.dart';
import 'package:freekake/components/scan_button.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';
// import 'package:image_picker_web/image_picker_web.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
class PointSaya extends StatefulWidget {
const PointSaya({super.key});
@override
_PointSayaState createState() => _PointSayaState();
}
class _PointSayaState extends State<PointSaya> {
dynamic _profileImage;
dynamic _headerImage;
ImageProvider? imageProvider;
final ImagePicker _picker = ImagePicker();
Future<void> _pickImage(bool isProfile) async {
if (kIsWeb) {
// Uint8List? bytesFromPicker = await ImagePickerWeb.getImageAsBytes();
// if (bytesFromPicker != null) {
// setState(() {
// if (isProfile) {
// _profileImage = bytesFromPicker;
// } else {
// _headerImage = bytesFromPicker;
// }
// });
// }
} else {
final pickedFile = await _picker.pickImage(source: ImageSource.gallery);
if (pickedFile != null) {
final imageFile = File(pickedFile.path);
setState(() {
if (isProfile) {
_profileImage = imageFile;
} else {
_headerImage = imageFile;
}
imageProvider =
kIsWeb ? MemoryImage(_profileImage) : FileImage(_profileImage);
});
} else {
imageProvider = AssetImage("assets/images/luffy.png");
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Point Saya"),
backgroundColor: Color.fromARGB(225, 79, 76, 182),
),
resizeToAvoidBottomInset: false,
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
body: Stack(
children: [
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(top: 0.0, left: 20, right: 20),
child: Container(
height: MediaQuery.of(context).size.height * 0.7,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: const Color.fromARGB(150, 137, 123, 69),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
),
child: Column(
spacing: 10,
children: [
SizedBox(height: 4),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 20,
vertical: 10,
),
decoration: BoxDecoration(
color: const Color.fromARGB(255, 191, 184, 184),
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(color: Colors.black12, blurRadius: 8),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(height: 5),
Row(
children: [
// Image.asset(
// 'assets/icons/diamond.png',
// width: 24,
// ),
Text(
"Total Point",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
SizedBox(width: 8),
Text(
"300",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
],
),
Row(
children: [
// Image.asset('assets/icons/coin.png', width: 24),
Text(
"Total Koin",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
SizedBox(width: 8),
Text(
"60",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
],
),
SizedBox(height: 5),
],
),
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(padding: EdgeInsets.all(8)),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Center(
child: Text(
"Riwayat poin dan koin",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white60,
),
),
),
// color: Colors.amber,
),
],
),
PointsHeader(),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: 40),
Text("Furikake", style: TextStyle(color: Colors.white)),
SizedBox(width: 130),
Text(
"",
// "🔥 Level: ${points.level}",
// style: TextStyle(color: Colors.orangeAccent),
),
Text("100", style: TextStyle(color: Colors.lightBlue)),
SizedBox(width: 60),
Text("20", style: TextStyle(color: Colors.greenAccent)),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: 40),
Text("Furikake", style: TextStyle(color: Colors.white)),
SizedBox(width: 130),
Text(
"",
// "🔥 Level: ${points.level}",
// style: TextStyle(color: Colors.orangeAccent),
),
Text("100", style: TextStyle(color: Colors.lightBlue)),
SizedBox(width: 60),
Text("20", style: TextStyle(color: Colors.greenAccent)),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: 40),
Text("Furikake", style: TextStyle(color: Colors.white)),
SizedBox(width: 130),
Text(
"",
// "🔥 Level: ${points.level}",
// style: TextStyle(color: Colors.orangeAccent),
),
Text("100", style: TextStyle(color: Colors.lightBlue)),
SizedBox(width: 60),
Text("20", style: TextStyle(color: Colors.greenAccent)),
],
),
],
),
),
),
),
// Profile Picture (bisa diubah)
Positioned(
top: 25,
left: MediaQuery.of(context).size.width / 2 - 50,
child: GestureDetector(
onTap: () => _pickImage(true),
child: Stack(
alignment: Alignment.bottomRight,
children: [
CircleAvatar(
radius: 50,
backgroundColor: Colors.grey[300],
backgroundImage:
_profileImage != null
? (kIsWeb
? MemoryImage(_profileImage) as ImageProvider
: FileImage(_profileImage) as ImageProvider)
: null,
child:
_profileImage == null
? Image.asset("assets/images/luffy.png")
: null,
),
CircleAvatar(
radius: 15,
backgroundColor: Colors.blue,
child: Icon(Icons.edit, color: Colors.white, size: 15),
),
],
),
),
),
Positioned(
top: 130,
left: MediaQuery.of(context).size.width / 2 - 30,
child: GestureDetector(
onTap: () => _pickImage(true),
child: Stack(
alignment: Alignment.bottomRight,
children: [
Text(
"Luffy kun",
style: TextStyle(
color: Colors.deepPurple,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
],
),
);
}
Widget _buildListItem(IconData icon, String label, {bool isLogout = false}) {
return ListTile(
leading: Icon(
icon,
color:
isLogout
? const Color.fromARGB(255, 181, 47, 47)
: const Color.fromARGB(255, 255, 255, 255),
),
title: Text(label, style: TextStyle(fontSize: 16, color: Colors.black)),
trailing: Icon(Icons.arrow_forward_ios, size: 16),
onTap: () {},
);
}
}

View File

@ -7,6 +7,8 @@ import 'package:freekake/components/main_menu.dart';
import 'package:freekake/components/scan_button.dart';
import 'package:freekake/components/topbar_container.dart';
import 'package:freekake/screen/saya/akun_saya.dart';
import 'package:freekake/screen/saya/data_saya.dart';
import 'package:freekake/screen/saya/point_saya.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';
@ -214,12 +216,24 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Divider(height: 0),
),
_buildListItem(Icons.person, "Data Diri", () => {}),
_buildListItem(Icons.person, "Data Diri", () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => DataSaya()),
);
}),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Divider(height: 0),
),
_buildListItem(Icons.person, "Point Saya", () => {}),
_buildListItem(Icons.person, "Point Saya", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PointSaya(),
),
);
}),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25.0,

View File

@ -0,0 +1,31 @@
class PlayerPoints {
int xp;
int gp;
int sp;
int level;
PlayerPoints({
required this.xp,
required this.gp,
required this.sp,
required this.level,
});
void addXP(int value) {
xp += value;
if (xp >= xpToNextLevel()) {
levelUp();
}
}
void addGP(int value) => gp += value;
void addSP(int value) => sp += value;
int xpToNextLevel() => 1000 + (level * 200);
void levelUp() {
level++;
sp++;
xp = 0;
}
}

View File

@ -822,7 +822,23 @@ packages:
sha256: "18b1640839cf6546784a524c72aded5b6e86b23e7167dc2311cc96f7658b64bd"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
version: "2.10.0"
webview_flutter_web:
dependency: transitive
description:
name: webview_flutter_web
sha256: "18a7ccc1c31dd9a5c759a1b7217a2a1e04bd8f65712714a4070bfac19a23ca9e"
url: "https://pub.dev"
source: hosted
version: "0.2.3+4"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_web
sha256: "18a7ccc1c31dd9a5c759a1b7217a2a1e04bd8f65712714a4070bfac19a23ca9e"
url: "https://pub.dev"
source: hosted
version: "0.2.3+4"
webview_flutter_wkwebview:
dependency: "direct main"
description: