diff --git a/lib/components/bottom_navbar.dart b/lib/components/bottom_navbar.dart index 71f9724..3df0da1 100644 --- a/lib/components/bottom_navbar.dart +++ b/lib/components/bottom_navbar.dart @@ -1,10 +1,9 @@ -import 'package:freekake/components/navbar_shape_3.dart'; import 'package:flutter/material.dart'; -import 'package:furibase/components/navbar_container.dart'; -import 'package:furibase/components/navbar_shape_1.dart'; -import 'package:furibase/components/navbar_shape_2.dart'; -import 'package:furibase/components/navbar_shape_3.dart'; -import 'package:furibase/components/custom_shape.dart'; +import 'package:freekake/components/navbar_container.dart'; +import 'package:freekake/components/navbar_shape_1.dart'; +import 'package:freekake/components/navbar_shape_2.dart'; +import 'package:freekake/components/navbar_shape_3.dart'; +import 'package:freekake/components/custom_shape.dart'; class BottomNavbar extends StatefulWidget { const BottomNavbar({super.key}); diff --git a/lib/components/card_list.dart b/lib/components/card_list.dart index 8f13c95..9d6f4fe 100644 --- a/lib/components/card_list.dart +++ b/lib/components/card_list.dart @@ -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), diff --git a/lib/components/main_menu.dart b/lib/components/main_menu.dart index 0e4a371..1740360 100644 --- a/lib/components/main_menu.dart +++ b/lib/components/main_menu.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:freekake/components/menu_button.dart'; import 'package:freekake/providers/menu_selection_provider.dart'; import 'package:freekake/screen/Home_screen.dart'; import 'package:freekake/screen/koleksi_screen.dart'; diff --git a/lib/main.dart b/lib/main.dart index b44bd1c..fa8fc85 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,12 +8,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()); } diff --git a/lib/screen/Home_screen.dart b/lib/screen/Home_screen.dart index ca17713..4ecc7f0 100644 --- a/lib/screen/Home_screen.dart +++ b/lib/screen/Home_screen.dart @@ -51,173 +51,165 @@ class _HomeScreenState extends State { return Stack( children: [ 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( - // // 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( + // 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,55 +226,8 @@ class _HomeScreenState extends State { ); } - 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) { - return Image.asset("assets/" + src, width: size); + return Image.asset(src, width: size); } void onUnityCreated(controller) { diff --git a/lib/screen/pustaka/list_education.dart b/lib/screen/pustaka/list_education.dart index 641b89a..d0d8bdc 100644 --- a/lib/screen/pustaka/list_education.dart +++ b/lib/screen/pustaka/list_education.dart @@ -263,7 +263,7 @@ class _ListEducationState extends State { width: 70, height: 70, textColor: Colors.black, - lblSize: 10, + lblSize: 8, colorContiner: ColorHelper.hexToColor(item["color"]), onTapAc: () => { diff --git a/lib/screen/pustaka_screen.dart b/lib/screen/pustaka_screen.dart index cb675da..b33d1b5 100644 --- a/lib/screen/pustaka_screen.dart +++ b/lib/screen/pustaka_screen.dart @@ -22,10 +22,26 @@ class _PustakaScreenState extends State { String _searchQuery = ""; final List> _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 { ), decoration: const InputDecoration( border: InputBorder.none, - hintText: 'Cari konten...', + hintText: 'Search...', hintStyle: TextStyle(color: Colors.grey), ), ), @@ -172,7 +188,6 @@ class _PustakaScreenState extends State { 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 { 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), ), ), diff --git a/lib/screen/saya/akun_saya copy.dart b/lib/screen/saya/akun_saya copy.dart index 95388a0..e62331c 100644 --- a/lib/screen/saya/akun_saya copy.dart +++ b/lib/screen/saya/akun_saya copy.dart @@ -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 {