Compare commits
41
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7105d6110 | ||
|
|
e15bfc0bef | ||
|
|
442e56294f | ||
|
|
2b7778b152 | ||
|
|
d9b5e53e18 | ||
|
|
740f137913 | ||
|
|
89dbf1a900 | ||
|
|
9899809c18 | ||
|
|
4040e8f91a | ||
|
|
fe2d68e786 | ||
|
|
f7ed9f5035 | ||
|
|
7cea1ea4c5 | ||
|
|
501d417b95 | ||
|
|
db213c151c | ||
|
|
72aa4f9dfe | ||
|
|
7946df58d8 | ||
|
|
c08aeb999c | ||
|
|
206f99b561 | ||
|
|
e7945b1074 | ||
|
|
dbafded5d2 | ||
|
|
fe66f466a2 | ||
|
|
06fe0bdd7e | ||
|
|
00749179f6 | ||
|
|
15e85fc0dd | ||
|
|
52df106632 | ||
|
|
da4f3f9243 | ||
|
|
5f8305289c | ||
|
|
ecdad52570 | ||
|
|
1bd2a67868 | ||
|
|
fa47208e4e | ||
|
|
41e0248b67 | ||
|
|
b330c207b7 | ||
|
|
17e955e3a9 | ||
|
|
ce76938284 | ||
|
|
316d1937b4 | ||
|
|
85a2655457 | ||
|
|
a3c27a23b9 | ||
|
|
8478822f4a | ||
|
|
d2d45ad685 | ||
|
|
86b1f67dda | ||
|
|
0e985f5453 |
@@ -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,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
@@ -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
|
|
||||||
|
|||||||
@@ -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});
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
@@ -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});
|
||||||
|
|||||||
@@ -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
@@ -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,
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
-80
@@ -51,22 +51,27 @@ 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.fill(
|
||||||
),
|
// child: RepaintBoundary(
|
||||||
// Positioned(
|
// child: Container(
|
||||||
// top: 0,
|
// decoration: const BoxDecoration(
|
||||||
// left: 0,
|
// image: DecorationImage(
|
||||||
// right: 0,
|
// image: AssetImage("assets/images/background.jpeg"),
|
||||||
// child: SizedBox(height: 120, child: TopbarContainer()),
|
// fit: BoxFit.cover,
|
||||||
// ),
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
// Positioned(
|
// Positioned(
|
||||||
// right: 0,
|
// right: 0,
|
||||||
// top: 100,
|
// top: 100,
|
||||||
@@ -88,7 +93,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
// decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
// image: const DecorationImage(
|
// image: const DecorationImage(
|
||||||
// image: AssetImage('assets/images/luffy-u.png'),
|
// image: AssetImage('assets/images/cepot-u.png'),
|
||||||
// fit: BoxFit.cover,
|
// fit: BoxFit.cover,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
@@ -96,23 +101,11 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
// openWithLongPress: false,
|
// openWithLongPress: false,
|
||||||
// items: [
|
// items: [
|
||||||
// ..._MenuItems.firstItems.map(
|
// ..._MenuItems.firstItems.map(
|
||||||
// (item) => DropdownMenuItem<_MenuItem>(
|
// (item) => DropdownMenuItem<MenuItem>(
|
||||||
// value: item,
|
// value: item,
|
||||||
// child: _MenuItems.buildItem(item),
|
// child: _MenuItems.buildItem(item),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// // const DropdownMenuItem<Divider>(
|
|
||||||
// // enabled: false,
|
|
||||||
// // // height: 8,
|
|
||||||
// // child: Divider(),
|
|
||||||
// // ),
|
|
||||||
// // ..._MenuItems.secondItems.map(
|
|
||||||
// // (item) => DropdownMenuItem<_MenuItem>(
|
|
||||||
// // value: item,
|
|
||||||
// // // height: 48,
|
|
||||||
// // child: _MenuItems.buildItem(item),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// ],
|
// ],
|
||||||
// onChanged: (value) {
|
// onChanged: (value) {
|
||||||
// if (value != null) {
|
// if (value != null) {
|
||||||
@@ -201,8 +194,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// SizedBox(height: 10),
|
// SizedBox(height: 10),
|
||||||
// setHomeImage("images/luffy.png", 300),
|
// //setHomeImage("assets/images/cepott.png", 300),
|
||||||
// // Image.asset("images/luffy.png", width: 300),
|
|
||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
@@ -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});
|
||||||
|
|||||||
@@ -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,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),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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: () {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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: () {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user