Answers for "how to call function from another file dart flutter"

0

how to call function from another file dart flutter

// --- test.dart: ---
void launchWebView () {
  print("1234");
}

// --- main.dart: ---
import "test.dart";

class _MyHomePageState extends State<MyHomePage> {
   @override
   Widget build(BuildContext context) {
   
   // THIS ONLY WORKED WHEN I USED IT WITHIN THE BUILD CONTEXT, not before it.
       launchWebView();
Posted by: Guest on January-19-2022

Code answers related to "how to call function from another file dart flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language