From 340a66bfb25f247f5e2ef80ba71bb3a774922a1a Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Wed, 7 May 2025 13:05:21 +0700 Subject: [PATCH] updated --- lib/components/scan_button.dart | 4 +- lib/main.dart | 2 +- lib/screen/Home_screen.dart | 284 +++++++++++++++++--------------- 3 files changed, 154 insertions(+), 136 deletions(-) diff --git a/lib/components/scan_button.dart b/lib/components/scan_button.dart index 49bbab6..b7ad5cc 100644 --- a/lib/components/scan_button.dart +++ b/lib/components/scan_button.dart @@ -1,7 +1,7 @@ import 'package:freekake/screen/camera_screen.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; -// import 'package:freekake/screen/camera_screen.dart'; +import 'package:freekake/screen/camera_screen.dart'; class ScanButton extends StatelessWidget { const ScanButton({super.key}); @@ -45,4 +45,4 @@ class ScanButton extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index d9db0b5..8b51ffa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { ], child: MaterialApp( debugShowCheckedModeBanner: false, - title: 'AR Character App', + title: 'Freekake', theme: ThemeData.dark(), home: // DrawScreen(), diff --git a/lib/screen/Home_screen.dart b/lib/screen/Home_screen.dart index e555c26..875f356 100644 --- a/lib/screen/Home_screen.dart +++ b/lib/screen/Home_screen.dart @@ -5,6 +5,7 @@ import 'package:freekake/components/buildcard_info.dart'; import 'package:freekake/components/main_menu.dart'; import 'package:freekake/components/menu_item.dart'; import 'package:freekake/components/scan_button.dart'; +import 'package:flutter_unity_widget/flutter_unity_widget.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @@ -60,146 +61,163 @@ class _HomeScreenState extends State { ), ), ), - ), - - 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: 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( - top: 10, - left: 10, - right: 10, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + // 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: [ - 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: SizedBox(height: 85, child: BottomNavbar()), ), ], ), - ), - 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: 0, left: 0, right: 0, child: MainMenu()), Positioned( bottom: