How to implement user messages window in Flutter? - flutter

I want to implement user messages window in the home page of my application.
I want to notify the application users of events and activities taking place at the university on a specific date.
I add an image where the window I want to make is marked in purple :)
There is Widget in Flutter that supports it? or how I can implement it?
thanks!

There are a couple routes you could go here you could implement Firebase FCM messaging but I think this is overkill for what you are trying to do you probably want to go with flutter local notification I will post a link below. As for outlining it in purple this is very easy.
Container(
height: 200,
width: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
border: Border.all(color: Colors.purple, width: 5.0),
),
),
If you are not using a container something similar can be done with most widgets let me know if I can help you furtherFlutter Local Notifications

Related

Flutter InkWell widget color not updating after Tap

I am having trouble coding a function. In my app, a quiz has been added, the quiz functionality works, the quiz data is retrieved from a server and delivered as JSON data. I have a problem where my app does not show whether a user's answer is correct or not when they select an answer but will only do so if the user leaves the screen and then returns. Using a function that returns a color, the correct and incorrect answers are presented. However, I am unsure what the problem is; how can I solve it?
I would like to provide the code but it is a lot, so you can find it here: https://github.com/BotsheloRamela/code
Most of the functionality can be found here in the main code: https://github.com/BotsheloRamela/code/blob/main/option.dart
If you're having trouble with that then make sure to do it so
Material(
child: InkWell(
child : Ink()));
// and populate this accordingly

I want to show details to the right side of screen after clicking an item on left, flutter

[I want to do something like this][1]
I want to show details to the right side of screen after clicking an item on left for my web app
[1]: https://i.stack.imgur.com/6P4Oq.png
body:child:Row[
TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
OngoingOrder(),//listview inside each view
CompletedOrder(),
CancelledOrder(),
]),
),
ShowOrder(
//rightside of page
)
]),
),
please post your existing code to understand
what logic you have performed.
If you are using any state management tool then please also mention that.
pseudocode: (flutter basic without any state management)
1)create a null Object for the right side
2)perform a null check to show the default demo message "Select An Order to see"
3)when user select an Order, populate the created object with the selected data and call setState((){})

Flutter Image Hovering Overlay Effect

I am working on a flutter web project and I want to the following overlay effect over my image that whenever the cursor hovers over the image, a few buttons should show up, and the opacity of the image gets reduced (or blurred out) while hovering.
I have tried InkWell and GestureDectector but nothing seems to work.
This is basically what I am trying to achieve : Preview.
Try using hovering package to achieve the hovering effect on flutter_web.
First, import the package:
import 'package:hovering/hovering.dart';
Add a GlobalKey within your StatelessWidget:
final _key = GlobalKey<ScaffoldState>();
And then, use the HoverWidget:
HoverWidget(
hoverChild: Container(
height: 200,
width: 200,
color: Colors.green,
child: Center(child: Text('Hover Me..')),
),
onHover: (event) {
_key.currentState.showSnackBar(SnackBar(
content: Text('Yaay! I am Hovered'),
));
},
child: Container(
height: 200,
width: 200,
color: Colors.red,
child: Center(child: Text('Hover Me..')),
),
)
Check the example use case here
Hi Raj this is pretty simple
You just need to use Listener Widget which detects onPointerHover and update you app's state
Here is the api link follow it
Listener in Flutter
If any difficulties comment down below
Okay, over time I have tried many ways and would like to share my insight in case somebody else is looking for the same solution too.
So, the basic way to achieve this is to use the Hovering package.
Another way would be to use MouseRegion.
You can use the onEnter and onExit property of MouseRegion to detect when did the cursor entered and left the region/container you are trying to add a hove effect to.
You can use that to switch between your different app states.
Or it has onHover property as well, that basically tells that if the cursor is currently hovering that region or not you can use that too.
Note: I tried the Listener widget as well, but either I didn't understood it well, or it was too complicated to work with. Anyways, I couldn't achieve what I wanted.

How to use an Overlay without the Navigator/App?

Are there any code examples out there that show how to use an Overlay independant of a Navigator widget?
In our app, we do not want the TitleBar/AppBar to be part of the main nav-stack, it should stay at the top of the window, and be fixed position.
The TitleBar needs acccess to an Overlay though, as it has various tool-tips and pop-up panels.
The only I know to do this is double-wrap Navigator, or MaterialApp, both of which smell bad. I would like to use Overlay directly, but lack any guidance on how to implement it.
Looking a the source of Overlay does not provide much help, and I'd prefer not to delve too deeply into MaterialApp's thousands of lines of src code.
[EDIT] Looking at the Navigator source a bit, it seems Overlay is directly coupled to PageRoutes, which is a real shame :'( It would be nice if there was a simple Overlay(child: ) we could just use.
There is declarative package for using overlays called flutter_portal which lets you show overlays as part of the widget tree.
PortalEntry(
visible: true,
portal: Material(
elevation: 8,
child: IntrinsicWidth(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(title: Text('option 1')),
ListTile(title: Text('option 2')),
],
),
),
),
child: RaisedButton(...),
)
With this setup, you can toggle the overlay on and off with a single boolean ('visible') and you no longer have to make calls to Overlay.insert and Overlay.remove.

In Flutter, How does one create a 'how this app works' walk-through?

I want to launch a simple walk-through for our app. The user would log in for the first time (or select the 'tutorial' option in settings), and it would walk you through how to use the app.
To clarify, the app would launch a dialog/alertdialog and the background would go grey or become greyed out highlighting specific areas/buttons of the app to talk them through it. The dialog box would have a child of Text explaining how to use it.
After the user has clicked through the steps the tutorial would end but could be reactivated in settings.
Any help would be appreciated.
Thanks
There is a plugin called showcaseview and does pretty much what you want. You can get it here. For using it you need to wrap the page you want to show in a ShowCaseWidget
ShowCaseWidget(
builder: Builder(
builder : (context) () => Somewidget()
),
),
then for every part of the page you want to show a guide for it, wrap it in a ShowCase
Showcase(
key: _one,
title: 'Menu',
description: 'Click here to see menu options',
child: Icon(
Icons.menu,
color: Colors.black45,
),
),