completed the mobile app for he boss to review the stock report
This commit is contained in:
77
boss_app2/lib/page/boss/index.dart
Normal file
77
boss_app2/lib/page/boss/index.dart
Normal file
@ -0,0 +1,77 @@
|
||||
import 'package:boss_app2/page/boss/homeAdmin.dart';
|
||||
import 'package:boss_app2/page/boss/laporanPenuh.dart';
|
||||
import 'package:boss_app2/page/boss/produk.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BossIndex extends StatefulWidget {
|
||||
@override
|
||||
_BossIndexState createState() => _BossIndexState();
|
||||
}
|
||||
|
||||
class _BossIndexState extends State<BossIndex> {
|
||||
Future<bool> _onWillPop() async {
|
||||
return (await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Yakin?'),
|
||||
content: const Text('Anda Akan Keluar Dari Aplikasi'),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('Tidak'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.red,
|
||||
),
|
||||
child: const Text('Ya'),
|
||||
),
|
||||
],
|
||||
),
|
||||
)) ??
|
||||
false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// return Scaffold
|
||||
return WillPopScope(
|
||||
onWillPop: _onWillPop,
|
||||
child: DefaultTabController(
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: AppBar().preferredSize.height + 8,
|
||||
flexibleSpace: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: const [
|
||||
TabBar(tabs: [
|
||||
Tab(
|
||||
text: 'Home',
|
||||
icon: Icon(Icons.home),
|
||||
),
|
||||
Tab(
|
||||
text: 'Log Produk',
|
||||
icon: Icon(Icons.filter_vintage_sharp),
|
||||
),
|
||||
Tab(
|
||||
text: 'Laporan Penuh',
|
||||
icon: Icon(Icons.checklist_rtl_rounded),
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
HomeAdmin(),
|
||||
// ProdukAdmin(),
|
||||
ProdukAdmin(),
|
||||
const LaporanPenuh(),
|
||||
],
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user