step 25 : ganti icon apk

This commit is contained in:
sindhu
2024-01-17 13:54:41 +07:00
parent 88ad1d6584
commit 987a5a5c3a
47 changed files with 131 additions and 29 deletions

View File

@@ -10,7 +10,10 @@ class Constant {
static double designWidthPhone = 390;
static String bearerName = "petty-cash";
static String version = "1.00";
// static String version = "1.00";
// NOTE VERSI HARUS SAMA DENGAN PUBSPEC.YAML
static String version = "1.0.0";
// static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/";

View File

@@ -8,6 +8,9 @@ import 'app/route.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
initializeDateFormatting();
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarIconBrightness:
Brightness.dark, // this will change the brightness of the icons

View File

@@ -28,6 +28,27 @@ class HomeScreen extends HookConsumerWidget {
final listTransaksiHome = useState<List<ListTransaksiHomeModel>>(
List.empty(growable: true),
);
final M_CompanyName = useState("-");
// company name
Future<String> getCompanyName() async {
final shared = await SharedPreferences.getInstance();
String M_CompanyName = "-";
if (shared != null) {
final bearerString = shared.get(Constant.bearerName).toString();
final xmodel = jsonDecode(bearerString);
if (xmodel != null) {
M_CompanyName = xmodel["model"]["M_CompanyName"];
}
}
if (M_CompanyName == "0") {
// throw BaseRepositoryException(message: 'Invalid Company ID');
}
return M_CompanyName;
}
useEffect(() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
@@ -40,6 +61,7 @@ class HomeScreen extends HookConsumerWidget {
// Navigator.popAndPushNamed(context, loginRoute);
return;
}
M_CompanyName.value = await getCompanyName();
});
return () {};
}, []);
@@ -125,8 +147,12 @@ class HomeScreen extends HookConsumerWidget {
child: Scaffold(
appBar: AppBar(
title: Text(
'Home Screen',
style: TextStyle(color: Constant.textWhite),
// 'Home Screen',
M_CompanyName.value,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Constant.textWhite,
),
),
backgroundColor: Constant.pcBtnBackgroundColor,
iconTheme: IconThemeData(

View File

@@ -158,6 +158,7 @@ class CustomDrawer extends HookConsumerWidget {
backgroundColor: Constant.textGrey.withOpacity(0.16),
label: Text(
M_CompanyName.value,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Constant.textGreyv2,
),
@@ -320,6 +321,18 @@ class CustomDrawer extends HookConsumerWidget {
);
},
),
Spacer(),
// Versi Aplikasi
ListTile(
title: Text(
'Versi ${Constant.version}',
style: Constant.titleH4Login(context: context)
.copyWith(color: Constant.textGrey),
),
onTap: () {},
),
],
),
),

View File

@@ -92,7 +92,7 @@ class HistoryRowAtasWidget extends HookConsumerWidget {
String formatDateString(String inputDate) {
try {
// Parsing tanggal dari string input
DateTime date = DateFormat('dd-MM-yyyy','id').parse(inputDate);
DateTime date = DateFormat('dd-MM-yyyy', 'id').parse(inputDate);
// Format tanggal ke '30 Des 2023'
String formattedDate = DateFormat('dd MMM yyyy', 'id').format(date);
@@ -108,19 +108,71 @@ class HistoryRowAtasWidget extends HookConsumerWidget {
Widget getIconUrl(String categoryid) {
List<Map<String, String>> iconDataList = [
{'categoryid': '1', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '2', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '3', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_3.svg'},
{'categoryid': '4', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '5', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_5.svg'},
{'categoryid': '6', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_6.svg'},
{'categoryid': '7', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '8', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '9', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '10', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '11', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{'categoryid': '12', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_12.svg'},
{'categoryid': '13', 'url': 'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'},
{
'categoryid': '1',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '2',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '3',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_3.svg'
},
{
'categoryid': '4',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '5',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_5.svg'
},
{
'categoryid': '6',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_6.svg'
},
{
'categoryid': '7',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '8',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '9',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '10',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '11',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
{
'categoryid': '12',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_12.svg'
},
{
'categoryid': '13',
'url':
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg'
},
];
String urlFix = "";
@@ -130,7 +182,8 @@ class HistoryRowAtasWidget extends HookConsumerWidget {
// urlFix =
// "https://devone.aplikasi.web.id/pettycash-media/icon/icon_$icon_category_id.svg";
urlFix = iconDataList[i]['url'] ?? "https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg";
urlFix = iconDataList[i]['url'] ??
"https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg";
}
}
@@ -271,21 +324,23 @@ class HistoryRowAtasWidget extends HookConsumerWidget {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
// width: Constant.getActualXPhone(context: context, x: 32),
height: Constant.getActualYPhone(context: context, y: 19),
width: Constant.getActualXPhone(context: context, x: 80),
height: Constant.getActualYPhone(context: context, y: 24),
decoration: BoxDecoration(
color: Constant.bgIconHistory,
borderRadius: BorderRadius.all(
Radius.circular(6.0),
),
),
child: Padding(
padding: EdgeInsets.all(2.0),
child: Align(
alignment: Alignment.center,
child: Text(
tipe,
style: Constant.body1_600(context: context).copyWith(
fontWeight: FontWeight.w600,
color: Constant.pcBtnBackgroundColor),
fontWeight: FontWeight.w600,
color: Constant.pcBtnBackgroundColor,
fontSize: 14,
),
),
),
),