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,25 +39,48 @@ 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(16.0),
child: Column(
children: [
Container(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: TextField( decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(8.0),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Server Key',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: AppColors.black,
),
),
SpaceHeight(4),
TextField(
controller: serverKeyController, controller: serverKeyController,
decoration: const InputDecoration( decoration: const InputDecoration(
border: OutlineInputBorder(), border: OutlineInputBorder(),
labelText: 'Server Key', hintText: 'Server Key',
), ),
), ),
],
), ),
//button untuk save server key ),
ElevatedButton( const SpaceHeight(20),
Align(
alignment: Alignment.centerRight,
child: Button.filled(
width: context.deviceWidth * 0.2,
height: 44,
onPressed: () { onPressed: () {
AuthLocalDataSource() AuthLocalDataSource()
.saveMidtransServerKey(serverKeyController!.text); .saveMidtransServerKey(serverKeyController!.text);
@ -66,7 +92,11 @@ class _ServerKeyPageState extends State<ServerKeyPage> {
), ),
); );
}, },
child: const Text('Save'), 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,