@@ -30,7 +30,8 @@ final StreamController<ReceivedNotification> didReceiveLocalNotificationStream =
3030 StreamController <ReceivedNotification >.broadcast ();
3131
3232final StreamController <NotificationResponse > selectNotificationStream =
33- StreamController <NotificationResponse >.broadcast ();
33+ StreamController <NotificationResponse >.broadcast ();
34+
3435class ReceivedNotification {
3536 ReceivedNotification ({
3637 required this .id,
@@ -49,8 +50,10 @@ String? selectedNotificationPayload;
4950
5051@pragma ('vm:entry-point' )
5152void notificationTapBackground (NotificationResponse notificationResponse) {
52- print ('notification(${notificationResponse .id }) action tapped: '
53- '${notificationResponse .actionId } with payload: ${notificationResponse .payload }' );
53+ print (
54+ 'notification(${notificationResponse .id }) action tapped: '
55+ '${notificationResponse .actionId } with payload: ${notificationResponse .payload }' ,
56+ );
5457}
5558
5659void main () async {
@@ -92,7 +95,8 @@ void main() async {
9295 // For Android, request notification permission
9396 await flutterLocalNotificationsPlugin
9497 .resolvePlatformSpecificImplementation<
95- AndroidFlutterLocalNotificationsPlugin > ()
98+ AndroidFlutterLocalNotificationsPlugin
99+ > ()
96100 ? .requestNotificationsPermission ();
97101
98102 // Initialize GetX services
@@ -109,10 +113,7 @@ void main() async {
109113class MyApp extends StatelessWidget {
110114 final AdaptiveThemeMode ? savedThemeMode;
111115
112- const MyApp ({
113- super .key,
114- this .savedThemeMode,
115- });
116+ const MyApp ({super .key, this .savedThemeMode});
116117
117118 static final GlobalKey <ScaffoldMessengerState > scaffoldMessengerKey =
118119 GlobalKey <ScaffoldMessengerState >();
@@ -122,8 +123,8 @@ class MyApp extends StatelessWidget {
122123 final themeService = ThemeService .to;
123124
124125 return AdaptiveTheme (
125- light: themeService.getLightTheme () ,
126- dark: themeService.getDarkTheme () ,
126+ light: themeService.lightTheme ,
127+ dark: themeService.darkTheme ,
127128 initial: savedThemeMode ?? AdaptiveThemeMode .light,
128129 builder: (lightTheme, darkTheme) => MaterialApp (
129130 title: 'insta' ,
@@ -133,8 +134,8 @@ class MyApp extends StatelessWidget {
133134 themeMode: savedThemeMode == null
134135 ? ThemeMode .system
135136 : savedThemeMode == AdaptiveThemeMode .dark
136- ? ThemeMode .dark
137- : ThemeMode .light,
137+ ? ThemeMode .dark
138+ : ThemeMode .light,
138139 debugShowCheckedModeBanner: false ,
139140 home: const MyHomePage (),
140141 ),
@@ -171,35 +172,41 @@ class MyHomePageState extends State<MyHomePage> {
171172 var appVersion = await getAppVersion ();
172173 var newVersion = await checkUpdate ();
173174 if (appVersion != newVersion) {
174- ScaffoldMessenger .of (context).showSnackBar (SnackBar (
175- content: RichText (
176- text: TextSpan (children: [
177- TextSpan (
178- text: 'New version download' ,
179- style: TextStyle (
180- fontSize: 18 ,
181- color: Theme .of (context).brightness == Brightness .dark
182- ? Colors .white
183- : Colors .black,
175+ ScaffoldMessenger .of (context).showSnackBar (
176+ SnackBar (
177+ content: RichText (
178+ text: TextSpan (
179+ children: [
180+ TextSpan (
181+ text: 'New version download' ,
182+ style: TextStyle (
183+ fontSize: 18 ,
184+ color: Theme .of (context).brightness == Brightness .dark
185+ ? Colors .white
186+ : Colors .black,
187+ ),
188+ ),
189+ TextSpan (
190+ text: 'Link' ,
191+ style: const TextStyle (fontSize: 20 , color: Colors .blue),
192+ recognizer: TapGestureRecognizer ()
193+ ..onTap = () {
194+ launchUrl (
195+ Uri .parse ('https:gopi2401.github.io/download/' ),
196+ );
197+ },
198+ ),
199+ ],
184200 ),
185201 ),
186- TextSpan (
187- text: 'Link' ,
188- style: const TextStyle (fontSize: 20 , color: Colors .blue),
189- recognizer: TapGestureRecognizer ()
190- ..onTap = () {
191- launchUrl (Uri .parse ('https:gopi2401.github.io/download/' ));
192- })
193- ])),
194- ));
202+ ),
203+ );
195204 }
196205 }
197206
198207 Widget toast = Container (
199208 padding: const EdgeInsets .symmetric (horizontal: 24.0 , vertical: 12.0 ),
200- decoration: BoxDecoration (
201- borderRadius: BorderRadius .circular (25.0 ),
202- ),
209+ decoration: BoxDecoration (borderRadius: BorderRadius .circular (25.0 )),
203210 child: const Row (
204211 mainAxisSize: MainAxisSize .min,
205212 children: [
@@ -245,9 +252,7 @@ class MyHomePageState extends State<MyHomePage> {
245252 padding: const EdgeInsets .all (20.0 ),
246253 child: TextField (
247254 controller: reelController,
248- decoration: const InputDecoration (
249- hintText: "Url" ,
250- ),
255+ decoration: const InputDecoration (hintText: "Url" ),
251256 ),
252257 ),
253258 if (errorMessage != null )
@@ -260,9 +265,7 @@ class MyHomePageState extends State<MyHomePage> {
260265 ),
261266 ElevatedButton (
262267 child: downloading
263- ? const CircularProgressIndicator (
264- color: Colors .white,
265- )
268+ ? const CircularProgressIndicator (color: Colors .white)
266269 : const Text ('Download' ),
267270 onPressed: () async {
268271 if (! downloading) {
@@ -335,53 +338,44 @@ class DrawerWidget extends StatelessWidget {
335338 child: Column (
336339 children: [
337340 const DrawerHeader (
338- duration: Duration (seconds: 1 ),
339- curve: Curves .easeInCubic,
340- decoration: BoxDecoration (
341- image: DecorationImage (
342- scale: 2.5 , image: AssetImage ('assets/logo.png' ))),
343- child: Column (
344- mainAxisAlignment: MainAxisAlignment .end,
345- children: [
346- Text (
347- 'Welcome!' ,
348- textAlign: TextAlign .center,
349- style: TextStyle (fontSize: 33 ),
350- )
351- ],
352- )),
341+ duration: Duration (seconds: 1 ),
342+ curve: Curves .easeInCubic,
343+ decoration: BoxDecoration (
344+ image: DecorationImage (
345+ scale: 2.5 ,
346+ image: AssetImage ('assets/logo.png' ),
347+ ),
348+ ),
349+ child: Column (
350+ mainAxisAlignment: MainAxisAlignment .end,
351+ children: [
352+ Text (
353+ 'Welcome!' ,
354+ textAlign: TextAlign .center,
355+ style: TextStyle (fontSize: 33 ),
356+ ),
357+ ],
358+ ),
359+ ),
353360 Expanded (
354361 child: ListView (
355362 children: [
356363 ListTile (
357- leading: const Icon (
358- Icons .home,
359- ),
360- title: const Text (
361- 'Home' ,
362- style: TextStyle (
363- fontSize: 18 ,
364- ),
365- ),
364+ leading: const Icon (Icons .home),
365+ title: const Text ('Home' , style: TextStyle (fontSize: 18 )),
366366 onTap: () {
367367 Navigator .of (context).pop ();
368368 },
369369 ),
370370 ListTile (
371- leading: const Icon (
372- Icons .error_outline,
373- ),
374- title: const Text (
375- 'About' ,
376- style: TextStyle (
377- fontSize: 18 ,
378- ),
379- ),
371+ leading: const Icon (Icons .error_outline),
372+ title: const Text ('About' , style: TextStyle (fontSize: 18 )),
380373 onTap: () {
381374 Navigator .push (
382375 context,
383376 MaterialPageRoute (
384- builder: (context) => const AboutPage ()),
377+ builder: (context) => const AboutPage (),
378+ ),
385379 );
386380 },
387381 ),
@@ -397,7 +391,9 @@ class DrawerWidget extends StatelessWidget {
397391 () => recoveryService.deletedFiles.isNotEmpty
398392 ? Container (
399393 padding: const EdgeInsets .symmetric (
400- horizontal: 8 , vertical: 4 ),
394+ horizontal: 8 ,
395+ vertical: 4 ,
396+ ),
401397 decoration: BoxDecoration (
402398 color: Colors .orange,
403399 borderRadius: BorderRadius .circular (12 ),
@@ -428,16 +424,14 @@ class DrawerWidget extends StatelessWidget {
428424 ListTile (
429425 leading: Obx (
430426 () => Icon (
431- themeService.isDarkMode.value
427+ themeService.isDarkMode
432428 ? Icons .light_mode
433429 : Icons .dark_mode,
434430 ),
435431 ),
436432 title: Obx (
437433 () => Text (
438- themeService.isDarkMode.value
439- ? 'Light Mode'
440- : 'Dark Mode' ,
434+ themeService.isDarkMode ? 'Light Mode' : 'Dark Mode' ,
441435 style: const TextStyle (fontSize: 18 ),
442436 ),
443437 ),
0 commit comments