dev #1

Merged
aefril merged 128 commits from dev into main 2025-08-13 17:19:48 +00:00
2 changed files with 58 additions and 27 deletions
Showing only changes of commit 15b27d8f67 - Show all commits

View File

@ -1,3 +1,6 @@
import 'package:enaklo_pos/core/components/components.dart';
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
import 'package:enaklo_pos/presentation/setting/widgets/settings_title.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:enaklo_pos/core/constants/colors.dart'; import 'package:enaklo_pos/core/constants/colors.dart';
import 'package:enaklo_pos/data/datasources/auth_local_datasource.dart'; import 'package:enaklo_pos/data/datasources/auth_local_datasource.dart';
@ -36,37 +39,64 @@ class _ServerKeyPageState extends State<ServerKeyPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( backgroundColor: AppColors.background,
title: const Text('Save Server Key'),
centerTitle: true,
),
//textfield untuk input server key
body: Column( body: Column(
children: [ children: [
SettingsTitle('Server Key'),
Padding( Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(16.0),
child: TextField( child: Column(
controller: serverKeyController, children: [
decoration: const InputDecoration( Container(
border: OutlineInputBorder(), padding: const EdgeInsets.all(20.0),
labelText: 'Server Key', decoration: BoxDecoration(
), color: AppColors.white,
), borderRadius: BorderRadius.circular(8.0),
), ),
//button untuk save server key child: Column(
ElevatedButton( crossAxisAlignment: CrossAxisAlignment.start,
onPressed: () { children: [
AuthLocalDataSource() Text(
.saveMidtransServerKey(serverKeyController!.text); 'Server Key',
style: TextStyle(
ScaffoldMessenger.of(context).showSnackBar( fontSize: 14,
const SnackBar( fontWeight: FontWeight.w500,
content: Text('Server Key saved'), color: AppColors.black,
backgroundColor: AppColors.primary, ),
),
SpaceHeight(4),
TextField(
controller: serverKeyController,
decoration: const InputDecoration(
border: OutlineInputBorder(),
hintText: 'Server Key',
),
),
],
),
), ),
); const SpaceHeight(20),
}, Align(
child: const Text('Save'), alignment: Alignment.centerRight,
child: Button.filled(
width: context.deviceWidth * 0.2,
height: 44,
onPressed: () {
AuthLocalDataSource()
.saveMidtransServerKey(serverKeyController!.text);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Server Key saved'),
backgroundColor: AppColors.primary,
),
);
},
label: 'Simpan',
),
),
],
),
), ),
], ],
), ),

View File

@ -33,6 +33,7 @@ class SettingsTitle extends StatelessWidget {
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
title, title,