Closed Ahsanmughal closed 2 years ago
Hello :)
Yes just change it :) it is easy as that ^^
hope it is as easy as you mentioned, i'm new in flutter, please check the example code. ` import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_mjpeg/flutter_mjpeg.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } }
class MyHomePage extends HookWidget {
@override
Widget build(BuildContext context) {
final isRunning = useState(true);
String statevalue = '5552';
return Scaffold(
appBar: AppBar(
title: Text('Flutter Demo Home Page'),
),
body: Column(
children:
I suggest that you read/learn how to update state in flutter :)
Here you update your variable but the widget is not rebuilt so it didn't really change.
You can use useState('5552');
instead and it will fix your issue because it will trigger a rebuild.
Hi @jaumard
is there any way to update or change the stream on button click.