sebelum unity

This commit is contained in:
Irwan Cahyono 2025-05-09 01:42:10 +07:00
parent d9b5e53e18
commit 2b7778b152
7 changed files with 198 additions and 231 deletions

View File

@ -1,4 +1,3 @@
import 'package:freekake/components/navbar_shape_3.dart';
import 'package:flutter/material.dart';
import 'package:freekake/components/navbar_container.dart';
import 'package:freekake/components/navbar_shape_1.dart';

View File

@ -53,6 +53,7 @@ class CardList extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 1, width: 5),
Text(
title,
style: const TextStyle(
@ -61,16 +62,16 @@ class CardList extends StatelessWidget {
),
),
const SizedBox(height: 1, width: 5),
Text(
body,
style: const TextStyle(
letterSpacing: 0.2,
fontSize: 14,
fontWeight: FontWeight.normal,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
// Text(
// body,
// style: const TextStyle(
// letterSpacing: 0.2,
// fontSize: 14,
// fontWeight: FontWeight.normal,
// ),
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// ),
const Spacer(),
Padding(
padding: EdgeInsets.all(0.08),

View File

@ -9,12 +9,12 @@ import 'package:provider/provider.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
// SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown, // bisa dihapus jika hanya ingin satu arah
]);
// await SystemChrome.setPreferredOrientations([
// DeviceOrientation.portraitUp,
// DeviceOrientation.portraitDown, // bisa dihapus jika hanya ingin satu arah
// ]);
runApp(const MyApp());
}

View File

@ -51,173 +51,165 @@ class _HomeScreenState extends State<HomeScreen> {
return Stack(
children: <Widget>[
Positioned.fill(
child: RepaintBoundary(
child: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/background.jpeg"),
fit: BoxFit.cover,
),
),
),
child: UnityWidget(
onUnityCreated: onUnityCreated,
//isARScene: true,
onUnityMessage: onUnityMessage,
//onUnitySceneLoaded: onUnitySceneLoaded,
fullscreen: false,
),
// Positioned(
// top: 0,
// left: 0,
// right: 0,
// child: SizedBox(height: 120, child: TopbarContainer()),
// ),
// Positioned(
// right: 0,
// top: 100,
// child: Padding(
// padding: EdgeInsets.only(right: 20),
// child: Container(
// width: 40,
// height: 40,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(1),
// color: Color.fromARGB(1, 209, 174, 174).withAlpha(0),
// ),
// child: Center(
// child: DropdownButtonHideUnderline(
// child: DropdownButton2(
// customButton: Container(
// height: 50,
// width: 50,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// image: const DecorationImage(
// image: AssetImage('assets/images/luffy-u.png'),
// fit: BoxFit.cover,
// ),
// ),
// ),
// openWithLongPress: false,
// items: [
// ..._MenuItems.firstItems.map(
// (item) => DropdownMenuItem<_MenuItem>(
// value: 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) {
// if (value != null) {
// _MenuItems.onChanged(context, value);
// } else {
// print("null");
// }
// },
// buttonStyleData: ButtonStyleData(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// ),
// ),
// dropdownStyleData: DropdownStyleData(
// width: 140,
// padding: EdgeInsets.zero,
// maxHeight: 150,
// // padding: const EdgeInsets.symmetric(vertical: 6),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(4),
// color: Color.fromRGBO(2, 104, 17, 1).withAlpha(50),
// ),
// offset: const Offset(40, -4),
// ),
// menuItemStyleData: MenuItemStyleData(
// height: 35,
// padding: EdgeInsets.symmetric(horizontal: 10),
// ),
// // menuItemStyleData: const MenuItemStyleData(
// // padding: EdgeInsets.only(left: 16, right: 16),
// // ),
// ),
// ),
// ),
// ),
// ),
// ),
Positioned(
top: 10,
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(
),
// Positioned.fill(
// child: RepaintBoundary(
// child: Container(
// decoration: const BoxDecoration(
// image: DecorationImage(
// image: AssetImage("assets/images/background.jpeg"),
// fit: BoxFit.cover,
// ),
// ),
// ),
// ),
// ),
// Positioned(
// right: 0,
// top: 100,
// child: Padding(
// padding: EdgeInsets.only(right: 20),
// child: Container(
// width: 40,
// height: 40,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(1),
// color: Color.fromARGB(1, 209, 174, 174).withAlpha(0),
// ),
// child: Center(
// child: DropdownButtonHideUnderline(
// child: DropdownButton2(
// customButton: Container(
// height: 50,
// width: 50,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// image: const DecorationImage(
// image: AssetImage('assets/images/cepot-u.png'),
// fit: BoxFit.cover,
// ),
// ),
// ),
// openWithLongPress: false,
// items: [
// ..._MenuItems.firstItems.map(
// (item) => DropdownMenuItem<MenuItem>(
// value: item,
// child: _MenuItems.buildItem(item),
// ),
// ),
// ],
// onChanged: (value) {
// if (value != null) {
// _MenuItems.onChanged(context, value);
// } else {
// print("null");
// }
// },
// buttonStyleData: ButtonStyleData(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// ),
// ),
// dropdownStyleData: DropdownStyleData(
// width: 140,
// padding: EdgeInsets.zero,
// maxHeight: 150,
// // padding: const EdgeInsets.symmetric(vertical: 6),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(4),
// color: Color.fromRGBO(2, 104, 17, 1).withAlpha(50),
// ),
// offset: const Offset(40, -4),
// ),
// menuItemStyleData: MenuItemStyleData(
// height: 35,
// padding: EdgeInsets.symmetric(horizontal: 10),
// ),
// // menuItemStyleData: const MenuItemStyleData(
// // padding: EdgeInsets.only(left: 16, right: 16),
// // ),
// ),
// ),
// ),
// ),
// ),
// ),
Positioned(
top: 10,
left: 10,
right: 10,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Positioned(
bottom: 0,
left: 0,
right: 0,
child: SizedBox(height: 85, child: BottomNavbar()),
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: 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(
bottom:
@ -234,47 +226,8 @@ class _HomeScreenState extends State<HomeScreen> {
);
}
// 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) {
return Image.asset("assets/" + src, width: size);
return Image.asset(src, width: size);
}
void onUnityCreated(controller) {

View File

@ -263,7 +263,7 @@ class _ListEducationState extends State<ListEducation> {
width: 70,
height: 70,
textColor: Colors.black,
lblSize: 10,
lblSize: 8,
colorContiner: ColorHelper.hexToColor(item["color"]),
onTapAc:
() => {

View File

@ -22,10 +22,26 @@ class _PustakaScreenState extends State<PustakaScreen> {
String _searchQuery = "";
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": "Pendidikan", "image": "assets/icons/Education.svg", "color": "#efd8c6"},
{"label": "Keselamatan", "image": "assets/icons/Safety.svg", "color": "#cef1da"},
{
"label": "Kesehatan",
"image": "assets/icons/healthy.svg",
"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) {
@ -143,7 +159,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
),
decoration: const InputDecoration(
border: InputBorder.none,
hintText: 'Cari konten...',
hintText: 'Search...',
hintStyle: TextStyle(color: Colors.grey),
),
),
@ -172,7 +188,6 @@ class _PustakaScreenState extends State<PustakaScreen> {
final item = filteredCollections[index];
return CollectionContainer(
label: item["label"]!,
lblSize: 11,
imageSvg: item["image"]!,
width: 30,
height: 80,
@ -252,10 +267,9 @@ class _PustakaScreenState extends State<PustakaScreen> {
color: Colors.blueAccent,
),
Text(
'Topik ${index + 1}',
'Topic ${index + 1}',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 11,
color: Color.fromARGB(255, 0, 0, 0),
),
),

View File

@ -1,10 +1,10 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:furibase/components/bottom_navbar.dart';
import 'package:furibase/components/main_menu.dart';
import 'package:furibase/components/scan_button.dart';
import 'package:furibase/helpers/pick_image.dart';
import 'package:freekake/components/bottom_navbar.dart';
import 'package:freekake/components/main_menu.dart';
import 'package:freekake/components/scan_button.dart';
import 'package:freekake/helpers/pick_image.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
class AkunSaya extends StatefulWidget {