- ๐ Pronouns: He/Him
- โ๏ธ Creator of FlatteredWithFlutter, FyndMyAI
- ๐ Event Speaker
- โ๏ธ Google Dev Library Contributor DevLibrary
- ๐ซ How to reach me: Check social links below.
Watch, Like, Share, Enjoy
Hands on Flutter Web
Home Page: https://web.flatteredwithflutter.com/
Watch, Like, Share, Enjoy
When I hover the mouse on back button or on menu button, the iFrame element is rebuilt or reloaded, the console is not show anything about the issue.
hello AseemWangoo,
I followed your tutorial (article, video) to use Wasm in Dart/Flutter with wasm_interop package(thank you for that). Can you please help me with this issue :
https://stackoverflow.com/questions/68316438/how-to-get-variables-value-from-custom-js-and-use-it-in-flutter-web-dart
I really don't now how to solve it.
for example
in example.js
`function alertMessage(text) {
alert(text)
}
window.logger = (flutter_value) => {
console.log({ js_context: this, flutter_value });
}`
main.dart
void main() {
js.context.callMethod('alertMessage', ['Flutter is calling upon JavaScript!']);
// var state = js.JsObject.fromBrowserObject(js.context['state']);
// print(state['hello']);
}
I tried this one.
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class IframeView extends StatefulWidget {
String url;
IframeView(this.url);
@OverRide
_IframeViewState createState() => _IframeViewState();
}
class _IframeViewState extends State {
final IFrameElement _iframeElement = IFrameElement();
Widget _iframeWidget;
@OverRide
void initState() {
_iframeElement.height = '500';
_iframeElement.width = '500';
_iframeElement.src = widget.url;
_iframeElement.style.border = 'none';
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory('iframeElement',
(int viewId) {
print('a');
return _iframeElement;
});
_iframeWidget = HtmlElementView(
key: UniqueKey(),
viewType: 'iframeElement',
);
super.initState();
}
@OverRide
Widget build(BuildContext context) {
// setState(() {
// _iframeElement.src=widget.url;
// });
return Container( margin: EdgeInsets.only(top:50),child: _iframeWidget,
);
}
}
but it loads first loaded url again and again.
i am getting error while get current location in flutter web
In the lower right corner of the table is a string of "Rows per Page"... How to change?
Hello friend, I saw your article on how to get a user's location...
a question, where does this json "https://geolocation-db.com/json/" come from?
is it your database?
Can I use it for something professional?
hello sir, i wanted to ask.. so i've try your repo which one is experiment with web. when i try to run it, it shown error and the error said
lib/app_level/widgets/dekstop/sliver_scaffold.dart
line 245 Error: Type 'PersistentHeaderShowOnScreenConfiguration' not found.
line 246 Error: The method 'PersistentHeaderShowOnScreenConfiguration' isn't defined for the class '_SliverDelegate'.
what should i do? tbh im new on flutter world. thanks
am trying to add and control checkbox's in your example but it's not working can you help please?
I try to use navigator.geolocation
like this on my flutter web :
@JS('navigator.geolocation') // navigator.geolocation namespace
library jslocation; // library name can be whatever you want
import "package:js/js.dart";
@JS('getCurrentPosition') // Accessing method getCurrentPosition from Geolocation API
external void getCurrentPosition(Function success(GeolocationPosition pos));
@JS()
@anonymous
class GeolocationCoordinates {
external double get latitude;
external double get longitude;
external double get altitude;
external double get accuracy;
external double get altitudeAccuracy;
external double get heading;
external double get speed;
external factory GeolocationCoordinates(
{double latitude,
double longitude,
double altitude,
double accuracy,
double altitudeAccuracy,
double heading,
double speed});
}
@JS()
@anonymous
class GeolocationPosition {
external GeolocationCoordinates get coords;
external factory GeolocationPosition({GeolocationCoordinates coords});
}
And i use it :
@override
void initState() {
super.initState();
_getLocation();
}
Future _getLocation() async {
if (kIsWeb) {
print("-----> web js");
getCurrentPosition(allowInterop((pos) => success(pos)));
} }
success(pos) {
try {
print(pos.coords.latitude);
print(pos.coords.longitude);
setState(() {
_loading = false;
print(
'${widget.url}?BranchName=&latitude=${pos.coords.latitude}&longitude=${pos.coords.longitude}');
});
} catch (ex) {
print("Exception thrown : " + ex.toString());
}
}
But success method never called?I check https://fir-signin-4477d.firebaseapp.com/#/location page and Mozilla GeoLocation is not work like me.
What is the problem?
This is my question on stackoverflow : https://stackoverflow.com/questions/64411270/flutter-web-get-location-on-web-by-location-plugin
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.