Category: Flutter

Flutter how can i set Auth token from flutter secure storage to dio header?

Query asked by user After login i setting user token to my user Secure storage. Like : Future<AuthResponseModel?> login(AuthRequstModel model) async { try { Response response = await _dio.post(loginPath, data: model); if (response.statusCode == 200) { final AuthResponseModel authResponseModel = AuthResponseModel.fromJson(response.data); if (authResponseModel.success!) { await UserSecureStorage.setField(“token”, authResponseModel.token); } return AuthResponseModel.fromJson(response.data); } return null; } catch […]

Slider widget changing the position of the dot over a texfile

Query asked by user Is it possible, to modify the slider widget value through a input from outside? For example from a text field? Writing 50 to the textfield for example, the dot of the slider would change to position 50. Answer we found from sources i have no idea why that would be necessary […]

How to send text to other page? ‘package:flutter/src/material/tab_controller.dart’: Failed assertion: line 181 pos 12: ‘value >= 0

Query asked by user heelp me I want to send text from the first page to the second page. Firts Page Padding( padding: const EdgeInsets.only(top: 16.0), child: RaisedGradientButton( child: Text( ‘Dapatkan Pengukuran’, style: TextStyle( color: Colors.white, fontSize: 20.0, fontFamily: ‘Nunito’, fontWeight: FontWeight.bold), ), gradient: LinearGradient( colors: const <Color>[Colors.purple, Colors.blue], ), onPressed: () { Navigator.push( context, […]

How to use Key Press Event on TextFormField in Flutter?

Query asked by user Is there any way to catch a keypress in textfield? In my case, when the user press enter key inside the text field, the values will be stored. For this to happen, I need to use Keypress-event like in Kotlin+Android. I just started trying flutter this week since it is interesting […]

Flutter build IOS on windows

Query asked by user I’m working on a flutter project and I want to build the IPA of my code using windows. I don’t want to test the application in my windows I want just to build the IPA. Is it possible to do it. Any help is highly appreciated. Answer we found from sources […]

The method ‘dark’ isn’t defined for the type ‘ThemeData’

Query asked by user I’m getting this errror while following a lecture. ThemeData.dark() is not working properly. import ‘package:zoom_clone/screens/login_screen.dart’; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: ‘Zoom Clone’, theme: ThemeData().dark(), home: const LoginScreen(), ); } } Answer […]

How to use Provider Package for Map

Query asked by user when i use ‘Late’ with Map<String, CartModel> _items; the lateinitialization error removes. but if the list is empty then the lateinitialization error appear. import ‘package:flutter/material.dart’; import ‘package:shop1/model/cart_item.dart’; class ShopProvider with ChangeNotifier { late Map<String, CartItem> _items; ShopProvider() { _items = { ‘1’: CartItem( id: ‘1’, title: ‘sikki’, imgUrl: ‘assets/cocacola.png’, qnt: 2, […]

WebView without height inside Scroll not working

Query asked by user On Flutter‚ĶI tried to add Webview inside all the available containers that support scroll but it didn’t work on Android. ListView( shrinkWrap: true, children: <Widget>[ Text(“hiiiiiiiiiiiii “), Text(“hiiiiiiiiiiiii “), Text(“hiiiiiiiiiiiii “), Expanded( child: WebView( key: Key(“webview1”), debuggingEnabled: true, javascriptMode: JavascriptMode.unrestricted, initialUrl: “https://flutter.dev/”)), Text(“hiiiiiiiiiiiii “), Text(“hiiiiiiiiiiiii “), Text(“hiiiiiiiiiiiii “), ], ) Answer […]

How to keep new TextFormField value on state change?

Query asked by user I want create a lot of TextFormField with int value.If user changed TextFormField value i was set FAB to visible.So user can save new value if he hit the FAB.But there is a problem with Setstate.When user changed TextFormField value its trigger OnChanged and i was set FAB visible inside setstate.When […]