Hint text is not visible in login_fresh package of flutter - flutter

I want to show hint text over the input box in flutter. And I did not find any hint key related to this package. It is neither visible on the login nor the sign-up page.
LoginFresh buildLoginFresh() {
List<LoginFreshTypeLoginModel> listLogin = [
LoginFreshTypeLoginModel(
callFunction: (BuildContext _buildContext) {
// develop what they want the facebook to do when the user clicks
},
logo: TypeLogo.facebook),
LoginFreshTypeLoginModel(
callFunction: (BuildContext _buildContext) {
// develop what they want the Google to do when the user clicks
},
logo: TypeLogo.google),
LoginFreshTypeLoginModel(
callFunction: (BuildContext _buildContext) {
Navigator.of(_buildContext).push(
MaterialPageRoute(
builder: (_buildContext) => widgetLoginFreshUserAndPassword(),
),
);
},
logo: TypeLogo.userPassword,
),
];
return LoginFresh(
pathLogo: 'assets/images/horario.jpg',
backgroundColor: Colors.black,
textColor: Colors.black,
isExploreApp: false,
functionExploreApp: () {
// develop what they want the ExploreApp to do when the user clicks
},
isFooter: false,
widgetFooter: widgetFooter(),
typeLoginModel: listLogin,
isSignUp: true,
widgetSignUp: widgetLoginFreshSignUp(),
);
}
Click here is view screenshot

Wrap your LoginFreshUserAndPassword with the Theme widget like this :
Theme(
data: ThemeData(hintColor: Colors.red),
child: LoginFreshUserAndPassword(),
)
it should work now.

Related

How to open link inside the pdf in webview flutter

I have added a pdfviewer in my Apps using Library flutter: flutter_cached_pdfview
some part of the code:
import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';
goToReading(String link){
Navigator.push(context, MaterialPageRoute(
builder: (_)=> PDF(
enableSwipe: true,
swipeHorizontal: false,
autoSpacing: false,
pageFling: false,
onError: (error) {
print(error.toString());
},
onPageError: (page, error) {
print('$page: ${error.toString()}');
},
).fromUrl(link,
placeholder: (progress) => Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Lottie.asset(
'assets/images/data.json',
height: 200,
controller: _controller,
onLoaded: (composition) {
_controller..duration = composition.duration..forward();
},
),
),
)
)
));
}
What I want is to open every link inside the pdf to open in webview for now it open in external browser (Chrome, safari),
************************************************************************I want it to open in internal webview inside the app it may be possible by using urllauncher but i dont know how to use it,
See this to understand my problem
See this to understand the current status
You have to set onLinkHandle and preventLinkNavigation:true in your file.
On onLinkHandle, you can set it to open WebView inside your app instead of opening the browser for it. Becuase by default it will always open web browser if you don't specify those things.

Set counter of notification using awesome_notification flutter

I am using awesome_notifications: ^0.0.6+12 as a local notification that shows notification/information on the status bar of the device. So far the function to show a notification runs very well, but I got a problem with the counter of notification.
As we know.. when one notification pops up there will be a flag counter in our icon apps 1 and when the second notification pops up.. it will turn into 2
But, the problem is... when I click the notification from the status bar and then the app is opening, the counter is still 1 while.. it should be removed after I click it... Is there a way to solve this? here is the part of the code
notifRequirement() {
AwesomeNotifications().actionStream.listen((notification) {
if (notification.channelKey == 'basic_channel' && Platform.isIOS) {
AwesomeNotifications().getGlobalBadgeCounter().then(
(value) =>
AwesomeNotifications().setGlobalBadgeCounter(value - 1),
);
}
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (_) => MainScreen(),
),
(route) => route.isFirst,
);
});
}
I call notifRequirement inside initState and in main.dart:
AwesomeNotifications().initialize(
'resource://drawable/darisdmmodified',
[
NotificationChannel(
channelKey: 'scheduled',
channelName: 'Scheduled Notifications',
defaultColor: Colors.red,
locked: false,
importance: NotificationImportance.High,
channelShowBadge: true,
channelDescription: "description 1"),
],
);

How to add a navigation to another screen in a list in flutter

I have made a dart file where I will pull static data and call them in another dart file. Those data need a navigation to another screen but I cannot find a way to add the navigation.
Here is the list without path:
"Delivery",
"Transfer",
"Consumption",
"Adjustment",
];```
and the result I want to achieve is something like this:
```List tasks = [
{'label': 'Delivery',
'path': ' Navigator.pushNamed(context, '/deliveryScreen');'
},
{'label': 'Transfer',
'path': ' Navigator.pushNamed(context, '/transferScreen');'
},
];```
Is there a way of doing it? Cheers
You're on the right track. You could just add the name of the path to the corresponding page widget you want to navigate to, like:
List tasks = [
{ 'label': 'Delivery', 'path': '/deliveryScreen' },
{ 'label': 'Transfer', 'path': '/transferScreen' }
];
Each one of them will correspond to your routes (if you're doing it like this on your MaterialApp routes):
...
routes: {
'/deliveryScreen': (context) => const DeliveryScreen(),
'/transferScreen': (context) => const TransferScreen()
}
...
Then is all a matter of you accessing that tasks lists wherever you'll be rendering the navigation strategy you need (i.e. you want to do a Row* of TextButton widgets, as in):
Row(
children: List.generate(tasks.length, (index) {
var task = tasks[index];
return TextButton(
onPressed: () {
Navigator.of(context).pushNamed(task['path']));
},
child: Text(task['label'])
);
})
)

how to refresh current page while doing pull to refresh (LiquidPullToRefresh) in Flutter Bloc

am using bloc method for home screen. I want to do pull to refresh in home screen...
I tired too many ways not getting solution...could you please suggest some solution.
In side onrefresh() I added few changes
1 . BlocProvider(
create: (context) => OttGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title, "homePage")),
//child: HomePage(),
child: OttGetHomeInnerCatPage(
wtitle: widget.title, mixpanelinner: widget.mixpanel),
)
2. _feedsBloc.add(FeedsFetched(widget.wtitle, "homePage"));
3. setState(() {
_feedsBloc.add(FeedsFetched(widget.wtitle, "homePage"));
BlocProvider(
create: (context) => OttGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title, "homePage")),
//child: HomePage(),
child: OttGetHomeInnerCatPage(
wtitle: widget.title, mixpanelinner: widget.mixpanel),
)
});
While
this seems to be the method you're using to fetch data
OttGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title, "homePage")),
Wrap your body in liquid pull to refresh
LiquidPullToRefresh(
key: _refreshIndicatorKey, // key if you want to add
onRefresh: ()async{
//cal your data source
OttGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title, "homePage")),
}
child: ListView(), // scroll view
);

Flutter "Rate my App" always requires a Review when using native dialog on Android

I'm using the 'Rate my App' package to ask for rates in my app. https://pub.dev/packages/rate_my_app
I'm using the same code shown in the package page, but i'm setting the 'ignoreNativeDialog' parameter to false in order to use the native API even in Android. But when the dialog appears on android always requires a review after a rate.
Is it any way to set the review to be optional?
RateMyApp rateMyApp = RateMyApp(
preferencesPrefix: 'rateMyApp_',
minDays: 7,
minLaunches: 10,
remindDays: 7,
remindLaunches: 10,
);
rateMyApp.init().then((_) {
if (rateMyApp.shouldOpenDialog) {
rateMyApp.showStarRateDialog(
context,
title: 'Rate this app',
message: 'You like this app ? Then take a little bit of your time to leave a rating :',
actionsBuilder: (context, stars) {
return [
FlatButton(
child: Text('OK'),
onPressed: () async {
print('Thanks for the ' + (stars == null ? '0' : stars.round().toString()) + ' star(s) !');
await rateMyApp.callEvent(RateMyAppEventType.rateButtonPressed);
Navigator.pop<RateMyAppDialogButton>(context, RateMyAppDialogButton.rate);
},
),
];
},
ignoreNativeDialog: false, // This is the one parameter i set to false
dialogStyle: DialogStyle(
titleAlign: TextAlign.center,
messageAlign: TextAlign.center,
messagePadding: EdgeInsets.only(bottom: 20),
),
starRatingOptions: StarRatingOptions(),
onDismissed: () => rateMyApp.callEvent(RateMyAppEventType.laterButtonPressed),
);
}
});
Now it's clear.
The review was required becouse I was using it on a registered tester account. I tested with another account and it worked fine.