Compare commits

..
41 Commits
Author SHA1 Message Date
irwan.l.cahyono c7105d6110 Merge branch 'unity_embed' of https://git.probindo.com/Probindo/FreekakeApp into unity_embed 2025-05-10 23:14:31 +07:00
irwan.l.cahyono e15bfc0bef gradle config 2025-05-10 23:14:18 +07:00
irwan.l.cahyono 442e56294f pubspec 2025-05-10 23:14:18 +07:00
irwan.l.cahyono 2b7778b152 sebelum unity 2025-05-10 23:14:18 +07:00
irwan.l.cahyono d9b5e53e18 pubspec.lock 2025-05-10 23:11:03 +07:00
irwan.l.cahyono 740f137913 mobile 2025-05-10 23:10:12 +07:00
irwan.l.cahyono 89dbf1a900 mobile 2025-05-10 22:49:55 +07:00
irwan.l.cahyono 9899809c18 config gradle unity 2025-05-10 22:38:40 +07:00
irwan.l.cahyono 4040e8f91a mobile 2025-05-10 22:38:40 +07:00
irwan.l.cahyono fe2d68e786 mobile 2025-05-10 22:38:06 +07:00
irwan.l.cahyono f7ed9f5035 pubspec.lock 2025-05-10 22:37:32 +07:00
irwan.l.cahyono 7cea1ea4c5 mobile 2025-05-10 22:36:22 +07:00
irwan.l.cahyono 501d417b95 mobile 2025-05-10 22:33:16 +07:00
irwan.l.cahyono db213c151c config gradle unity 2025-05-10 22:24:42 +07:00
irwan.l.cahyono 72aa4f9dfe mobile 2025-05-10 22:24:42 +07:00
irwan.l.cahyono 7946df58d8 mobile 2025-05-10 22:24:22 +07:00
irwan.l.cahyono c08aeb999c mobile 2025-05-10 22:17:35 +07:00
irwan.l.cahyono 206f99b561 main 2025-05-10 22:08:29 +07:00
irwan.l.cahyono e7945b1074 updated 2025-05-10 22:08:29 +07:00
irwan.l.cahyono dbafded5d2 mobile 2025-05-10 22:08:29 +07:00
irwan.l.cahyono fe66f466a2 mobile 2025-05-10 22:08:29 +07:00
irwan.l.cahyono 06fe0bdd7e config gradle unity 2025-05-10 22:08:29 +07:00
irwan.l.cahyono 00749179f6 mobile 2025-05-10 22:08:29 +07:00
irwan.l.cahyono 15e85fc0dd mobile 2025-05-10 22:08:29 +07:00
irwan.l.cahyono 52df106632 mobile 2025-05-10 22:08:29 +07:00
irwan.l.cahyono da4f3f9243 pubspec 2025-05-10 22:08:29 +07:00
irwan.l.cahyono 5f8305289c updated 2025-05-10 22:08:29 +07:00
irwan.l.cahyono ecdad52570 Update README.md 2025-05-10 22:04:54 +07:00
irwan.l.cahyono 1bd2a67868 Update README.md 2025-05-10 22:04:54 +07:00
irwan.l.cahyono fa47208e4e config gradle unity 2025-05-10 22:04:54 +07:00
irwan.l.cahyono 41e0248b67 mobile 2025-05-10 22:04:54 +07:00
irwan.l.cahyono b330c207b7 mobile 2025-05-10 22:04:54 +07:00
irwan.l.cahyono 17e955e3a9 pubspec.lock 2025-05-10 22:04:54 +07:00
irwan.l.cahyono ce76938284 gitignore dan beberapa yang terlewat 2025-05-10 22:04:54 +07:00
irwan.l.cahyono 316d1937b4 config gradle unity 2025-05-10 22:04:54 +07:00
irwan.l.cahyono 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
irwan.l.cahyono d2d45ad685 gradle config 2025-05-09 02:00:18 +07:00
irwan.l.cahyono 86b1f67dda pubspec 2025-05-09 01:59:25 +07:00
irwan.l.cahyono 0e985f5453 sebelum unity 2025-05-09 01:42:10 +07:00
22 changed files with 928 additions and 296 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ plugins {
} }
android { android {
namespace = "com.example.furibase" namespace = "com.paj.freekake"
//compileSdk = flutter.compileSdkVersion //compileSdk = flutter.compileSdkVersion
compileSdk = 35 compileSdk = 35
//ndkVersion = "27.0.12077973" //ndkVersion = "27.0.12077973"
+1 -1
View File
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application <application
android:label="furibase" android:label="freekake"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
+2 -1
View File
@@ -1,5 +1,6 @@
#Thu May 08 22:45:23 WIB 2025
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
+5 -6
View File
@@ -1,10 +1,9 @@
import 'package:freekake/components/navbar_shape_3.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:furibase/components/navbar_container.dart'; import 'package:freekake/components/navbar_container.dart';
import 'package:furibase/components/navbar_shape_1.dart'; import 'package:freekake/components/navbar_shape_1.dart';
import 'package:furibase/components/navbar_shape_2.dart'; import 'package:freekake/components/navbar_shape_2.dart';
import 'package:furibase/components/navbar_shape_3.dart'; import 'package:freekake/components/navbar_shape_3.dart';
import 'package:furibase/components/custom_shape.dart'; import 'package:freekake/components/custom_shape.dart';
class BottomNavbar extends StatefulWidget { class BottomNavbar extends StatefulWidget {
const BottomNavbar({super.key}); const BottomNavbar({super.key});
+11 -10
View File
@@ -53,6 +53,7 @@ class CardList extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const SizedBox(height: 1, width: 5),
Text( Text(
title, title,
style: const TextStyle( style: const TextStyle(
@@ -61,16 +62,16 @@ class CardList extends StatelessWidget {
), ),
), ),
const SizedBox(height: 1, width: 5), const SizedBox(height: 1, width: 5),
Text( // Text(
body, // body,
style: const TextStyle( // style: const TextStyle(
letterSpacing: 0.2, // letterSpacing: 0.2,
fontSize: 14, // fontSize: 14,
fontWeight: FontWeight.normal, // fontWeight: FontWeight.normal,
), // ),
maxLines: 2, // maxLines: 2,
overflow: TextOverflow.ellipsis, // overflow: TextOverflow.ellipsis,
), // ),
const Spacer(), const Spacer(),
Padding( Padding(
padding: EdgeInsets.all(0.08), padding: EdgeInsets.all(0.08),
+3 -3
View File
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:freekake/providers/menu_selection_provider.dart'; import 'package:freekake/components/bottom_navbar.dart';
import 'package:freekake/components/menu_button.dart';
import 'package:freekake/components/scan_button.dart';
import 'package:freekake/screen/Home_screen.dart'; import 'package:freekake/screen/Home_screen.dart';
import 'package:freekake/screen/koleksi_screen.dart'; import 'package:freekake/screen/koleksi_screen.dart';
import 'package:freekake/screen/pustaka_screen.dart'; import 'package:freekake/screen/pustaka_screen.dart';
import 'package:freekake/screen/saya/profile_screen.dart'; import 'package:freekake/screen/saya/profile_screen.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MainMenu extends StatefulWidget { class MainMenu extends StatefulWidget {
const MainMenu({super.key}); const MainMenu({super.key});
+39
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),
),
],
),
);
}
}
+7 -5
View File
@@ -2,18 +2,19 @@ import 'package:flutter/material.dart';
import 'package:freekake/components/navbar_container.dart'; import 'package:freekake/components/navbar_container.dart';
import 'package:freekake/providers/character_provider.dart'; import 'package:freekake/providers/character_provider.dart';
import 'package:freekake/providers/menu_selection_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:freekake/screen/Home_screen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); // SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
await SystemChrome.setPreferredOrientations([ // await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp, // DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown, // bisa dihapus jika hanya ingin satu arah // DeviceOrientation.portraitDown, // bisa dihapus jika hanya ingin satu arah
]); // ]);
runApp(const MyApp()); runApp(const MyApp());
} }
@@ -27,6 +28,7 @@ class MyApp extends StatelessWidget {
providers: [ providers: [
ChangeNotifierProvider(create: (context) => CharacterProvider()), ChangeNotifierProvider(create: (context) => CharacterProvider()),
ChangeNotifierProvider(create: (context) => MenuSelectionProvider()), ChangeNotifierProvider(create: (context) => MenuSelectionProvider()),
ChangeNotifierProvider(create: (_) => PointsProvider()),
], ],
child: MaterialApp( child: MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
+23
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();
}
}
+161 -213
View File
@@ -51,173 +51,165 @@ class _HomeScreenState extends State<HomeScreen> {
return Stack( return Stack(
children: <Widget>[ children: <Widget>[
Positioned.fill( Positioned.fill(
child: RepaintBoundary( child: UnityWidget(
child: Container( onUnityCreated: onUnityCreated,
decoration: const BoxDecoration( //isARScene: true,
image: DecorationImage( onUnityMessage: onUnityMessage,
image: AssetImage("assets/images/background.jpeg"), //onUnitySceneLoaded: onUnitySceneLoaded,
fit: BoxFit.cover, fullscreen: false,
),
),
),
), ),
// Positioned( ),
// top: 0, // Positioned.fill(
// left: 0, // child: RepaintBoundary(
// right: 0, // child: Container(
// child: SizedBox(height: 120, child: TopbarContainer()), // decoration: const BoxDecoration(
// ), // image: DecorationImage(
// Positioned( // image: AssetImage("assets/images/background.jpeg"),
// right: 0, // fit: BoxFit.cover,
// top: 100, // ),
// child: Padding( // ),
// padding: EdgeInsets.only(right: 20), // ),
// child: Container( // ),
// width: 40, // ),
// height: 40,
// decoration: BoxDecoration( // Positioned(
// borderRadius: BorderRadius.circular(1), // right: 0,
// color: Color.fromARGB(1, 209, 174, 174).withAlpha(0), // top: 100,
// ), // child: Padding(
// child: Center( // padding: EdgeInsets.only(right: 20),
// child: DropdownButtonHideUnderline( // child: Container(
// child: DropdownButton2( // width: 40,
// customButton: Container( // height: 40,
// height: 50, // decoration: BoxDecoration(
// width: 50, // borderRadius: BorderRadius.circular(1),
// decoration: BoxDecoration( // color: Color.fromARGB(1, 209, 174, 174).withAlpha(0),
// borderRadius: BorderRadius.circular(10), // ),
// image: const DecorationImage( // child: Center(
// image: AssetImage('assets/images/luffy-u.png'), // child: DropdownButtonHideUnderline(
// fit: BoxFit.cover, // child: DropdownButton2(
// ), // customButton: Container(
// ), // height: 50,
// ), // width: 50,
// openWithLongPress: false, // decoration: BoxDecoration(
// items: [ // borderRadius: BorderRadius.circular(10),
// ..._MenuItems.firstItems.map( // image: const DecorationImage(
// (item) => DropdownMenuItem<_MenuItem>( // image: AssetImage('assets/images/cepot-u.png'),
// value: item, // fit: BoxFit.cover,
// child: _MenuItems.buildItem(item), // ),
// ), // ),
// ), // ),
// // const DropdownMenuItem<Divider>( // openWithLongPress: false,
// // enabled: false, // items: [
// // // height: 8, // ..._MenuItems.firstItems.map(
// // child: Divider(), // (item) => DropdownMenuItem<MenuItem>(
// // ), // value: item,
// // ..._MenuItems.secondItems.map( // child: _MenuItems.buildItem(item),
// // (item) => DropdownMenuItem<_MenuItem>( // ),
// // value: item, // ),
// // // height: 48, // ],
// // child: _MenuItems.buildItem(item), // onChanged: (value) {
// // ), // if (value != null) {
// // ), // _MenuItems.onChanged(context, value);
// ], // } else {
// onChanged: (value) { // print("null");
// if (value != null) { // }
// _MenuItems.onChanged(context, value); // },
// } else { // buttonStyleData: ButtonStyleData(
// print("null"); // decoration: BoxDecoration(
// } // borderRadius: BorderRadius.circular(40),
// }, // ),
// buttonStyleData: ButtonStyleData( // ),
// decoration: BoxDecoration( // dropdownStyleData: DropdownStyleData(
// borderRadius: BorderRadius.circular(40), // width: 140,
// ), // padding: EdgeInsets.zero,
// ), // maxHeight: 150,
// dropdownStyleData: DropdownStyleData( // // padding: const EdgeInsets.symmetric(vertical: 6),
// width: 140, // decoration: BoxDecoration(
// padding: EdgeInsets.zero, // borderRadius: BorderRadius.circular(4),
// maxHeight: 150, // color: Color.fromRGBO(2, 104, 17, 1).withAlpha(50),
// // padding: const EdgeInsets.symmetric(vertical: 6), // ),
// decoration: BoxDecoration( // offset: const Offset(40, -4),
// borderRadius: BorderRadius.circular(4), // ),
// color: Color.fromRGBO(2, 104, 17, 1).withAlpha(50), // menuItemStyleData: MenuItemStyleData(
// ), // height: 35,
// offset: const Offset(40, -4), // padding: EdgeInsets.symmetric(horizontal: 10),
// ), // ),
// menuItemStyleData: MenuItemStyleData( // // menuItemStyleData: const MenuItemStyleData(
// height: 35, // // padding: EdgeInsets.only(left: 16, right: 16),
// padding: EdgeInsets.symmetric(horizontal: 10), // // ),
// ), // ),
// // menuItemStyleData: const MenuItemStyleData( // ),
// // padding: EdgeInsets.only(left: 16, right: 16), // ),
// // ), // ),
// ), // ),
// ), // ),
// ), Positioned(
// ), top: 10,
// ), left: 10,
// ), right: 10,
Positioned( child: Row(
top: 10, mainAxisAlignment: MainAxisAlignment.spaceBetween,
left: 10,
right: 10,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BuildcardInfo(
icon: Icons.person,
text: username,
extraIcon: Icons.emoji_events,
extraText: "5000",
width: 180,
),
BuildcardInfo(
icon: Icons.monetization_on,
text: "1.300",
width: 90,
),
],
),
),
// Positioned(
// bottom: 150,
// left: 0,
// right: 0,
// child: Column(
// children: [
// Container(
// padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
// decoration: BoxDecoration(
// color: Color.fromARGB(255, 247, 224, 236),
// borderRadius: BorderRadius.circular(10),
// boxShadow: [
// BoxShadow(
// color: Color.fromARGB(255, 214, 213, 121),
// blurRadius: 5,
// spreadRadius: 2,
// ),
// ],
// ),
// child: Text(
// "Halo....Jotaslim",
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.bold,
// color: Color(0xFF000000),
// ),
// ),
// ),
// SizedBox(height: 10),
// setHomeImage("images/luffy.png", 300),
// // Image.asset("images/luffy.png", width: 300),
// ],
// ),
// ),
// BG MEnu
Stack(
children: [ children: [
Positioned( BuildcardInfo(
bottom: 0, icon: Icons.person,
left: 0, text: username,
right: 0, extraIcon: Icons.emoji_events,
child: SizedBox(height: 85, child: BottomNavbar()), extraText: "5000",
width: 180,
),
BuildcardInfo(
icon: Icons.monetization_on,
text: "1.300",
width: 90,
), ),
], ],
), ),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), ),
// Positioned(
// bottom: 150,
// left: 0,
// right: 0,
// child: Column(
// children: [
// Container(
// padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
// decoration: BoxDecoration(
// color: Color.fromARGB(255, 247, 224, 236),
// borderRadius: BorderRadius.circular(10),
// boxShadow: [
// BoxShadow(
// color: Color.fromARGB(255, 214, 213, 121),
// blurRadius: 5,
// spreadRadius: 2,
// ),
// ],
// ),
// child: Text(
// "Halo....Jotaslim",
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.bold,
// color: Color(0xFF000000),
// ),
// ),
// ),
// SizedBox(height: 10),
// //setHomeImage("assets/images/cepott.png", 300),
// ],
// ),
// ),
// BG MEnu
Stack(
children: [
Positioned(
bottom: 0,
left: 0,
right: 0,
child: SizedBox(height: 85, child: BottomNavbar()),
),
],
),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: bottom:
@@ -234,55 +226,8 @@ class _HomeScreenState extends State<HomeScreen> {
); );
} }
void onUnityCreated(controller) {
_unityWidgetController = controller;
}
void onUnityMessage(message) {
print('Received message from unity: ${message.toString()}');
}
// Widget _menuButton(String label, Widget icon) {
// return Expanded(
// child: Column(
// children: [
// IconButton(
// // icon: Icon(icon, color: Color.fromARGB(255, 179, 161, 170)),
// icon: icon,
// onPressed: () {},
// ),
// Text(
// label,
// style: TextStyle(
// color: Color.fromARGB(255, 239, 224, 232),
// fontWeight: FontWeight.bold,
// ),
// ),
// ],
// ),
// );
// }
// Widget _scanButton() {
// return Expanded(
// child: Container(
// decoration: BoxDecoration(shape: BoxShape.circle, color: transparent),
// padding: EdgeInsets.all(10),
// child: IconButton(
// icon: SvgPicture.asset(
// 'icons/Scan.svg',
// width: 60,
// height: 60,
// colorFilter: ColorFilter.mode(Color(0xFFFFFFFF), BlendMode.srcIn),
// ),
// onPressed: () {},
// ),
// ),
// );
// }
Widget setHomeImage(String src, double size) { Widget setHomeImage(String src, double size) {
return Image.asset("assets/" + src, width: size); return Image.asset(src, width: size);
} }
void onUnityCreated(controller) { void onUnityCreated(controller) {
@@ -297,9 +242,12 @@ class _HomeScreenState extends State<HomeScreen> {
class _MenuItems { class _MenuItems {
static const List<MenuItem> firstItems = [like, share, download]; static const List<MenuItem> firstItems = [like, share, download];
static const List<MenuItem> secondItems = [cancel]; static const List<MenuItem> secondItems = [cancel];
static const like = MenuItem(text: 'Like', icon: Icons.favorite); static const like = MenuItem(text: 'Hello', icon: Icons.favorite);
static const share = MenuItem(text: 'Share', icon: Icons.share); static const share = MenuItem(text: 'Furikake', icon: Icons.share);
static const download = MenuItem(text: 'Download', icon: Icons.download); static const download = MenuItem(
text: 'Makanan Bergizi',
icon: Icons.download,
);
static const cancel = MenuItem(text: 'Cancel', icon: Icons.cancel); static const cancel = MenuItem(text: 'Cancel', icon: Icons.cancel);
static Widget buildItem(MenuItem item) { static Widget buildItem(MenuItem item) {
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:freekake/components/collection_container.dart'; import 'package:freekake/components/collection_container.dart';
import 'package:freekake/screen/collection/character_view.dart';
class CollectionCaraterScreen extends StatefulWidget { class CollectionCaraterScreen extends StatefulWidget {
const CollectionCaraterScreen({super.key}); const CollectionCaraterScreen({super.key});
@@ -23,13 +22,7 @@ class _CollectionCaraterScreenState extends State<CollectionCaraterScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text("Favorit", style: TextStyle(color: Colors.black)),
"Favorite",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Divider(height: 20, color: Colors.transparent), Divider(height: 20, color: Colors.transparent),
SingleChildScrollView( SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@@ -77,13 +70,7 @@ class _CollectionCaraterScreenState extends State<CollectionCaraterScreen> {
), ),
), ),
Divider(height: 20, color: Colors.transparent), Divider(height: 20, color: Colors.transparent),
Text( Text("Semua", style: TextStyle(color: Colors.black)),
"All",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Divider(height: 20, color: Colors.transparent), Divider(height: 20, color: Colors.transparent),
SingleChildScrollView( SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:freekake/components/collection_container.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 { class CollectionSkinScreen extends StatefulWidget {
const CollectionSkinScreen({super.key}); const CollectionSkinScreen({super.key});
+5 -5
View File
@@ -2,13 +2,13 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; 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/card_list.dart';
import 'package:freekake/components/collection_container%20copy.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: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 { class ListEducation extends StatefulWidget {
const ListEducation({super.key}); const ListEducation({super.key});
@@ -263,7 +263,7 @@ class _ListEducationState extends State<ListEducation> {
width: 70, width: 70,
height: 70, height: 70,
textColor: Colors.black, textColor: Colors.black,
lblSize: 10, lblSize: 8,
colorContiner: ColorHelper.hexToColor(item["color"]), colorContiner: ColorHelper.hexToColor(item["color"]),
onTapAc: onTapAc:
() => { () => {
+22 -8
View File
@@ -22,10 +22,26 @@ class _PustakaScreenState extends State<PustakaScreen> {
String _searchQuery = ""; String _searchQuery = "";
final List<Map<String, dynamic>> _collections = [ final List<Map<String, dynamic>> _collections = [
{"label": "Kesehatan", "image": "assets/icons/healthy.svg", "color": "#cdd0ee"}, {
{"label": "Gizi", "image": "assets/icons/Nutrition.svg", "color": "#e8e29a"}, "label": "Kesehatan",
{"label": "Pendidikan", "image": "assets/icons/Education.svg", "color": "#efd8c6"}, "image": "assets/icons/healthy.svg",
{"label": "Keselamatan", "image": "assets/icons/Safety.svg", "color": "#cef1da"}, "color": "#cdd0ee",
},
{
"label": "Gizi",
"image": "assets/icons/Nutrition.svg",
"color": "#e8e29a",
},
{
"label": "Pendidikan",
"image": "assets/icons/Education.svg",
"color": "#efd8c6",
},
{
"label": "Keselamatan",
"image": "assets/icons/Safety.svg",
"color": "#cef1da",
},
]; ];
void _onMenuTapped(int index) { void _onMenuTapped(int index) {
@@ -143,7 +159,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
), ),
decoration: const InputDecoration( decoration: const InputDecoration(
border: InputBorder.none, border: InputBorder.none,
hintText: 'Cari konten...', hintText: 'Search...',
hintStyle: TextStyle(color: Colors.grey), hintStyle: TextStyle(color: Colors.grey),
), ),
), ),
@@ -172,7 +188,6 @@ class _PustakaScreenState extends State<PustakaScreen> {
final item = filteredCollections[index]; final item = filteredCollections[index];
return CollectionContainer( return CollectionContainer(
label: item["label"]!, label: item["label"]!,
lblSize: 11,
imageSvg: item["image"]!, imageSvg: item["image"]!,
width: 30, width: 30,
height: 80, height: 80,
@@ -252,10 +267,9 @@ class _PustakaScreenState extends State<PustakaScreen> {
color: Colors.blueAccent, color: Colors.blueAccent,
), ),
Text( Text(
'Topik ${index + 1}', 'Topic ${index + 1}',
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 11,
color: Color.fromARGB(255, 0, 0, 0), color: Color.fromARGB(255, 0, 0, 0),
), ),
), ),
+4 -4
View File
@@ -1,10 +1,10 @@
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:furibase/components/bottom_navbar.dart'; import 'package:freekake/components/bottom_navbar.dart';
import 'package:furibase/components/main_menu.dart'; import 'package:freekake/components/main_menu.dart';
import 'package:furibase/components/scan_button.dart'; import 'package:freekake/components/scan_button.dart';
import 'package:furibase/helpers/pick_image.dart'; import 'package:freekake/helpers/pick_image.dart';
import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/foundation.dart' show kIsWeb;
class AkunSaya extends StatefulWidget { class AkunSaya extends StatefulWidget {
+9 -19
View File
@@ -124,16 +124,15 @@ class _AkunSayaState extends State<AkunSaya> {
style: TextStyle(color: Colors.black), style: TextStyle(color: Colors.black),
), ),
TextFormField( // TextFormField(
initialValue: "Jl. Sentosa jaya", // initialValue: "Jl. Sentosa jaya",
decoration: const InputDecoration( // decoration: const InputDecoration(
border: UnderlineInputBorder(), // border: UnderlineInputBorder(),
labelText: 'Alamat', // labelText: 'Alamat',
labelStyle: TextStyle(color: Colors.black), // labelStyle: TextStyle(color: Colors.black),
), // ),
style: TextStyle(color: Colors.black), // style: TextStyle(color: Colors.black),
), // ),
TextFormField( TextFormField(
initialValue: "******", initialValue: "******",
decoration: const InputDecoration( decoration: const InputDecoration(
@@ -143,15 +142,6 @@ class _AkunSayaState extends State<AkunSaya> {
), ),
style: TextStyle(color: Colors.black), 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),
),
], ],
), ),
), ),
+260
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: () {},
);
}
}
+305
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: () {},
);
}
}
+16 -2
View File
@@ -7,6 +7,8 @@ import 'package:freekake/components/main_menu.dart';
import 'package:freekake/components/scan_button.dart'; import 'package:freekake/components/scan_button.dart';
import 'package:freekake/components/topbar_container.dart'; import 'package:freekake/components/topbar_container.dart';
import 'package:freekake/screen/saya/akun_saya.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 'package:image_picker/image_picker.dart';
import 'dart:io'; import 'dart:io';
@@ -214,12 +216,24 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Divider(height: 0), child: Divider(height: 0),
), ),
_buildListItem(Icons.person, "Data Diri", () => {}), _buildListItem(Icons.person, "Data Diri", () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => DataSaya()),
);
}),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Divider(height: 0), child: Divider(height: 0),
), ),
_buildListItem(Icons.person, "Point Saya", () => {}), _buildListItem(Icons.person, "Point Saya", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PointSaya(),
),
);
}),
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 25.0, horizontal: 25.0,
+31
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;
}
}
+17 -1
View File
@@ -822,7 +822,23 @@ packages:
sha256: "18b1640839cf6546784a524c72aded5b6e86b23e7167dc2311cc96f7658b64bd" sha256: "18b1640839cf6546784a524c72aded5b6e86b23e7167dc2311cc96f7658b64bd"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted 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: webview_flutter_wkwebview:
dependency: "direct main" dependency: "direct main"
description: description:
+4
View File
@@ -94,6 +94,10 @@ flutter:
# SVG files # SVG files
- assets/icons/ - assets/icons/
- assets/html/
- assets/html/furikake/
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images # https://flutter.dev/to/resolution-aware-images