Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
B
Byodv2
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
Dio Maulana
Byodv2
Commits
19065023
Commit
19065023
authored
Oct 01, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gapake param get lagi
parent
e04d9460
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
155 deletions
+122
-155
helper.dart
lib/helper/helper.dart
+1
-1
main.dart
lib/main.dart
+121
-154
No files found.
lib/helper/helper.dart
View file @
19065023
...
@@ -579,6 +579,6 @@ const int typeMenu = 3;
...
@@ -579,6 +579,6 @@ const int typeMenu = 3;
//** type menu */
//** type menu */
//** constanta redirect */
//** constanta redirect */
const
String
goBill
=
'
to-bill
'
;
const
String
goBill
=
'
go
'
;
//** constanta redirect */
//** constanta redirect */
//** END CONSTANT */
//** END CONSTANT */
lib/main.dart
View file @
19065023
...
@@ -64,22 +64,9 @@ void main() async {
...
@@ -64,22 +64,9 @@ void main() async {
configLoading
();
configLoading
();
loadAssetConfig
().
then
((
value
)
{
loadAssetConfig
().
then
((
value
)
{
String
branch
=
Uri
.
base
.
queryParameters
[
"r"
]
??
''
;
String
brand
=
Uri
.
base
.
queryParameters
[
"b"
]
??
''
;
String
table
=
Uri
.
base
.
queryParameters
[
"t"
]
??
''
;
String
idOrder
=
Uri
.
base
.
queryParameters
[
"o"
]
??
''
;
String
redirect
=
Uri
.
base
.
queryParameters
[
"rd"
]
??
''
;
if
(
redirect
!=
goBill
)
{
redirect
=
''
;
}
runApp
(
runApp
(
MyApp
(
MyApp
(
title:
value
,
title:
value
,
branch:
branch
,
brand:
brand
,
table:
table
,
idOrder:
idOrder
,
tobill:
redirect
,
),
),
);
);
});
});
...
@@ -125,25 +112,9 @@ Future<String> loadAssetConfig() async {
...
@@ -125,25 +112,9 @@ Future<String> loadAssetConfig() async {
class
MyApp
extends
StatelessWidget
{
class
MyApp
extends
StatelessWidget
{
// String myUrl, branch, brand, tn, role, cashierName, toViewBill;
// String myUrl, branch, brand, tn, role, cashierName, toViewBill;
String
title
;
String
title
;
String
branch
;
String
brand
;
String
table
;
String
idOrder
;
String
role
;
String
cashier
;
String
tobill
;
String
tokenParam
;
MyApp
({
MyApp
({
Key
?
key
,
Key
?
key
,
required
this
.
title
,
required
this
.
title
,
required
this
.
branch
,
required
this
.
brand
,
required
this
.
table
,
required
this
.
idOrder
,
this
.
role
=
'customer'
,
this
.
cashier
=
'customer'
,
this
.
tobill
=
''
,
this
.
tokenParam
=
''
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
// This widget is the root of your application.
// This widget is the root of your application.
...
@@ -172,134 +143,130 @@ class MyApp extends StatelessWidget {
...
@@ -172,134 +143,130 @@ class MyApp extends StatelessWidget {
String
cashierNameStrg
=
''
;
String
cashierNameStrg
=
''
;
String
tokenUser
=
''
;
String
tokenUser
=
''
;
bool
isParamGet
;
if
(
idOrder
!=
''
||
branch
!=
''
)
{
isParamGet
=
true
;
setTableMode
(
openBill
);
}
else
{
isParamGet
=
false
;
setTableMode
(
closebill
);
}
return
MultiBlocProvider
(
return
MultiBlocProvider
(
providers:
[
providers:
[
BlocProvider
(
create:
(
_
)
=>
OrdersBloc
()),
BlocProvider
(
create:
(
_
)
=>
OrdersBloc
()),
BlocProvider
(
create:
(
_
)
=>
BranchExist
()),
BlocProvider
(
create:
(
_
)
=>
BranchExist
()),
// BlocProvider(create: (_) => CategoryMenu()),
// BlocProvider(create: (_) => CategoryMenu()),
BlocProvider
(
create:
(
_
)
=>
OrderVariantTemporaryBloc
()),
BlocProvider
(
create:
(
_
)
=>
OrderVariantTemporaryBloc
()),
BlocProvider
(
create:
(
_
)
=>
OrderVariantValueBloc
()),
BlocProvider
(
create:
(
_
)
=>
OrderVariantValueBloc
()),
BlocProvider
(
create:
(
_
)
=>
OrderDetailVariant
()),
BlocProvider
(
create:
(
_
)
=>
OrderDetailVariant
()),
BlocProvider
(
create:
(
_
)
=>
SearchMenu
()),
BlocProvider
(
create:
(
_
)
=>
SearchMenu
()),
BlocProvider
(
create:
(
_
)
=>
VoucherCheck
()),
BlocProvider
(
create:
(
_
)
=>
VoucherCheck
()),
BlocProvider
(
create:
(
_
)
=>
CategorySelection
()),
BlocProvider
(
create:
(
_
)
=>
CategorySelection
()),
BlocProvider
(
create:
(
_
)
=>
MemberInfoBloc
()),
BlocProvider
(
create:
(
_
)
=>
MemberInfoBloc
()),
BlocProvider
(
create:
(
_
)
=>
ViewBillBloc
()),
BlocProvider
(
create:
(
_
)
=>
ViewBillBloc
()),
BlocProvider
(
create:
(
_
)
=>
FeedBackOptionBloc
()),
BlocProvider
(
create:
(
_
)
=>
FeedBackOptionBloc
()),
BlocProvider
(
create:
(
_
)
=>
FeedbackSelect
()),
BlocProvider
(
create:
(
_
)
=>
FeedbackSelect
()),
BlocProvider
(
create:
(
_
)
=>
FilterMenuBloc
()),
BlocProvider
(
create:
(
_
)
=>
FilterMenuBloc
()),
BlocProvider
(
create:
(
_
)
=>
VoucherListBloc
()),
BlocProvider
(
create:
(
_
)
=>
VoucherListBloc
()),
BlocProvider
(
create:
(
_
)
=>
FavSelectedBar
()),
BlocProvider
(
create:
(
_
)
=>
FavSelectedBar
()),
BlocProvider
(
create:
(
_
)
=>
MenuSelectedBar
()),
BlocProvider
(
create:
(
_
)
=>
MenuSelectedBar
()),
BlocProvider
(
create:
(
_
)
=>
SearchActive
()),
BlocProvider
(
create:
(
_
)
=>
SearchActive
()),
BlocProvider
(
create:
(
_
)
=>
SearchHistory
()),
BlocProvider
(
create:
(
_
)
=>
SearchHistory
()),
],
],
child:
(!
isParamGet
)
child:
MaterialApp
(
?
MaterialApp
(
title:
(
title
==
null
)
?
defaultTitle
:
title
,
title:
(
title
==
null
)
?
defaultTitle
:
title
,
builder:
EasyLoading
.
init
(),
builder:
EasyLoading
.
init
(),
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
onGenerateRoute:
(
routes
)
{
onGenerateRoute:
(
routes
)
{
var
uri
=
Uri
.
parse
(
routes
.
name
!);
var
uri
=
Uri
.
parse
(
routes
.
name
!);
if
(
uri
.
pathSegments
.
isEmpty
)
{
if
(
uri
.
pathSegments
.
isEmpty
)
{
setTableMode
(
closebill
);
return
MaterialPageRoute
(
return
MaterialPageRoute
(
builder:
(
context
)
=>
NoRoute
(
builder:
(
context
)
=>
NoRoute
(
identification:
'emptyUri'
,
identification:
'emptyUri'
,
),
),
);
);
}
else
if
(
uri
.
pathSegments
.
length
==
3
)
{
}
else
if
(
uri
.
pathSegments
.
length
==
2
)
{
brandStrg
=
uri
.
pathSegments
.
first
;
String
firstPath
=
uri
.
pathSegments
.
first
;
branchStrg
=
uri
.
pathSegments
[
1
];
if
(
firstPath
==
'o'
)
{
tnStrg
=
uri
.
pathSegments
[
2
];
setTableMode
(
openBill
);
// String orderId = uri.pathSegments[1];
// do some api request for orderId
}
return
MaterialPageRoute
(
return
MaterialPageRoute
(
builder:
(
_
)
=>
Splash
(
builder:
(
_
)
=>
Splash
(
branch:
branchStrg
,
branch:
branchStrg
,
brand:
brandStrg
,
brand:
brandStrg
,
tn:
tnStrg
,
tn:
tnStrg
,
role:
roleStrg
,
role:
roleStrg
,
cashierName:
cashierNameStrg
,
cashierName:
cashierNameStrg
,
toBill:
toBill
,
toBill:
toBill
,
orderId:
orderId
,
orderId:
orderId
,
token:
tokenUser
,
token:
tokenUser
,
),
),
);
);
}
else
if
(
uri
.
pathSegments
.
length
==
4
)
{
}
else
if
(
uri
.
pathSegments
.
length
==
3
)
{
brandStrg
=
uri
.
pathSegments
.
first
;
brandStrg
=
uri
.
pathSegments
.
first
;
branchStrg
=
uri
.
pathSegments
[
1
];
branchStrg
=
uri
.
pathSegments
[
1
];
tnStrg
=
uri
.
pathSegments
[
2
];
tnStrg
=
uri
.
pathSegments
[
2
];
if
(
uri
.
pathSegments
[
3
]
==
goBill
)
{
toBill
=
goBill
;
}
else
if
(
uri
.
pathSegments
[
3
].
length
==
32
)
{
// its uuid or not
tokenUser
=
uri
.
pathSegments
[
3
];
return
MaterialPageRoute
(
isExcelso
=
true
;
builder:
(
_
)
=>
Splash
(
}
branch:
branchStrg
,
return
MaterialPageRoute
(
brand:
brandStrg
,
builder:
(
_
)
=>
Splash
(
tn:
tnStrg
,
branch:
branchStrg
,
role:
roleStrg
,
brand:
brandStrg
,
cashierName:
cashierNameStrg
,
tn:
tnStrg
,
toBill:
toBill
,
role:
roleStrg
,
orderId:
orderId
,
cashierName:
cashierNameStrg
,
token:
tokenUser
,
toBill:
toBill
,
),
orderId:
orderId
,
);
token:
tokenUser
,
}
else
if
(
uri
.
pathSegments
.
length
==
4
)
{
),
brandStrg
=
uri
.
pathSegments
.
first
;
);
branchStrg
=
uri
.
pathSegments
[
1
];
}
else
if
(
uri
.
pathSegments
.
length
==
5
)
{
tnStrg
=
uri
.
pathSegments
[
2
];
brandStrg
=
uri
.
pathSegments
.
first
;
if
(
uri
.
pathSegments
[
3
]
==
goBill
)
{
branchStrg
=
uri
.
pathSegments
[
1
];
toBill
=
goBill
;
tnStrg
=
uri
.
pathSegments
[
2
];
}
else
if
(
uri
.
pathSegments
[
3
].
length
==
32
)
{
if
(
uri
.
pathSegments
[
3
]
==
'cashier'
)
{
// its uuid or not
// roleStrg = 'cashier';
roleStrg
=
'customer'
;
tokenUser
=
uri
.
pathSegments
[
3
];
cashierNameStrg
=
uri
.
pathSegments
[
4
];
isExcelso
=
true
;
}
else
if
(
uri
.
pathSegments
[
3
].
length
==
32
&&
uri
.
pathSegments
[
4
]
==
goBill
)
{
tokenUser
=
uri
.
pathSegments
[
3
];
isExcelso
=
true
;
toBill
=
goBill
;
}
return
MaterialPageRoute
(
builder:
(
_
)
=>
Splash
(
branch:
branchStrg
,
brand:
brandStrg
,
tn:
tnStrg
,
role:
roleStrg
,
cashierName:
cashierNameStrg
,
toBill:
toBill
,
orderId:
orderId
,
token:
tokenUser
,
),
);
}
}
return
null
;
return
MaterialPageRoute
(
})
builder:
(
_
)
=>
Splash
(
:
MaterialApp
(
branch:
branchStrg
,
title:
(
title
==
null
)
?
defaultTitle
:
title
,
brand:
brandStrg
,
builder:
EasyLoading
.
init
(),
tn:
tnStrg
,
debugShowCheckedModeBanner:
false
,
role:
roleStrg
,
home:
Splash
(
cashierName:
cashierNameStrg
,
branch:
branch
,
toBill:
toBill
,
brand:
brand
,
orderId:
orderId
,
tn:
table
,
token:
tokenUser
,
role:
role
,
),
cashierName:
cashier
,
);
toBill:
tobill
,
}
else
if
(
uri
.
pathSegments
.
length
==
5
)
{
orderId:
orderId
,
brandStrg
=
uri
.
pathSegments
.
first
;
token:
tokenParam
,
branchStrg
=
uri
.
pathSegments
[
1
];
),
tnStrg
=
uri
.
pathSegments
[
2
];
),
if
(
uri
.
pathSegments
[
3
]
==
'cashier'
)
{
);
// roleStrg = 'cashier';
roleStrg
=
'customer'
;
cashierNameStrg
=
uri
.
pathSegments
[
4
];
}
else
if
(
uri
.
pathSegments
[
3
].
length
==
32
&&
uri
.
pathSegments
[
4
]
==
goBill
)
{
tokenUser
=
uri
.
pathSegments
[
3
];
isExcelso
=
true
;
toBill
=
goBill
;
}
return
MaterialPageRoute
(
builder:
(
_
)
=>
Splash
(
branch:
branchStrg
,
brand:
brandStrg
,
tn:
tnStrg
,
role:
roleStrg
,
cashierName:
cashierNameStrg
,
toBill:
toBill
,
orderId:
orderId
,
token:
tokenUser
,
),
);
}
return
null
;
}));
}
}
}
}
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