add the basic single R

dev_faiz
Elham Rababh 4 years ago
parent c646861185
commit 4ba94f86f6

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/utils/signalR_utils.dart';
import 'core/base/app_scaffold_widget.dart';
import 'core/base/project_view_model.dart';
@ -49,14 +50,6 @@ class MyApp extends StatelessWidget {
class MyHomePage extends StatefulWidget {
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
String title ="MyHomePage";
@ -65,36 +58,19 @@ class MyHomePage extends StatefulWidget {
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
SignalRHelper signalRHelper= SignalRHelper();
return AppScaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
Text(
signalRHelper.msg,
),
],
),

@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import 'package:signalr_core/signalr_core.dart';
class SignalRHelper{
String hubBaseURL ="";
String msg ="Elham";
HubConnection connection;
SignalRHelper(){
connection = HubConnectionBuilder()
.withUrl(
hubBaseURL,
HttpConnectionOptions(
logging: (level, message) {
msg = message;
print("$message");
},
)
).build();
}
closeConnection(BuildContext context) async {
if(connection.state == HubConnectionState.connected)
{
await connection.stop();
}
}
}

@ -71,6 +71,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
equatable:
dependency: transitive
description:
name: equatable
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
fake_async:
dependency: transitive
description:
@ -149,6 +163,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
matcher:
dependency: transitive
description:
@ -212,6 +233,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1+1"
signalr_core:
dependency: "direct main"
description:
name: signalr_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
sky_engine:
dependency: transitive
description: flutter
@ -224,6 +259,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
sse_client:
dependency: transitive
description:
name: sse_client
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
stack_trace:
dependency: transitive
description:
@ -259,6 +301,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
tuple:
dependency: transitive
description:
name: tuple
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
typed_data:
dependency: transitive
description:
@ -273,6 +322,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
xml:
dependency: transitive
description:

@ -39,6 +39,10 @@ dependencies:
flutter_svg: ^1.0.3
http: ^0.13.0
#signalr core
signalr_core: ^1.1.1

Loading…
Cancel
Save