Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Q
queue_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ernanda
queue_flutter
Commits
123b7f72
Commit
123b7f72
authored
Mar 01, 2022
by
valdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix size
parent
97c154c2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
282 additions
and
110 deletions
+282
-110
baseurl.json
assets/baseurl.json
+1
-1
config.dart
lib/helper/config.dart
+9
-4
main.dart
lib/main.dart
+104
-83
main_page.dart
lib/main_page.dart
+25
-20
splash.dart
lib/splash.dart
+133
-0
pubspec.lock
pubspec.lock
+7
-0
pubspec.yaml
pubspec.yaml
+3
-2
No files found.
assets/baseurl.json
View file @
123b7f72
{
{
"base
U
rl"
:
"http://192.168.2.142:8000/"
"base
_u
rl"
:
"http://192.168.2.142:8000/"
}
}
\ No newline at end of file
lib/helper/config.dart
View file @
123b7f72
import
'package:manager_queue/main.dart'
;
import
'package:mqtt_client/mqtt_browser_client.dart'
;
import
'package:mqtt_client/mqtt_browser_client.dart'
;
import
'dart:convert'
;
const
String
baseUrl
=
"http://192.168.2.142:8000/"
;
final
String
?
baseUrls
=
prefs
.
getString
(
'base_url'
);
const
String
apiUrlQueue
=
baseUrl
+
"api/getqueue"
;
final
String
?
mqqtIdentifiers
=
prefs
.
getString
(
'uuid'
);
const
String
apiUrlUpdate
=
baseUrl
+
"api/updatequeue"
;
final
String
mqqtIdentifier
=
mqqtIdentifiers
!;
const
String
apiUrlClear
=
baseUrl
+
"api/clearqueue"
;
final
String
baseUrl
=
baseUrls
!;
final
String
apiUrlQueue
=
baseUrl
+
"api/getqueue"
;
final
String
apiUrlUpdate
=
baseUrl
+
"api/updatequeue"
;
final
String
apiUrlClear
=
baseUrl
+
"api/clearqueue"
;
const
String
mqttUrl
=
"ws://dev.ravku.com"
;
const
String
mqttUrl
=
"ws://dev.ravku.com"
;
const
String
queueTopic
=
"queuetest/1"
;
const
String
queueTopic
=
"queuetest/1"
;
const
String
queueMessage
=
"updateApi"
;
const
String
queueMessage
=
"updateApi"
;
...
...
lib/main.dart
View file @
123b7f72
...
@@ -9,109 +9,130 @@ import 'package:manager_queue/cubit/ready_cubit.dart';
...
@@ -9,109 +9,130 @@ import 'package:manager_queue/cubit/ready_cubit.dart';
import
'package:manager_queue/helper/config.dart'
;
import
'package:manager_queue/helper/config.dart'
;
import
'package:manager_queue/main_page.dart'
;
import
'package:manager_queue/main_page.dart'
;
import
'package:manager_queue/splash.dart'
;
import
'package:mqtt_client/mqtt_client.dart'
;
import
'package:mqtt_client/mqtt_client.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'bloc/selected_queue_bloc.dart'
;
import
'bloc/selected_queue_bloc.dart'
;
import
'bloc/selected_ready_bloc.dart'
;
import
'bloc/selected_ready_bloc.dart'
;
void
main
(
)
{
late
SharedPreferences
prefs
;
// var prefs = await SharedPreferences.getInstance();
void
main
(
)
async
{
prefs
=
await
SharedPreferences
.
getInstance
();
runApp
(
MyApp
());
runApp
(
MyApp
());
}
}
Future
<
int
>
runMqTT
(
BuildContext
context
)
async
{
//
Future<int> runMqTT(BuildContext context) async {
mqClient
.
logging
(
on:
false
);
//
mqClient.logging(on: false);
mqClient
.
setProtocolV311
();
//
mqClient.setProtocolV311();
mqClient
.
keepAlivePeriod
=
86400
;
//
mqClient.keepAlivePeriod = 86400;
mqClient
.
port
=
mqttPort
;
//
mqClient.port = mqttPort;
mqClient
.
onDisconnected
;
//
mqClient.onDisconnected;
mqClient
.
onConnected
;
//
mqClient.onConnected;
mqClient
.
onSubscribed
;
//
mqClient.onSubscribed;
// mqClient.pongCallback = pong;
//
// mqClient.pongCallback = pong;
final
connMess
=
MqttConnectMessage
()
//
final connMess = MqttConnectMessage()
.
withClientIdentifier
(
'Mqtt_MyClientUniqueId'
)
//
.withClientIdentifier('Mqtt_MyClientUniqueId')
.
withWillTopic
(
'willtopic'
)
// If you set this you must set a will message
//
.withWillTopic('willtopic') // If you set this you must set a will message
.
withWillMessage
(
'My Will message'
)
//
.withWillMessage('My Will message')
.
startClean
()
// Non persistent session for testing
//
.startClean() // Non persistent session for testing
.
withWillQos
(
MqttQos
.
atLeastOnce
);
//
.withWillQos(MqttQos.atLeastOnce);
// print('EXAMPLE::Mosquitto client connecting....');
//
// print('EXAMPLE::Mosquitto client connecting....');
mqClient
.
connectionMessage
=
connMess
;
//
mqClient.connectionMessage = connMess;
try
{
//
try {
await
mqClient
.
connect
();
//
await mqClient.connect();
}
on
NoConnectionException
catch
(
e
)
{
//
} on NoConnectionException catch (e) {
// Raised by the client when connection fails.
//
// Raised by the client when connection fails.
// print('EXAMPLE::client exception - $e');
//
// print('EXAMPLE::client exception - $e');
mqClient
.
disconnect
();
//
mqClient.disconnect();
}
on
SocketException
catch
(
e
)
{
//
} on SocketException catch (e) {
// Raised by the socket layer
//
// Raised by the socket layer
// print('EXAMPLE::socket exception - $e');
//
// print('EXAMPLE::socket exception - $e');
mqClient
.
disconnect
();
//
mqClient.disconnect();
}
//
}
if
(
mqClient
.
connectionStatus
!.
state
==
MqttConnectionState
.
connected
)
{
//
if (mqClient.connectionStatus!.state == MqttConnectionState.connected) {
// print('EXAMPLE::Mosquitto client connected');
//
// print('EXAMPLE::Mosquitto client connected');
}
else
{
//
} else {
/// Use status here rather than state if you also want the broker return code.
//
/// Use status here rather than state if you also want the broker return code.
// print(
//
// print(
// 'EXAMPLE::ERROR Mosquitto client connection failed - disconnecting, status is ${mqClient.connectionStatus}');
//
// 'EXAMPLE::ERROR Mosquitto client connection failed - disconnecting, status is ${mqClient.connectionStatus}');
mqClient
.
disconnect
();
//
mqClient.disconnect();
exit
(-
1
);
//
exit(-1);
}
//
}
/// Ok, lets try a subscription
//
/// Ok, lets try a subscription
// print('EXAMPLE::Subscribing to the queuetest/1 topic');
//
// print('EXAMPLE::Subscribing to the queuetest/1 topic');
var
topic
=
queueTopic
;
// Not a wildcard topic
//
var topic = queueTopic; // Not a wildcard topic
mqClient
.
subscribe
(
topic
,
MqttQos
.
atMostOnce
);
//
mqClient.subscribe(topic, MqttQos.atMostOnce);
/// The client has a change notifier object(see the Observable class) which we then listen to to get
//
/// The client has a change notifier object(see the Observable class) which we then listen to to get
/// notifications of published updates to each subscribed topic.
//
/// notifications of published updates to each subscribed topic.
// mqClient.updates!.listen((List<MqttReceivedMessage<MqttMessage?>>? c) {
//
// mqClient.updates!.listen((List<MqttReceivedMessage<MqttMessage?>>? c) {
// final recMess = c![0].payload as MqttPublishMessage;
//
// final recMess = c![0].payload as MqttPublishMessage;
// final pt =
//
// final pt =
// MqttPublishPayload.bytesToStringAsString(recMess.payload.message);
//
// MqttPublishPayload.bytesToStringAsString(recMess.payload.message);
// // if (c[0].topic == topic && pt == queueMessage) {
//
// // if (c[0].topic == topic && pt == queueMessage) {
// // context.read<QueueBloc>().queueList();
//
// // context.read<QueueBloc>().queueList();
// // // print("berhasil update API");
//
// // // print("berhasil update API");
// // } else {
//
// // } else {
// // // print("tidak berhasil dapat message yang sesuai");
//
// // // print("tidak berhasil dapat message yang sesuai");
// // }
//
// // }
// print('Notifikasi masuk dari topic <${c[0].topic}>, isinya adalah: $pt ');
//
// print('Notifikasi masuk dari topic <${c[0].topic}>, isinya adalah: $pt ');
// print('');
//
// print('');
// });
//
// });
// print('EXAMPLE::Sleeping....');
//
// print('EXAMPLE::Sleeping....');
// await MqttUtilities.asyncSleep(60);
//
// await MqttUtilities.asyncSleep(60);
// /// Finally, unsubscribe and exit gracefully
//
// /// Finally, unsubscribe and exit gracefully
// print('EXAMPLE::Unsubscribing');
//
// print('EXAMPLE::Unsubscribing');
// mqClient.unsubscribe(topic);
//
// mqClient.unsubscribe(topic);
/// Wait for the unsubscribe message from the broker if you wish.
//
/// Wait for the unsubscribe message from the broker if you wish.
// await MqttUtilities.asyncSleep(2);
//
// await MqttUtilities.asyncSleep(2);
// print('EXAMPLE::Disconnecting');
//
// print('EXAMPLE::Disconnecting');
// mqClient.disconnect();
//
// mqClient.disconnect();
return
0
;
//
return 0;
}
//
}
class
MyApp
extends
StatelessWidget
{
class
MyApp
extends
StatelessWidget
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
runMqTT
(
context
);
// runMqTT(context);
return
MaterialApp
(
// return MaterialApp(
initialRoute:
'/'
,
// initialRoute: '/',
routes:
{
// routes: {
'/'
:
(
context
)
=>
MultiBlocProvider
(
providers:
[
// '/': (context) => MultiBlocProvider(providers: [
BlocProvider
(
create:
(
_
)
=>
QueueBloc
()),
// BlocProvider(create: (_) => QueueBloc()),
BlocProvider
(
create:
(
_
)
=>
ReadyBloc
()),
// BlocProvider(create: (_) => ReadyBloc()),
BlocProvider
(
create:
(
_
)
=>
SelectedQueueBloc
()),
// BlocProvider(create: (_) => SelectedQueueBloc()),
BlocProvider
(
create:
(
_
)
=>
QueueCubit
()),
// BlocProvider(create: (_) => QueueCubit()),
BlocProvider
(
create:
(
_
)
=>
SelectedReadyBloc
()),
// BlocProvider(create: (_) => SelectedReadyBloc()),
BlocProvider
(
create:
(
_
)
=>
ReadyCubit
()),
// BlocProvider(create: (_) => ReadyCubit()),
],
child:
MainPage
()),
// ], child: MainPage()),
},
// },
debugShowCheckedModeBanner:
false
,
// debugShowCheckedModeBanner: false,
// );
return
MultiBlocProvider
(
providers:
[
BlocProvider
(
create:
(
_
)
=>
QueueBloc
()),
BlocProvider
(
create:
(
_
)
=>
ReadyBloc
()),
BlocProvider
(
create:
(
_
)
=>
SelectedQueueBloc
()),
BlocProvider
(
create:
(
_
)
=>
QueueCubit
()),
BlocProvider
(
create:
(
_
)
=>
SelectedReadyBloc
()),
BlocProvider
(
create:
(
_
)
=>
ReadyCubit
()),
// BlocProvider(create: (_) => StylingBloc()),
],
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
// theme: ThemeData(brightness: Brightness.dark),
initialRoute:
'/'
,
routes:
{
'/'
:
(
context
)
=>
Splash
()},
);
}),
);
);
}
}
}
}
lib/main_page.dart
View file @
123b7f72
...
@@ -132,19 +132,20 @@ class _MainPageState extends State<MainPage> {
...
@@ -132,19 +132,20 @@ class _MainPageState extends State<MainPage> {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
width:
1000
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.4
,
height:
100
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
color:
Colors
.
lightBlue
,
color:
Colors
.
lightBlue
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Text
(
child:
Text
(
"QUEUE"
,
"QUEUE"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
30
,
fontWeight:
FontWeight
.
w700
),
fontSize:
MediaQuery
.
of
(
context
).
size
.
height
*
0.03
,
fontWeight:
FontWeight
.
w700
),
),
),
),
),
Container
(
Container
(
width:
700
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.38
,
height:
700
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.75
,
child:
MediaQuery
.
removePadding
(
child:
MediaQuery
.
removePadding
(
context:
context
,
context:
context
,
removeTop:
true
,
removeTop:
true
,
...
@@ -218,7 +219,7 @@ class _MainPageState extends State<MainPage> {
...
@@ -218,7 +219,7 @@ class _MainPageState extends State<MainPage> {
},
},
child:
Card
(
child:
Card
(
color:
thisQueue
.
isSelected
color:
thisQueue
.
isSelected
?
Colors
.
blue
?
Colors
.
lightGreen
:
Colors
.
black38
,
:
Colors
.
black38
,
shape:
RoundedRectangleBorder
(
shape:
RoundedRectangleBorder
(
borderRadius:
borderRadius:
...
@@ -245,8 +246,8 @@ class _MainPageState extends State<MainPage> {
...
@@ -245,8 +246,8 @@ class _MainPageState extends State<MainPage> {
setToReady
(
queueSelected
);
setToReady
(
queueSelected
);
},
},
child:
Container
(
child:
Container
(
width:
800
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.4
,
height:
100
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
color:
Colors
.
lightBlue
,
color:
Colors
.
lightBlue
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
InkWell
(
child:
InkWell
(
...
@@ -266,9 +267,11 @@ class _MainPageState extends State<MainPage> {
...
@@ -266,9 +267,11 @@ class _MainPageState extends State<MainPage> {
Flexible
(
Flexible
(
flex:
1
,
flex:
1
,
child:
Container
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.2
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
1
,
color:
Colors
.
blueGrey
,
color:
Colors
.
blueGrey
,
child:
Column
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
children:
<
Widget
>[
// Container(
// Container(
// width: 400,
// width: 400,
...
@@ -310,14 +313,14 @@ class _MainPageState extends State<MainPage> {
...
@@ -310,14 +313,14 @@ class _MainPageState extends State<MainPage> {
);
);
},
},
child:
Container
(
child:
Container
(
width:
400
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.18
,
height:
80
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.07
,
margin:
EdgeInsets
.
all
(
10
),
margin:
EdgeInsets
.
all
(
10
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
all
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
20
),
Radius
.
circular
(
20
),
),
),
color:
Colors
.
amber
,
color:
Colors
.
red
,
),
),
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Text
(
child:
Text
(
...
@@ -339,9 +342,9 @@ class _MainPageState extends State<MainPage> {
...
@@ -339,9 +342,9 @@ class _MainPageState extends State<MainPage> {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
width:
1000
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.4
,
height:
100
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
color:
Colors
.
g
reen
,
color:
Colors
.
lightG
reen
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Text
(
child:
Text
(
"READY"
,
"READY"
,
...
@@ -350,8 +353,8 @@ class _MainPageState extends State<MainPage> {
...
@@ -350,8 +353,8 @@ class _MainPageState extends State<MainPage> {
),
),
),
),
Container
(
Container
(
width:
700
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.38
,
height:
700
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.75
,
child:
MediaQuery
.
removePadding
(
child:
MediaQuery
.
removePadding
(
context:
context
,
context:
context
,
removeTop:
true
,
removeTop:
true
,
...
@@ -504,8 +507,9 @@ class _MainPageState extends State<MainPage> {
...
@@ -504,8 +507,9 @@ class _MainPageState extends State<MainPage> {
setToQueue
(
readySelected
);
setToQueue
(
readySelected
);
},
},
child:
Container
(
child:
Container
(
height:
100
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.2
,
color:
Colors
.
green
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
color:
Colors
.
lightGreen
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
InkWell
(
child:
InkWell
(
onTap:
()
=>
setToQueue
(
readySelected
),
onTap:
()
=>
setToQueue
(
readySelected
),
...
@@ -526,7 +530,8 @@ class _MainPageState extends State<MainPage> {
...
@@ -526,7 +530,8 @@ class _MainPageState extends State<MainPage> {
setToPickUp
(
readySelected
);
setToPickUp
(
readySelected
);
},
},
child:
Container
(
child:
Container
(
height:
100
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.2
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
color:
Colors
.
black26
,
color:
Colors
.
black26
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
InkWell
(
child:
InkWell
(
...
...
lib/splash.dart
0 → 100644
View file @
123b7f72
import
'dart:convert'
;
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:loading_animations/loading_animations.dart'
;
import
'package:manager_queue/models/queue.dart'
;
import
'package:mqtt_client/mqtt_client.dart'
;
import
'package:manager_queue/api.dart'
;
import
'package:manager_queue/bloc/queue_bloc.dart'
;
import
'package:manager_queue/helper/config.dart'
;
import
'package:manager_queue/main.dart'
;
import
'package:manager_queue/helper/config.dart'
;
import
'package:manager_queue/main_page.dart'
;
import
'package:uuid/uuid.dart'
;
import
'package:flutter/services.dart'
as
bundel_root
;
import
'package:http/http.dart'
as
http
;
class
Splash
extends
StatefulWidget
{
const
Splash
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
Splash
>
createState
()
=>
_SplashState
();
}
class
_SplashState
extends
State
<
Splash
>
{
Future
<
String
>
loadBaseUrl
()
async
{
String
data
=
await
bundel_root
.
rootBundle
.
loadString
(
'baseurl.json'
);
return
jsonDecode
(
data
)[
'base_url'
].
toString
();
}
Future
<
int
>
runMqTT
()
async
{
mqClient
.
logging
(
on:
false
);
mqClient
.
setProtocolV311
();
mqClient
.
keepAlivePeriod
=
86400
;
mqClient
.
port
=
mqttPort
;
mqClient
.
onDisconnected
;
mqClient
.
onConnected
;
mqClient
.
onSubscribed
;
// mqClient.pongCallback = pong;
final
connMess
=
MqttConnectMessage
()
.
withClientIdentifier
(
mqqtIdentifier
)
.
withWillTopic
(
'willtopic'
)
// If you set this you must set a will message
.
withWillMessage
(
'My Will message'
)
.
startClean
()
// Non persistent session for testing
.
withWillQos
(
MqttQos
.
atLeastOnce
);
// print('EXAMPLE::Mosquitto client connecting....');
mqClient
.
connectionMessage
=
connMess
;
try
{
await
mqClient
.
connect
();
}
on
NoConnectionException
catch
(
e
)
{
// Raised by the client when connection fails.
// print('EXAMPLE::client exception - $e');
mqClient
.
disconnect
();
}
on
SocketException
catch
(
e
)
{
// Raised by the socket layer
// print('EXAMPLE::socket exception - $e');
mqClient
.
disconnect
();
}
if
(
mqClient
.
connectionStatus
!.
state
==
MqttConnectionState
.
connected
)
{
// print('EXAMPLE::Mosquitto client connected');
}
else
{
/// Use status here rather than state if you also want the broker return code.
// print(
// 'EXAMPLE::ERROR Mosquitto client connection failed - disconnecting, status is ${mqClient.connectionStatus}');
mqClient
.
disconnect
();
exit
(-
1
);
}
/// Ok, lets try a subscription
// print('EXAMPLE::Subscribing to the queuetest/1 topic');
var
topic
=
queueTopic
;
// Not a wildcard topic
mqClient
.
subscribe
(
topic
,
MqttQos
.
atMostOnce
);
/// The client has a change notifier object(see the Observable class) which we then listen to to get
/// notifications of published updates to each subscribed topic.
mqClient
.
updates
!.
listen
((
List
<
MqttReceivedMessage
<
MqttMessage
?>>?
c
)
{
final
recMess
=
c
![
0
].
payload
as
MqttPublishMessage
;
final
pt
=
MqttPublishPayload
.
bytesToStringAsString
(
recMess
.
payload
.
message
);
if
(
c
[
0
].
topic
==
topic
&&
pt
==
queueMessage
)
{
context
.
read
<
QueueBloc
>().
queueList
();
// print("berhasil update API");
}
else
{
// print("tidak berhasil dapat message yang sesuai");
}
// print('Notifikasi masuk dari topic <${c[0].topic}>, isinya adalah: $pt ');
// print('');
});
return
0
;
}
var
uuidUnique
=
const
Uuid
();
@override
void
initState
()
{
loadBaseUrl
().
then
((
value
)
async
{
await
prefs
.
setString
(
'base_url'
,
value
);
await
prefs
.
setString
(
'uuid'
,
uuidUnique
.
v4
());
runMqTT
();
Future
.
delayed
(
const
Duration
(
seconds:
3
),
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
MainPage
()));
});
});
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
"Please wait"
,
style:
TextStyle
(
fontSize:
MediaQuery
.
of
(
context
).
size
.
height
*
0.03
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black
,
decoration:
TextDecoration
.
none
),
),
LoadingBumpingLine
.
circle
(
size:
MediaQuery
.
of
(
context
).
size
.
height
*
0.1
,
backgroundColor:
Colors
.
black
,
)
],
);
}
}
pubspec.lock
View file @
123b7f72
...
@@ -156,6 +156,13 @@ packages:
...
@@ -156,6 +156,13 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "1.0.1"
version: "1.0.1"
loading_animations:
dependency: "direct main"
description:
name: loading_animations
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
matcher:
matcher:
dependency: transitive
dependency: transitive
description:
description:
...
...
pubspec.yaml
View file @
123b7f72
...
@@ -37,6 +37,7 @@ dependencies:
...
@@ -37,6 +37,7 @@ dependencies:
multi_select_flutter
:
^4.0.0
multi_select_flutter
:
^4.0.0
shared_preferences
:
^2.0.13
shared_preferences
:
^2.0.13
uuid
:
^3.0.6
uuid
:
^3.0.6
loading_animations
:
^2.2.0
dev_dependencies
:
dev_dependencies
:
...
@@ -48,8 +49,8 @@ dev_dependencies:
...
@@ -48,8 +49,8 @@ dev_dependencies:
# following page: https://dart.dev/tools/pub/pubspec
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
# The following section is specific to Flutter.
flutter
:
flutter
:
#
assets:
assets
:
#
- assets/baseurl.json
-
assets/baseurl.json
# The following line ensures that the Material Icons font is
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# included with your application, so that you can use the icons in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment