add dimension box

This commit is contained in:
Sai Naw Wun
2020-06-29 21:19:54 +06:30
parent 02450c003e
commit c783d03409
2 changed files with 260 additions and 83 deletions

View File

@@ -1,24 +1,19 @@
import 'package:fcs/model/language_model.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/pages/contact.dart';
import 'package:fcs/widget/banner.dart';
import 'package:fcs/widget/bottom_up_page_route.dart';
import 'package:fcs/widget/dimension_box.dart';
import 'package:fcs/widget/localization/transalation.dart';
import 'package:fcs/widget/offline_redirect.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
import 'package:intl/intl.dart' as intl;
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/language_model.dart';
import 'package:fcs/pages/contact.dart';
import 'package:fcs/widget/banner.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:fcs/widget/offline_redirect.dart';
import 'package:flutter/cupertino.dart';
import '../theme/theme.dart';
import 'profile_page.dart';
import 'signin_page.dart';
@@ -35,7 +30,9 @@ class _HomePageWelcomeState extends State<HomePageWelcome> {
final log = Logger('_HomePageWelcomeState');
bool login = false;
bool customer = true;
double length = 10;
double width = 10;
double height = 10;
@override
void initState() {
super.initState();
@@ -46,7 +43,7 @@ class _HomePageWelcomeState extends State<HomePageWelcome> {
}
int actualChart = 0;
final numberFormatter = new NumberFormat("#,###");
final numberFormatter = new intl.NumberFormat("#,###");
String pin;
List<bool> isSelected = [true, false];
@@ -130,71 +127,96 @@ class _HomePageWelcomeState extends State<HomePageWelcome> {
]),
body: Container(
decoration: BoxDecoration(
gradient:
// RadialGradient(
// center: const Alignment(-0.7, 0.6), // near the top right
// radius: 0.6,
// colors: [
// secondaryColor,
// primaryColor, // yellow sun
// ],
// stops: [0.4, 1.0],
// )
LinearGradient(
begin: Alignment.topCenter,
end: Alignment
.bottomCenter, // 10% of the width, so there are ten blinds.
colors: [
Color(0xd0272262),
Color(0xfa272262),
// Color(0xa0ff4400),
// secondaryColor,
], // whitish to gray
),
// SweepGradient(
// center: FractionalOffset.centerLeft,
// startAngle: 0.0,
// endAngle: math.pi * 2,
// colors: const <Color>[
// secondaryColor,
// primaryColor,
// secondaryColor,
// primaryColor,
// secondaryColor,
// ],
// stops: const <double>[0.0, 0.25, 0.5, 0.75, 1.0],
// ),
),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment
.bottomCenter, // 10% of the width, so there are ten blinds.
colors: [
Color(0xd0272262),
Color(0xfa272262),
], // whitish to gray
)),
child: Column(
children: <Widget>[
Expanded(
child: ListView(children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(top: 50),
child: CircleAvatar(
radius: (50),
backgroundColor: Colors.white,
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.asset("assets/logo.jpg"),
)),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 50),
child: CircleAvatar(
radius: (50),
backgroundColor: Colors.white,
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.asset("assets/logo.jpg"),
)),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Text(
"Welcome Cargo Services\nby FCS Trading",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontFamily: "Roboto"),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Text(
"Welcome Cargo Services\nby FCS Trading",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontFamily: "Roboto"),
),
)
],
),
],
),
),
Row(
children: <Widget>[
Expanded(
child: Container(
height: 200,
child: DimensionBox(
length: length,
width: width,
height: height,
),
),
),
]),
RotatedBox(
quarterTurns: -1,
child: Slider(
min: 6,
max: 100,
value: height,
onChanged: (value) {
setState(() {
height = value;
});
},
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Slider(
label: "Length",
min: 6,
max: 100,
value: length,
onChanged: (value) {
setState(() {
length = value;
});
},
),
Slider(
label: "Width",
min: 6,
max: 100,
value: width,
onChanged: (value) {
setState(() {
width = value;
});
},
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -236,15 +258,6 @@ class _HomePageWelcomeState extends State<HomePageWelcome> {
icon: Icon(iconData, color: Colors.white70),
color: Colors.white70,
onPressed: null),
// RaisedButton(onPressed: ()=>{},child: Row(
// children: <Widget>[
// IconButton(
// icon: Icon(iconData, ),
// onPressed: null),
// Text(text),
// ],
// ),color: Colors.transparent,
// focusColor: Colors.transparent,),
Text(
text,
style: subMenuStyle,