added profil and kurir page in pengirim, added pengiriman page at kurir, sort the api, design the ui back
This commit is contained in:
@ -1,19 +1,99 @@
|
||||
// ignore_for_file: file_names
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kurir/widgets/boxBackgroundDecoration.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ListKurirPage extends StatelessWidget {
|
||||
import '../../../controller/after_login/pengirim/listKurirController.dart';
|
||||
import '../../../models/usersModel.dart';
|
||||
import '../../../widgets/bounce_scroller.dart';
|
||||
import '../../../widgets/boxBackgroundDecoration.dart';
|
||||
import '../../../widgets/load_data.dart';
|
||||
|
||||
class ListKurirPage extends GetView<ListKurirController> {
|
||||
const ListKurirPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const BoxBackgroundDecoration(
|
||||
child: Center(
|
||||
child: Text(
|
||||
'List Kurir',
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
return BoxBackgroundDecoration(
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity * 0.9,
|
||||
height: double.infinity,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: MediaQuery.of(context).size.height * 0.13),
|
||||
_MainDetail(controller: controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
_TopSearchInputField(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _TopSearchInputField extends StatelessWidget {
|
||||
const _TopSearchInputField({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Positioned(
|
||||
top: MediaQuery.of(context).size.height * 0.05,
|
||||
right: MediaQuery.of(context).size.width * 0.05,
|
||||
left: MediaQuery.of(context).size.width * 0.05,
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
height: 40,
|
||||
child: TextFormField(
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Cari Kurir',
|
||||
hintStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
prefixIcon: const Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
suffixIcon: const Icon(
|
||||
Icons.filter_list,
|
||||
color: Colors.white,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.transparent,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 10,
|
||||
),
|
||||
),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
@ -21,3 +101,142 @@ class ListKurirPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _MainDetail extends StatelessWidget {
|
||||
const _MainDetail({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
}) : super(key: key);
|
||||
|
||||
final ListKurirController controller;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: MediaQuery.of(context).size.height * 0.03,
|
||||
right: MediaQuery.of(context).size.height * 0.03),
|
||||
child: Obx(
|
||||
() => BounceScrollerWidget(
|
||||
children: [
|
||||
if (controller.loadKurir.value == 0) const LoadingDataWidget(),
|
||||
if (controller.loadKurir.value == 1 &&
|
||||
controller.kurirModelList.isNotEmpty)
|
||||
for (var data in controller.kurirModelList)
|
||||
_KurirDetailBox(data: data)
|
||||
else if (controller.loadKurir.value == 1 &&
|
||||
controller.kurirModelList.isEmpty)
|
||||
const TiadaDataWIdget(text: "Tidak ada data"),
|
||||
if (controller.loadKurir.value == 2) const ErrorLoadDataWidget(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _KurirDetailBox extends StatelessWidget {
|
||||
const _KurirDetailBox({
|
||||
Key? key,
|
||||
required this.data,
|
||||
}) : super(key: key);
|
||||
|
||||
final KurirModel data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 90,
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color.fromARGB(255, 165, 163, 163).withOpacity(0.5),
|
||||
blurRadius: 10,
|
||||
spreadRadius: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color.fromARGB(255, 165, 163, 163)
|
||||
.withOpacity(0.5),
|
||||
blurRadius: 10,
|
||||
spreadRadius: 5,
|
||||
),
|
||||
],
|
||||
image: const DecorationImage(
|
||||
image: AssetImage('assets/loading.gif'),
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
),
|
||||
child: CircleAvatar(
|
||||
radius: 30.0,
|
||||
backgroundImage: NetworkImage(
|
||||
data.photo_url ?? 'https://via.placeholder.com/150',
|
||||
scale: 0.5,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
data.nama ?? 'Nama Belum Terisi',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
data.no_telp ?? 'No Telp Belum Terisi',
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
data.email ?? 'Email Belum Terisi',
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
flex: 1,
|
||||
child: Text("Rating"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user