easy_service_manager 1.3.3 easy_service_manager: ^1.3.3 copied to clipboard
This Package is used to add post production settings and features like more app settings, in-app-review, app rating system etc.
import 'package:easy_service_manager/easy_service_manager.dart';
import 'package:flutter/material.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData.dark(useMaterial3: true),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: WelcomeWidget(
iconPath:
'https://crosscode.dev/wp-content/uploads/2022/11/crosscode-horizontal-white.png',
initializeBuilder: initializeBuilder,
onDone: () => onPressedStandalone(false),
),
floatingActionButton: Column(
mainAxisSize: MainAxisSize.min,
children: [
EasyServicesManager.instance.rateFloatingActionButton() ??
const SizedBox(),
FloatingActionButton(
heroTag: "onFullScreenPressedStandalone",
onPressed: () => onPressedStandalone(true),
child: const Icon(Icons.launch),
),
FloatingActionButton(
heroTag: "onPressedStandalone",
onPressed: () => onPressedStandalone(false),
child: const Icon(Icons.push_pin),
)
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
);
}
static Widget getMoreSettings() {
return EasyServicesManager.instance.moreScreen();
}
void onPressedStandalone(bool fullscreenDialog) {
Navigator.of(context).push(
MaterialPageRoute(
fullscreenDialog: fullscreenDialog,
builder: (_) => Scaffold(body: getMoreSettings())),
);
}
Future<void> initializeBuilder() {
return EasyServicesManager.instance.initialize(
adIdManager: const TestAdIdManager(),
aboutAppDescription: 'You can add the app description here.',
supportEmail: 'mail@example.com',
itunesMoreAppLink: 'tiktok-ltd/id1322881000',
androidDeveloperName: 'TikTok+Pte.+Ltd',
appStoreID: '835599320',
privacyPolicy: 'This is the privacy policy here.',
remoteConfigEndpointUrl: 'nooralibutt.github.io/sample.json',
wallpapersKey: _wallpapersKeyMapper,
useNotifications: true,
isAutoScheduleNotification: true,
notificationsList: const [
'This is the 1st notification',
'This is the 2nd notification',
'This is the 3rd notification',
'This is the 4th notification',
],
);
}
}
String _wallpapersKeyMapper(bool isAndroidApproving, bool isIosApproving) {
if (isAndroidApproving || isIosApproving) return 'approving_wallpapers';
return 'wallpapers';
}