mydomain
No ADS
No ADS

FlutterArtist start

  1. coreFeaturesAdapter
FlutterArtist.start() is a crucial method for configuring the FlutterArtist application. This method must be called before the app starts via Flutter's runApp() function. Below is a code snippet illustrating how to implement it.
main.dart
Future<void> initGlobalsDependencies() async { 
  
  await FlutterArtist.start(
    appConfiguration: MyDemoAppConfiguration(),
    // Other properties
  );
  
  // Initialize your other dependencies
}

Future<void> main() async {
  await initGlobalsDependencies();
  //
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // Other codes
}
Let’s examine an example of how FlutterArtist.start() is used in the FlutterArtist Demo, then we will analyze its core components in detail.
FlutterArtist.start()
await FlutterArtist.start(
  appConfiguration: MyDemoAppConfiguration(),
  coreFeaturesAdapter: GetxFlutterArtistCoreFeaturesAdapter(),
  localeAdapter: GetxFlutterArtistLocaleAdapter(
    supportedLocales: const [Locale("en", "US"), Locale("vi", "VN")],
  ),
  notificationAdapter: NotificationAdapterImpl(),
  loginLogoutAdapter: LoginLogoutAdapterImpl(),
  globalDataAdapter: GlobalDataAdapterImpl(),
  showRestDebugDialog: (BuildContext context) {
    bool isSystemUser = FlutterArtist.loggedInUser?.isSystemUser ?? false;
    showRestDebugDialog(
      context,
      showJson: isSystemUser,
      showToken: isSystemUser,
    );
  },
  maxStoredLogEntryCount: 20,
  notificationFetchPeriodInSeconds: 24 * 60 * 60,
  codeFlowRetentionPeriodInSeconds: 20,
  debugOptions: DebugOptions(),
  consoleDebugOptions: ConsoleDebugOptions(
    enabled: true,
    navigatorObserver: false,
    routeAware: false,
    globalManager: false,
    dataLoad: false,
  ),
);

1. coreFeaturesAdapter

No ADS

FlutterArtist

Show More
No ADS