add edit siswa page
This commit is contained in:
@ -203,12 +203,14 @@ class SecondWidget extends ViewModelWidget<StrukturOrganisasiViewModel> {
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
viewModel.editData(title, true);
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
)
|
||||
viewModel.role == 'admin'
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
viewModel.editData(title, true);
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
for (var i = 0; i < length; i++)
|
||||
@ -287,12 +289,14 @@ class FirstWidget extends ViewModelWidget<StrukturOrganisasiViewModel> {
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
viewModel.editData(title, false);
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
)
|
||||
viewModel.role == 'admin'
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
viewModel.editData(title, false);
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
Center(
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../../app/app.dialogs.dart';
|
||||
import '../../../../app/app.locator.dart';
|
||||
import '../../../../app/app.logger.dart';
|
||||
@ -9,6 +11,7 @@ class StrukturOrganisasiViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('StrukturOrganisasiViewModel');
|
||||
final _httpService = locator<MyHttpServices>();
|
||||
final easyLoading = locator<MyEasyLoading>();
|
||||
String? role;
|
||||
|
||||
Map<String, dynamic> dataKetua = {};
|
||||
Map<String, dynamic> dataSekretaris = {};
|
||||
@ -54,6 +57,9 @@ class StrukturOrganisasiViewModel extends CustomBaseViewModel {
|
||||
int dataKelompokPutriLength = 0;
|
||||
|
||||
Future<void> init() async {
|
||||
prefs.then((SharedPreferences prefs) {
|
||||
role = prefs.getString('role');
|
||||
});
|
||||
getData('Ketua', false, null);
|
||||
getData('Sekretaris', false, null);
|
||||
getData('Bendahara', false, null);
|
||||
|
||||
Reference in New Issue
Block a user