chore: rename some classes

This commit is contained in:
appflowy 2022-02-20 16:10:50 +08:00
parent 9012494e1f
commit 22742c904b
8 changed files with 12 additions and 12 deletions

View File

@ -14,5 +14,5 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
await FlowySystem.run(FlowyApp());
await FlowyRunner.run(FlowyApp());
}

View File

@ -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

View File

@ -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;

View File

@ -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();
}
}

View File

@ -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());
}
}

View File

@ -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);
}

View File

@ -10,7 +10,7 @@ class FlowyTest {
TestWidgetsFlutterBinding.ensureInitialized();
// await EasyLocalization.ensureInitialized();
await FlowySystem.run(FlowyTestApp());
await FlowyRunner.run(FlowyTestApp());
return FlowyTest();
}

View File

@ -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());