Closed ahyangnb closed 1 week ago
i got it, it's real flutter ui frezee when background in ios, i'll try to solve it.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class PipOverlay extends StatefulWidget {
const PipOverlay({super.key});
@override
State<PipOverlay> createState() => _PipOverlayState();
}
class _PipOverlayState extends State<PipOverlay> {
RxInt randomInt = 0.obs;
late Timer _timer;
@override
void initState() {
super.initState();
_timer = Timer.periodic(Duration(seconds: 1), (timer) {
randomInt.value =
DateTime.now().millisecondsSinceEpoch % 100; // Example random value
});
}
@override
void dispose() {
_timer.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Obx(() {
return Text("Flutter Pip ${randomInt.value}");
}),
),
);
}
}
I don't know if issue
when the app is in the background, FlutterUi will stop running or black screen directly
in README.md say this.but please try it.
it's been run the PIP in background more than 10 minus after fix in ios without black or dispear.