feat(frontend): make baseUrl dynamic for external network access and clear default login inputs
This commit is contained in:
@@ -14,8 +14,15 @@ class LoginScreen extends StatefulWidget {
|
||||
|
||||
class _LoginScreenState extends State<LoginScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final _emailController = TextEditingController(text: 'admin@finlytic.com');
|
||||
final _passwordController = TextEditingController(text: 'AdminDefaultPassword2026!');
|
||||
final _emailController = TextEditingController();
|
||||
final _passwordController = TextEditingController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_emailController.dispose();
|
||||
_passwordController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onLogin() {
|
||||
if (_formKey.currentState?.validate() ?? false) {
|
||||
|
||||
@@ -14,19 +14,19 @@ import '../../news/widgets/article_sentiment_dialog.dart';
|
||||
|
||||
class DailyNewsSnapshot extends StatelessWidget {
|
||||
final ApiClient apiClient;
|
||||
final String backendUrl;
|
||||
final String? backendUrl;
|
||||
|
||||
const DailyNewsSnapshot({
|
||||
super.key,
|
||||
required this.apiClient,
|
||||
this.backendUrl = 'http://localhost:5000',
|
||||
this.backendUrl,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => NewsBloc(
|
||||
repository: NewsRepository(apiClient: apiClient, backendUrl: backendUrl),
|
||||
repository: NewsRepository(apiClient: apiClient, backendUrl: backendUrl ?? ApiClient.baseUrl),
|
||||
)..add(FetchNews(date: DateTime.now().toIso8601String().substring(0, 10))),
|
||||
child: const _DailyNewsSnapshotContent(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user