added other
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import '../../../../app/themes/app_colors.dart';
|
||||
import '../../../../app/themes/app_text.dart';
|
||||
import './data_siswa_view_model.dart';
|
||||
|
||||
class DataSiswaView extends StatelessWidget {
|
||||
@ -18,11 +20,102 @@ class DataSiswaView extends StatelessWidget {
|
||||
DataSiswaViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Text(
|
||||
'DataSiswaView',
|
||||
),
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: mainColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: mainGrey.withOpacity(0.5),
|
||||
spreadRadius: 5,
|
||||
blurRadius: 7,
|
||||
offset: const Offset(0, 3), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Siswa',
|
||||
style: regularTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'20 orang',
|
||||
style: regularTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: mainGrey.withOpacity(0.5),
|
||||
spreadRadius: 5,
|
||||
blurRadius: 7,
|
||||
offset:
|
||||
const Offset(0, 3), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 15, vertical: 10),
|
||||
itemCount: 20,
|
||||
itemBuilder: (context, index) {
|
||||
return Card(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
model.log.i('Card $index tapped');
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text('Namanya',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 13, color: mainColor)),
|
||||
subtitle: Text('Umurnya : $index'),
|
||||
// circle avatar
|
||||
trailing: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: mainColor,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.person,
|
||||
color: Colors.white,
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
model.addSiswa();
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@ -1,5 +1,19 @@
|
||||
import 'package:panti_asuhan/app/core/custom_base_view_model.dart';
|
||||
|
||||
import '../../../../app/app.dialogs.dart';
|
||||
import '../../../../app/app.logger.dart';
|
||||
import '../add_siswa_dialog/add_siswa_dialog/add_siswa_dialog_view.dart';
|
||||
|
||||
class DataSiswaViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('DataSiswaViewModel');
|
||||
Future<void> init() async {}
|
||||
|
||||
void addSiswa() async {
|
||||
final res = await dialogService.showCustomDialog(
|
||||
variant: DialogType.addSiswaDialogView,
|
||||
data: DataSiswa(nama: null),
|
||||
);
|
||||
|
||||
if (res?.confirmed != true) return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user