Posts

Continuation: Enhancing Push Notifications in Flutter Using Firebase

Image
Enhancing Push Notifications in Flutter  In the previous blog post , we covered the fundamental steps to integrate push notifications into a Flutter app using Firebase Cloud Messaging (FCM). In this continuation, we'll explore how to open a specific page when the user clicks on a notification, thereby enhancing the user experience and providing contextual information. Let's dive into the code changes required to handle notifications effectively: Updating firebase_api.dart import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:pushnotification/Page/notification_screen.dart'; import 'package:pushnotification/main.dart'; class FirebaseApi { final _firebaseMessaging = FirebaseMessaging.instance; void handleMessage(RemoteMessage? message) { if (message == null) return; navigatorKey.currentState?.pushNamed(NotificationScreen.route, arguments: message); } Future<void> handleBackgroundMessage(RemoteMessage mes

Implementing Push Notifications in Flutter Using Firebase

Image
Please, support my blog by clicking on our sponsors ad! Unlocking the Power of Push Notifications in Flutter with Firebase Cloud Push notifications are an essential aspect of modern mobile applications, allowing developers to engage users even when they are not actively using the app. In Flutter, integrating push notifications can be efficiently done through Firebase Cloud Messaging (FCM). In this tutorial, we'll walk through the steps to set up push notifications in a Flutter app using Firebase and also open specific page when user tap on notification . Follow steps to create push notification in both project. Create Project in  https://console.firebase.google.com/ Create Project for push notification After Creating Project add app for both IOS and Android Project. Create app in project For Both IOS and Android project add Package name. Package name should be same as your package name in Android and Project. Click on Register App Download Google Service json. If you

Mastering Flutter Localization Building

Image
  Create Multilingual Flutter App In today's globalized world, building apps that cater to users from diverse linguistic backgrounds is no longer just an option; it's a necessity. Whether you're developing a simple utility app or a complex enterprise solution, ensuring that your app speaks the language of your users can significantly enhance user experience and engagement. One of the most popular frameworks for building cross-platform mobile applications is Flutter. Flutter provides a rich set of tools and libraries for developing beautiful and performant apps, and it also offers robust support for localization and internationalization out of the box. In this comprehensive guide, we'll dive deep into Flutter localization, exploring everything from setting up your project for multilingual support to implementing dynamic language switching within your app. By the end of this guide, you'll be equipped with the knowledge and skills to create multilingual Flutter apps th

Master Flutter MVVM: Easy Guide for Efficient App Development

Image
  Introduction to MVVM Architecture MVVM (Model-View-ViewModel) is a software architectural pattern widely used in building user interfaces, particularly in frameworks like WPF, Xamarin, and Flutter. It's an evolution of the MVC (Model-View-Controller) pattern, aiming to improve separation of concerns and facilitate testability and maintainability of code. In MVVM, the UI is divided into three components: Model: Represents the data and business logic of the application. It encapsulates the data and operations that manipulate that data. The model notifies the ViewModel of any changes, but it's unaware of the UI. View: Represents the user interface. It's responsible for displaying data and capturing user input. Unlike MVC, the view in MVVM is passive and doesn't directly interact with the model. Instead, it binds to properties and commands exposed by the ViewModel. ViewModel: Acts as an intermediary between the view and the model. It exposes properties and commands tha

A Taxi Booking App Built with Flutter: All you should know

Image
  A Taxi Booking App Built with Flutter Introduction: In our fast-paced world, getting from point A to point B has never been easier, all thanks to the wonders of technology. Taxi booking apps have made the once-daunting task of hailing a cab as easy as pie, with just a few taps on your smartphone. In this comprehensive guide, we'll take a deep dive into the world of taxi booking apps, exploring what they are, how they work, and how you can create your very own using Flutter, a user-friendly toolkit developed by Google. What Exactly is a Taxi Booking App? Convenience at Your Fingertips: Taxi booking apps act as your personal transportation assistant, making it incredibly convenient to find and book rides wherever you are.     Effortless Navigation: Say goodbye to the hassle of flagging down taxis on the street. With a taxi booking app, navigation becomes a breeze, with intuitive interfaces guiding you every step of the way.     Time-Saving Solutions: No more wasting time waiting fo

Create Taxi Booking - OrderConfirm.dart

import 'package:cached_network_image/cached_network_image.dart' ; import 'package:flutter/material.dart' ; import 'package:font_awesome_flutter/font_awesome_flutter.dart' ; import 'package:google_maps_flutter/google_maps_flutter.dart' ; import 'package:myfirstproject/ViewModels/vehicleviewmodel.dart' ; import 'package:myfirstproject/common/constants.dart' ; import 'package:myfirstproject/payment.dart' ; import 'package:provider/provider.dart' ; class OrderConfirm extends StatefulWidget { @override OrderConfirmState createState() => OrderConfirmState (); } class OrderConfirmState extends State<OrderConfirm> { Set<Polyline> _polylines = {}; @override Widget build(BuildContext context) { Widget _buildGoogleMap() { List<LatLng> polylineCoordinates = []; // Define this list to store coordinates of the polyline // Add source and destination coordinates to polylineCoordinates list

Create Taxi Booking - FareBreakDown.dart

  import 'package:cached_network_image/cached_network_image.dart' ; import 'package:flutter/material.dart' ; import 'package:font_awesome_flutter/font_awesome_flutter.dart' ; import 'package:myfirstproject/orderconfirm.dart' ; import 'package:myfirstproject/payment.dart' ; import 'common/constants.dart' ; class FareBreakdown extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold ( body: Padding ( padding: const EdgeInsets . all ( 20.0 ), child: Container (child: Column (children: [ Row ( children: [ IconButton ( onPressed: () { Navigator. pop (context); }, icon: Icon (FontAwesomeIcons. arrowLeftLong ), color: Navy, ), Expanded (child: Align (alignment: Alignment. center , child: Text ( "Fare Breakdown" , style: TextStyle (color: N