backup. before shop update
This commit is contained in:
76
lib/pages/buy_service.dart
Normal file
76
lib/pages/buy_service.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_wisetronic/utils/http_util.dart';
|
||||
import 'package:flutter_wisetronic/utils/utils.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_buy_service.dart';
|
||||
import 'package:flutter_wisetronic/widgets/desktop/desktop_renew_minioffice.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_buy_service.dart';
|
||||
import 'package:flutter_wisetronic/widgets/mobile/mobile_renew_minioffice.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../models/business.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../widgets/desktop/desktop_renew_license.dart';
|
||||
import '../widgets/mobile/mobile_renew_license.dart';
|
||||
|
||||
class BuyService extends StatefulWidget {
|
||||
final int gid;
|
||||
final String serviceName;
|
||||
|
||||
const BuyService(this.gid, this.serviceName, {Key key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => BuyServiceState();
|
||||
}
|
||||
|
||||
class BuyServiceState extends State<BuyService> {
|
||||
Map<String, dynamic> data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
store.dispatch(UpdateContext(context));
|
||||
|
||||
if (data == null ) {
|
||||
return new Scaffold(
|
||||
body: Center(
|
||||
child: SpinKitWave(
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 40.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInformation) =>
|
||||
ScreenTypeLayout(
|
||||
mobile: MobileBuyService(data),
|
||||
tablet: DesktopBuyService(data),
|
||||
desktop: DesktopBuyService(data),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
HttpUtil.httpGet(
|
||||
'v1/get-buy-service-info/${widget.serviceName}/${widget.gid}',
|
||||
businessId: Constants.BUSINESS_ID,
|
||||
).then((value) {
|
||||
data = value;
|
||||
setState(() {});
|
||||
}).onError((error, stackTrace) {
|
||||
Utils.showMessageDialog(context, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user