20240903 pre release
This commit is contained in:
@ -108,7 +108,22 @@ class AuthService {
|
||||
if (response.statusCode == 200) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
} else {
|
||||
debugPrint('Response body: ${response.body}');
|
||||
|
||||
print('Login failed with status code: ${response.statusCode}');
|
||||
var errorMessage = 'ログインに失敗しました。';
|
||||
if (response.statusCode == 400) {
|
||||
var errorBody = json.decode(utf8.decode(response.bodyBytes));
|
||||
errorMessage = errorBody['non_field_errors']?[0] ?? 'パスワードが正しくありません。';
|
||||
}
|
||||
Get.snackbar(
|
||||
"エラー",
|
||||
errorMessage,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
snackPosition: SnackPosition.TOP,
|
||||
duration: const Duration(seconds: 3),
|
||||
);
|
||||
cats = {};
|
||||
}
|
||||
} catch( e ){
|
||||
|
||||
@ -80,7 +80,7 @@ class ExternalService {
|
||||
<String, String>{'team_name': team, 'event_code': eventCode}),
|
||||
);
|
||||
|
||||
//print("---- start rogianing api status ---- ${response.statusCode}");
|
||||
print("---- start rogianing api status ---- ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
res = json.decode(utf8.decode(response.bodyBytes));
|
||||
|
||||
29
lib/services/motion_service.dart
Normal file
29
lib/services/motion_service.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'dart:io';
|
||||
|
||||
class MotionService {
|
||||
static const MethodChannel _channel = MethodChannel('net.sumasen.gifunavi/motion');
|
||||
|
||||
static Future<void> startMotionUpdates() async {
|
||||
if (Platform.isIOS) {
|
||||
try {
|
||||
await _channel.invokeMethod('startMotionUpdates');
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to start motion updates: '${e.message}'.");
|
||||
}
|
||||
} else{
|
||||
// Android の場合は何もしない、またはAndroid向けの代替実装を行う
|
||||
print("Motion updates not supported on this platform");
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> stopMotionUpdates() async {
|
||||
if (Platform.isIOS) {
|
||||
try {
|
||||
await _channel.invokeMethod('stopMotionUpdates');
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to stop motion updates: '${e.message}'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user