This commit is contained in:
2020-12-23 00:43:59 -05:00
parent 0fd880f57b
commit 86c845b49b
54 changed files with 3638 additions and 107 deletions

View File

@@ -0,0 +1,94 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import '../../models/gallery.dart';
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
class MobileIndexCarousel extends StatefulWidget {
final List<Gallery> galleries;
const MobileIndexCarousel(this.galleries, {Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileIndexCarouselState();
}
}
class MobileIndexCarouselState extends State<MobileIndexCarousel> {
int _current = 0;
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
padding: EdgeInsets.only(left: 0.0, right: 0.0, top: 0.0, bottom: 0.0),
child: CarouselSlider(
items: widget.galleries.map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
// margin: EdgeInsets.symmetric(horizontal: 5.0),
child: GestureDetector(
child: Container(
child: Util.showImage(
'https:${i.image}',
fit: BoxFit.fitWidth,
),
),
onTap: () {
if (i.linkUrl != null && i.linkUrl.isNotEmpty) {
Util.openWebUrl(context, i.linkUrl);
}
},
),
);
},
);
}).toList(),
options: CarouselOptions(
height: MediaQuery.of(context).size.width / 2.0,
aspectRatio: 2/1,
initialPage: 0,
enableInfiniteScroll: true,
autoPlay: true,
autoPlayInterval: Duration(seconds: 5),
autoPlayCurve: Curves.fastOutSlowIn,
scrollDirection: Axis.horizontal,
viewportFraction: 1.0,
onPageChanged: (index, reason) {
setState(() {
_current = index;
});
}
),
),
),
Positioned(
bottom: 5,
right: 10,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: widget.galleries.map((i) {
int index = widget.galleries.indexOf(i);
return Container(
width: 8.0,
height: 8.0,
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _current == index
? Color.fromRGBO(0, 0, 0, 0.9)
: Color.fromRGBO(0, 0, 0, 0.4),
),
);
}).toList(),
),
),
],
);
}
}

View File

@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/generated/l10n.dart';
class MobileIndexMainContent1 extends StatefulWidget {
final String message;
const MobileIndexMainContent1(this.message, {Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileIndexMainContent1State();
}
}
class MobileIndexMainContent1State extends State<MobileIndexMainContent1> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 20.0),
child: Container(
child: Text(
widget.message,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
decoration: BoxDecoration(
color: Colors.lightGreen,
borderRadius: BorderRadius.circular(10),
),
);
}
}

View File

@@ -0,0 +1,119 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/generated/l10n.dart';
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
class MobileIndexMainContent2 extends StatefulWidget {
final Map<String, dynamic> content;
const MobileIndexMainContent2(this.content, {Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileIndexMainContent2State();
}
}
class MobileIndexMainContent2State extends State<MobileIndexMainContent2> {
@override
Widget build(BuildContext context) {
if (widget.content == null) {
return Container();
}
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 5.0),
child: Text(
'${widget.content['minipos']}',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.blueGrey,
),
),
),
Container(
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 5.0),
child: Text(
'${widget.content['point_of_sale_system_solution']}',
style: TextStyle(
fontSize: 15.0,
color: Colors.grey,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Util.showImage(
'http:${widget.content['minipos_image']['image']}',
fit: BoxFit.fitWidth
),
),
_buildMiniPosFeatures(),
],
);
}
Widget _buildMiniPosFeatures() {
Column col = Column(
children: [],
);
for (int i = 0; i < (widget.content['minipos_features'] as List).length; i++) {
col.children.add(Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 5.0),
child: Icon(
Icons.circle,
size: 10.0,
color: Colors.black87,
),
),
Container(
width: MediaQuery.of(context).size.width - 40.0,
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 5.0),
child: Text(
'${(widget.content['minipos_features'] as List)[i]}',
style: TextStyle(
color: Colors.black54,
),
),
),
],
));
}
col.children.add(
GestureDetector(
child: Container(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
child: Text(
S.of(context).learn_more,
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
),
),
),
),
);
return Container(
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0),
child: col,
);
}
}

View File

@@ -0,0 +1,122 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/generated/l10n.dart';
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
class MobileIndexMainContent3 extends StatefulWidget {
final Map<String, dynamic> content;
const MobileIndexMainContent3(this.content, {Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileIndexMainContent3State();
}
}
class MobileIndexMainContent3State extends State<MobileIndexMainContent3> {
@override
Widget build(BuildContext context) {
if (widget.content == null) {
return Container();
}
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 5.0),
child: Text(
'${widget.content['igoshow']}',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.blueGrey,
),
),
),
Container(
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 5.0),
child: Text(
'${widget.content['igoshow_solution']}',
style: TextStyle(
fontSize: 15.0,
color: Colors.grey,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Util.showImage(
'http:${widget.content['igoshow_image']['image']}',
fit: BoxFit.fitWidth
),
),
_buildiGoShowFeatures(),
Container(
height: 20.0,
),
],
);
}
Widget _buildiGoShowFeatures() {
Column col = Column(
children: [],
);
for (int i = 0; i < (widget.content['igoshow_features'] as List).length; i++) {
col.children.add(Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 5.0),
child: Icon(
Icons.circle,
size: 10.0,
color: Colors.black87,
),
),
Container(
width: MediaQuery.of(context).size.width - 40.0,
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 5.0),
child: Text(
'${(widget.content['igoshow_features'] as List)[i]}',
style: TextStyle(
color: Colors.black54,
),
),
),
],
));
}
col.children.add(
GestureDetector(
child: Container(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
child: Text(
S.of(context).learn_more,
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
),
),
),
),
);
return Container(
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0),
child: col,
);
}
}

View File

@@ -0,0 +1,233 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/generated/l10n.dart';
import 'package:flutter_wisetronic/widgets/general/text_link.dart';
import 'package:flutter_wisetronic/widgets/mobile/mobile_navigation_drawer_header.dart';
class MobileNavigationDrawer extends StatefulWidget {
const MobileNavigationDrawer({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileNavigationDrawerState();
}
}
class MobileNavigationDrawerState extends State<MobileNavigationDrawer> {
@override
Widget build(BuildContext context) {
String currentRoute = ModalRoute.of(context).settings.name;
return Container(
width: 300.0,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(color: Colors.black12, blurRadius: 16.0),
],
),
child: SingleChildScrollView(
child: Column(
children: [
MobileNavigationDrawerHeader(),
TextLink(
S.of(context).home,
'/',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/',
),
TextLink(
S.of(context).download,
'/download',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/download',
),
TextLink(
S.of(context).tutorials,
'/tutorials',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/tutorials',
),
TextLink(
S.of(context).support,
'/support',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/support',
),
TextLink(
S.of(context).shop,
'/shop',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/shop',
),
TextLink(
S.of(context).blog,
'/blog',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/blog',
),
TextLink(
S.of(context).login,
'/login',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/login',
),
Container(
margin: EdgeInsets.only(top: 20.0),
height: 0.5,
color: Colors.green,
),
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
S.of(context).information,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 16.0,
),
),
),
TextLink(
S.of(context).service_policy,
'/service_policy',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
),
TextLink(
S.of(context).return_policy,
'/return_policy',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
),
TextLink(
S.of(context).privacy_policy,
'/privacy_policy',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
),
TextLink(
S.of(context).license_agreement,
'/license_agreement',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
),
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
S.of(context).support,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 16.0,
),
),
),
TextLink(S.of(context).wiki, '/wiki', paddingVertical: 5.0, paddingHorizontal: 10.0,),
TextLink(S.of(context).support_ticket, '/support_ticket', paddingVertical: 5.0, paddingHorizontal: 10.0,),
TextLink(S.of(context).contact_us, '/contact_us', paddingVertical: 5.0, paddingHorizontal: 10.0,),
TextLink(S.of(context).about_us, '/about_us', paddingVertical: 5.0, paddingHorizontal: 10.0,),
TextLink(S.of(context).renew_license, '/renew_license', paddingVertical: 5.0, paddingHorizontal: 10.0,),
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
S.of(context).developer_of,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 16.0,
),
),
),
Wrap(
children: [
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
0xe800,
fontFamily: 'company',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
0xe801,
fontFamily: 'company',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
0xe802,
fontFamily: 'company',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
0xe803,
fontFamily: 'company',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
0xe804,
fontFamily: 'company',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
0xe805,
fontFamily: 'company',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
],
),
],
),
),
);
}
}

View File

@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/generated/l10n.dart';
class MobileNavigationDrawerHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 40.0,
padding: EdgeInsets.only(top: 10.0),
color: Colors.green,
alignment: Alignment.center,
child: Column(
children: [
Text(
S.of(context).navigation,
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w800,
color: Colors.white,
),
)
],
),
);
}
}

View File

@@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/events/eventbus.dart';
import 'package:flutter_wisetronic/events/events.dart';
import 'package:flutter_wisetronic/widgets/general/navigationbar_logo.dart';
class MobileNavigationBar extends StatefulWidget {
const MobileNavigationBar({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileNavigationBarState();
}
}
class MobileNavigationBarState extends State<MobileNavigationBar> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 10.0, right: 10.0),
height: 80.0,
color: Colors.blue,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.menu),
onPressed: () {
eventBus.fire(OpenDrawer());
},
),
Container(
child: NavigationBarLogo(),
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
),
Container()
],
),
);
// return Stack(
// children: [
// Container(
// height: 80.0,
// color: Colors.blue,
// ),
// Container(
// padding: EdgeInsets.only(left: 10.0, right: 10.0),
// height: 80.0,
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// IconButton(
// icon: Icon(Icons.menu),
// onPressed: () {
//
// },
// ),
// Container(
// child: NavigationBarLogo(),
// padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
// ),
// Container()
// ],
// ),
// ),
// ],
// );
}
}