You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.4 KiB
68 lines
2.4 KiB
import 'package:flutter/services.dart'; |
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
import 'package:flutter/material.dart'; |
|
import 'package:provider/provider.dart'; |
|
import 'package:siopas/pages/pengembalian_barang/create.dart'; |
|
import 'package:siopas/pages/pengembalian_barang/pengembalian-index.dart'; |
|
import 'pages/home/main_page.dart'; |
|
import 'pages/home/peminjaman_stock_page.dart'; |
|
import 'pages/peminjaman_barang/create.dart'; |
|
import 'pages/peminjaman_barang/show.dart'; |
|
import 'pages/sign_in_page.dart'; |
|
import 'pages/splash_page.dart'; |
|
import 'providers/asset_status_provider.dart'; |
|
import 'providers/auth_provider.dart'; |
|
import 'providers/m_status_provider.dart'; |
|
|
|
void main() async { |
|
WidgetsFlutterBinding.ensureInitialized(); |
|
// SharedPreferences prefs = await SharedPreferences.getInstance(); |
|
// var email = prefs.getString("email"); |
|
// var password = prefs.getString("password"); |
|
// var token = prefs.getString("token"); |
|
// await Firebase.initializeApp(); |
|
runApp(MyApp()); |
|
SystemChrome.setPreferredOrientations([ |
|
DeviceOrientation.portraitUp, // Atur orientasi ke potrait |
|
]); |
|
} |
|
|
|
class MyApp extends StatelessWidget { |
|
@override |
|
Widget build(BuildContext context) { |
|
return MultiProvider( |
|
providers: [ |
|
ChangeNotifierProvider( |
|
create: (context) => AuthProvider(), |
|
), |
|
ChangeNotifierProvider( |
|
create: (context) => M_assetStatusProvider(), |
|
), |
|
ChangeNotifierProvider( |
|
create: (context) => AssetStatusProvider(), |
|
), |
|
], |
|
child: MaterialApp( |
|
theme: ThemeData( |
|
primarySwatch: Colors.blue, |
|
visualDensity: VisualDensity.adaptivePlatformDensity, |
|
), |
|
debugShowCheckedModeBanner: false, |
|
routes: { |
|
'/': (context) => SplashPage(), |
|
'/sign-in': (context) => SignInPage(), |
|
'/home': (context) => MainPage(), |
|
'/peminjaman-barang': (context) => AssetStatusPage(), |
|
'/peminjaman-barang/create': (context) => CreatePeminjamanBarang(), |
|
'/pengembalian-barang': (context) => PengembalianBarangPage(), |
|
'/pengembalian-barang/create': (context) => |
|
CreatePengembalianBarangPage(), |
|
// '/peminjaman-barang/show': (context) => |
|
// DetailPeminjamanBarangPage(assetId: 0), |
|
// '/category': (context) => SurveyDetailPage(), |
|
// '/map': (context) => GeoMapPage(), |
|
}, |
|
), |
|
); |
|
} |
|
}
|
|
|