How to save and download text file in Flutter web application

This method is based on manipulations with an HTML document. Some additional packages should be imported: import ‘dart:convert’; import ‘dart:html’ as html; // or package:universal_html/prefer_universal/html.dart Code snippet: final text=”this is the text file”; // prepare final bytes = utf8.encode(text); final blob = html.Blob([bytes]); final url = html.Url.createObjectUrlFromBlob(blob); final anchor = html.document.createElement(‘a’) as html.AnchorElement ..href = … Read more

Flutter Web: Cannot scroll with mouse down (drag) (Flutter 2.5+)

My final solution was a combination of the suggestions, wanting drag scrolling everywhere, so used this: class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( scrollBehavior: MaterialScrollBehavior().copyWith( dragDevices: {PointerDeviceKind.mouse, PointerDeviceKind.touch, PointerDeviceKind.stylus, PointerDeviceKind.unknown}, ), … Simple enough…

How to apply flex in flutter

Expanded is Similar to Flex and supports adding flex, You can wrap your children with Expanded and give flex as below Updated Code : Container( child: new Row( children: <Widget>[ new Expanded ( flex:1, child : Column( children: <Widget>[new Text(“Hello World”)], ),), new Expanded( flex :2, child: Column( children: <Widget>[ new Text( “This is a … Read more