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:flutter/material.dart';
import 'package:freekake/components/navbar_container.dart'; import 'package:freekake/components/navbar_container.dart';
import 'package:freekake/components/navbar_shape_1.dart'; import 'package:freekake/components/navbar_shape_1.dart';

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),

View File

@ -9,12 +9,12 @@ 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());
} }

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,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) { 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) {

View File

@ -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:
() => { () => {

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),
), ),
), ),

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 {