oke jadi coba
This commit is contained in:
parent
783e623619
commit
d6dd976a69
|
|
@ -1,8 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
// import 'package:klimatologiot/blocs/authentication_bloc/authentication_bloc.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:klimatologiot/blocs/authentication_bloc/authentication_bloc.dart';
|
||||
|
||||
import 'package:klimatologiot/screens/home/home_screen.dart';
|
||||
import 'package:klimatologiot/screens/auth/views/welcome_screen.dart';
|
||||
import 'package:klimatologiot/screens/home/views/home_screen.dart';
|
||||
|
||||
class MyAppView extends StatelessWidget {
|
||||
const MyAppView({super.key});
|
||||
|
|
@ -20,16 +21,15 @@ class MyAppView extends StatelessWidget {
|
|||
onPrimary: Colors.white
|
||||
),
|
||||
),
|
||||
home: HomeScreen()
|
||||
// home: BlocBuilder<AuthenticationBloc, AuthenticationState>(
|
||||
// builder: ((context, state){
|
||||
// if(state.status == AuthenticationStatus.authenticated){
|
||||
// return HomeScreen();
|
||||
// } else {
|
||||
// return WelcomeScreen();
|
||||
// }
|
||||
// }),
|
||||
// )
|
||||
home: BlocBuilder<AuthenticationBloc, AuthenticationState>(
|
||||
builder: ((context, state){
|
||||
if(state.status == AuthenticationStatus.authenticated){
|
||||
return HomeScreen();
|
||||
} else {
|
||||
return WelcomeScreen();
|
||||
}
|
||||
}),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -36,23 +36,12 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||
setState(() {
|
||||
signUpRequired = false;
|
||||
});
|
||||
// User sudah terdaftar dan auth state akan otomatis update via AuthenticationBloc
|
||||
// Tungur sebentar agar Firestore selesai menyimpan data
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Registrasi berhasil! Mengarahkan...')),
|
||||
);
|
||||
} else if (state is SignUpProcess) {
|
||||
setState(() {
|
||||
signUpRequired = true;
|
||||
});
|
||||
} else if (state is SignUpFailure) {
|
||||
setState(() {
|
||||
signUpRequired = false;
|
||||
});
|
||||
final message = (state as SignUpFailure).message ?? 'Registrasi gagal, silakan coba lagi';
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(message)),
|
||||
);
|
||||
return;
|
||||
}
|
||||
},
|
||||
child: Form(
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import '../monitoring/evaporasi_monitoring_screen.dart';
|
||||
import '../monitoring/wind_speed_monitoring_screen.dart';
|
||||
import '../monitoring/air_quality_monitoring_screen.dart';
|
||||
import '../../monitoring/evaporasi_monitoring_screen.dart';
|
||||
import '../../monitoring/wind_speed_monitoring_screen.dart';
|
||||
import '../../monitoring/air_quality_monitoring_screen.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({super.key});
|
||||
|
|
@ -157,10 +157,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: fl_chart
|
||||
sha256: "00b74ae680df6b1135bdbea00a7d1fc072a9180b7c3f3702e4b19a9943f5ed7d"
|
||||
sha256: "7ca9a40f4eb85949190e54087be8b4d6ac09dc4c54238d782a34cf1f7c011de9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.66.2"
|
||||
version: "1.1.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
|
|
|
|||
|
|
@ -7,11 +7,6 @@ environment:
|
|||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
fl_chart: ^0.66.0
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
firebase_core: ^4.3.0
|
||||
firebase_auth: ^6.1.3
|
||||
cloud_firestore: ^6.1.1
|
||||
|
|
@ -23,6 +18,8 @@ dependencies:
|
|||
user_repository:
|
||||
path: packages/user_repository
|
||||
cupertino_icons: ^1.0.8
|
||||
fl_chart: ^1.1.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
|
|
|||
Loading…
Reference in New Issue