94 lines
2.5 KiB
Dart
94 lines
2.5 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|
import 'package:responsive_builder/responsive_builder.dart';
|
|
|
|
import '../constants.dart';
|
|
import '../generated/l10n.dart';
|
|
import '../store/actions.dart';
|
|
import '../store/store.dart';
|
|
import '../utils/http_util.dart';
|
|
import '../widgets/desktop/desktop_minipos_learn_more.dart';
|
|
import '../widgets/general/bottom_nav.dart';
|
|
import '../widgets/general/breadcrumbs.dart';
|
|
import '../widgets/general/navigationbar.dart';
|
|
import '../widgets/mobile/MobileBottomNav.dart';
|
|
import '../widgets/mobile/mobile_minipos_learn_more.dart';
|
|
|
|
class MiniPosLearnMore extends StatefulWidget {
|
|
const MiniPosLearnMore({Key key}) : super(key: key);
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return MiniPosLearnMoreState();
|
|
}
|
|
}
|
|
|
|
class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
|
|
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
Map<String, dynamic> data;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
store.dispatch(UpdateContext(context));
|
|
if (data == null) {
|
|
return Scaffold(
|
|
body: Center(
|
|
child: SpinKitWave(
|
|
color: Colors.lightBlueAccent,
|
|
size: 40.0,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
return WillPopScope(
|
|
child: ResponsiveBuilder(
|
|
builder: (context, sizingInformation) =>
|
|
Scaffold(
|
|
key: _scaffoldKey,
|
|
appBar: NavigationBar(
|
|
title: S.of(context).minipos,
|
|
back: true,
|
|
breadCrumbs: [
|
|
BreadCrumb(S.of(context).minipos, null),
|
|
],
|
|
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
|
|
),
|
|
drawer: null,
|
|
body: ScreenTypeLayout(
|
|
mobile: MobileMiniPosLearnMore(data),
|
|
tablet: DesktopMiniPosLearnMore(data),
|
|
desktop: DesktopMiniPosLearnMore(data),
|
|
),
|
|
bottomNavigationBar: ScreenTypeLayout(
|
|
mobile: MobileBottomNav(currentIndex: 0,),
|
|
tablet: BottomNav(),
|
|
desktop: BottomNav(),
|
|
),
|
|
),
|
|
),
|
|
onWillPop: () async {
|
|
return true;
|
|
},
|
|
);
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_loadData();
|
|
}
|
|
|
|
void _loadData() {
|
|
HttpUtil.httpGet('v1/get-minipos-learn-more-page')
|
|
.then((value) {
|
|
print('$value');
|
|
if (mounted) {
|
|
setState(() {
|
|
data = value;
|
|
});
|
|
}
|
|
});
|
|
}
|
|
} |