mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: rename some classes
This commit is contained in:
parent
9012494e1f
commit
22742c904b
@ -14,5 +14,5 @@ void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await EasyLocalization.ensureInitialized();
|
||||
|
||||
await FlowySystem.run(FlowyApp());
|
||||
await FlowyRunner.run(FlowyApp());
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ abstract class EntryPoint {
|
||||
Widget create();
|
||||
}
|
||||
|
||||
class FlowySystem {
|
||||
class FlowyRunner {
|
||||
static Future<void> run(EntryPoint f) async {
|
||||
// Specify the env
|
||||
final env = integrationEnv();
|
||||
@ -41,8 +41,8 @@ class FlowySystem {
|
||||
getIt<AppLauncher>().addTask(InitRustSDKTask());
|
||||
|
||||
if (!env.isTest()) {
|
||||
getIt<AppLauncher>().addTask(ApplicationWidgetTask());
|
||||
getIt<AppLauncher>().addTask(InitPlatformService());
|
||||
getIt<AppLauncher>().addTask(InitAppWidgetTask());
|
||||
getIt<AppLauncher>().addTask(InitPlatformServiceTask());
|
||||
}
|
||||
|
||||
// execute the tasks
|
||||
|
@ -10,7 +10,7 @@ import 'package:window_size/window_size.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flowy_sdk/log.dart';
|
||||
|
||||
class ApplicationWidgetTask extends LaunchTask {
|
||||
class InitAppWidgetTask extends LaunchTask {
|
||||
@override
|
||||
LaunchTaskType get type => LaunchTaskType.appLauncher;
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
import 'package:app_flowy/user/infrastructure/network_monitor.dart';
|
||||
import '../startup.dart';
|
||||
|
||||
class InitPlatformService extends LaunchTask {
|
||||
class InitPlatformServiceTask extends LaunchTask {
|
||||
@override
|
||||
LaunchTaskType get type => LaunchTaskType.dataProcessing;
|
||||
|
||||
@override
|
||||
Future<void> initialize(LaunchContext context) async {
|
||||
getIt<NetworkMonitor>().start();
|
||||
getIt<NetworkListener>().start();
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,6 @@ class UserDepsResolver {
|
||||
getIt.registerFactory<HomeBloc>(() => HomeBloc());
|
||||
getIt.registerFactory<EditPannelBloc>(() => EditPannelBloc());
|
||||
getIt.registerFactory<SplashBloc>(() => SplashBloc());
|
||||
getIt.registerLazySingleton<NetworkMonitor>(() => NetworkMonitor());
|
||||
getIt.registerLazySingleton<NetworkListener>(() => NetworkListener());
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ import 'package:flowy_sdk/dispatch/dispatch.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-net/network_state.pb.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class NetworkMonitor {
|
||||
class NetworkListener {
|
||||
final Connectivity _connectivity = Connectivity();
|
||||
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
||||
|
||||
NetworkMonitor() {
|
||||
NetworkListener() {
|
||||
_connectivitySubscription = _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ class FlowyTest {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
// await EasyLocalization.ensureInitialized();
|
||||
|
||||
await FlowySystem.run(FlowyTestApp());
|
||||
await FlowyRunner.run(FlowyTestApp());
|
||||
return FlowyTest();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ void main() {
|
||||
|
||||
group('WelcomeBloc', () {
|
||||
blocTest<WelcomeBloc, WelcomeState>(
|
||||
"create workspace",
|
||||
"welcome screen init",
|
||||
build: () => getIt<WelcomeBloc>(param1: userInfo),
|
||||
act: (bloc) {
|
||||
bloc.add(const WelcomeEvent.initial());
|
||||
|
Loading…
Reference in New Issue
Block a user