37 lines
993 B
Dart
37 lines
993 B
Dart
import 'dart:async';
|
|
import 'dart:convert';
|
|
import 'dart:math';
|
|
|
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
|
import 'package:flutter/material.dart';
|
|
import 'package:http/http.dart' as http;
|
|
import 'package:record/record.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'audio_source.dart';
|
|
|
|
part 'app/app.dart';
|
|
part 'fitur/auth/auth.dart';
|
|
part 'fitur/home/confivoice_shell.dart';
|
|
part 'fitur/saved_analyses/saved_analyses_page.dart';
|
|
part 'models/analysis_models.dart';
|
|
part 'fitur/prediction/prediction_page.dart';
|
|
|
|
void main() {
|
|
runApp(const ConfiVoiceMobileApp());
|
|
}
|
|
|
|
String defaultApiEndpoint() {
|
|
return kIsWeb
|
|
? 'http://127.0.0.1:8000/predict'
|
|
: 'http://MacBook-Pro-2.local:8000/predict';
|
|
}
|
|
|
|
String normalizeApiEndpoint(String endpoint) {
|
|
final cleanEndpoint = endpoint.trim();
|
|
if (kIsWeb && cleanEndpoint.toLowerCase().contains('macbook-pro-2.local')) {
|
|
return 'http://127.0.0.1:8000/predict';
|
|
}
|
|
return cleanEndpoint;
|
|
}
|