Browse Source

Plot screen

master
daivph 5 years ago
parent
commit
1642259838
6 changed files with 99 additions and 41 deletions
  1. BIN
      assets/png/tempImage.png
  2. +2
    -1
      lib/app.dart
  3. +90
    -23
      lib/presentation/screens/plot/sc_plot.dart
  4. +6
    -15
      lib/presentation/screens/plot/widget_search.dart
  5. +0
    -2
      lib/presentation/screens/tabbar/tabbar.dart
  6. +1
    -0
      lib/utils/const_assets.dart

BIN
assets/png/tempImage.png View File

Before After
Width: 352  |  Height: 352  |  Size: 261KB

+ 2
- 1
lib/app.dart View File

@@ -1,6 +1,7 @@
import 'package:farm_tpf/presentation/screens/login/view/login_page.dart';
import 'package:farm_tpf/presentation/screens/slide_menu/navigation_home_screen.dart';
import 'package:farm_tpf/presentation/screens/splash/view/splash_page.dart';
import 'package:farm_tpf/presentation/screens/tabbar/tabbar.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -64,7 +65,7 @@ class _AppViewState extends State<AppView> {
switch (state.status) {
case AuthenticationStatus.authenticated:
_navigator.pushAndRemoveUntil<void>(
NavigationHomeScreen.route(),
TabbarScreen.route(),
(route) => false,
);
break;

+ 90
- 23
lib/presentation/screens/plot/sc_plot.dart View File

@@ -6,12 +6,13 @@ import 'package:farm_tpf/data/repository/repository.dart';
import 'package:farm_tpf/data/repository/user_repository.dart';
import 'package:farm_tpf/main.dart';
import 'package:farm_tpf/models/index.dart';
import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart';
import 'package:farm_tpf/presentation/custom_widgets/bottom_loader.dart';
import 'package:farm_tpf/presentation/custom_widgets/loading_list_page.dart';
import 'package:farm_tpf/presentation/screens/plot/widget_search.dart';
import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart';
import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_information.dart';
import 'package:farm_tpf/presentation/screens/tabbar/tabbar.dart';
import 'package:farm_tpf/utils/const_assets.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/pref.dart';
@@ -19,7 +20,6 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:farm_tpf/utils/const_string.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:farm_tpf/utils/formatter.dart';
import 'package:get/get.dart';

@@ -145,18 +145,10 @@ class HoldInfinityWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
key: _scaffoldKey,
appBar: AppBar(
centerTitle: true,
title: Text("Danh sách lô"),
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.qrcode),
onPressed: () {
// scan(context);
Get.to(TabbarScreen());
})
],
appBar: AppBarWidget(
isBack: false,
),
body: InfinityView());
}
@@ -188,7 +180,15 @@ class _InfinityViewState extends State<InfinityView> {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.all(8),
color: Colors.white,
child: Text(
'Danh sách lô trồng',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 22),
)),
WidgetSearch(),
Expanded(child: BlocBuilder<PlotBloc, PlotState>(
builder: (context, state) {
@@ -256,16 +256,83 @@ class ItemInfinityWidget extends StatelessWidget {
}

return GestureDetector(
child: Card(
color: backgroundColor,
child: ListTile(
title: Text("${item.code ?? ''} - ${item.suppliesName ?? ''}",
style: TextStyle(color: textColor)),
subtitle: Text(item.startDate.format_DDMMYY_HHmm().toString(),
style: TextStyle(color: textColor)),
trailing: Text(
item.areaM2.formatNumtoStringDecimal().toString() + " m\u00B2",
style: TextStyle(color: textColor)),
child: Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
color: backgroundColor,
border: Border.all(color: Colors.grey[300], width: 0.35),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.grey[300],
blurRadius: 3,
offset: Offset(0, 3))
]),
padding: EdgeInsets.all(8),
child: Row(
children: [
Container(
child: Stack(
children: [
Image.asset(
AppAssets.tempImage,
width: 65,
height: 65,
),
Positioned(
child: Container(
color: Colors.grey.withOpacity(0.5),
width: 65,
height: 20,
child: Text(
item.areaM2.formatNumtoStringDecimal().toString() +
" m\u00B2",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white)),
),
bottom: 0,
)
],
),
),
SizedBox(
width: 12,
),
Expanded(
child: Container(
height: 75,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text("${item.code ?? ''} - ${item.suppliesName ?? ''}",
style: TextStyle(
color: textColor, fontWeight: FontWeight.bold)),
Expanded(
child: SizedBox(),
),
Row(
children: [
Icon(
Icons.access_time,
size: 16,
color: textColor,
),
SizedBox(
width: 4,
),
Expanded(
child: Text(
item.startDate.format_DDMMYY_HHmm().toString(),
style: TextStyle(color: textColor)),
),
],
)
],
),
),
)
],
),
),
onTap: () {

+ 6
- 15
lib/presentation/screens/plot/widget_search.dart View File

@@ -34,18 +34,6 @@ class _WidgetSearchState extends State<WidgetSearch> {
child: Padding(
padding: const EdgeInsets.only(right: 8, top: 8, bottom: 0),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(
Radius.circular(38.0),
),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
offset: const Offset(0, 2),
blurRadius: 8.0),
],
),
child: Padding(
padding: const EdgeInsets.only(
left: 16, right: 16, top: 4, bottom: 4),
@@ -55,9 +43,12 @@ class _WidgetSearchState extends State<WidgetSearch> {
onChanged: (String txt) {},
cursorColor: AppColors.GRAY1,
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Tìm kiếm ...',
),
suffixIcon: Icon(
Icons.search,
size: 30,
),
hintText: 'Tìm theo mã, tên lô',
hintStyle: TextStyle(color: Colors.grey[500])),
onSubmitted: (value) {
FocusScope.of(context).requestFocus(FocusNode());
BlocProvider.of<PlotBloc>(_blocContext)

+ 0
- 2
lib/presentation/screens/tabbar/tabbar.dart View File

@@ -1,9 +1,7 @@
import 'package:farm_tpf/main.dart';
import 'package:farm_tpf/presentation/screens/account/sc_account.dart';
import 'package:farm_tpf/presentation/screens/control_device/sc_control_device.dart';
import 'package:farm_tpf/presentation/screens/notification/sc_notification.dart';
import 'package:farm_tpf/presentation/screens/plot/sc_plot.dart';
import 'package:farm_tpf/presentation/screens/profile/sc_update_profile.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_icons.dart';
import 'package:flutter/material.dart';

+ 1
- 0
lib/utils/const_assets.dart View File

@@ -2,4 +2,5 @@ class AppAssets {
static const baseAssets = 'assets/png/';
static const logo = baseAssets + 'logo.png';
static const logoWithSlogan = baseAssets + 'logoWithSlogan.png';
static const tempImage = baseAssets + 'tempImage.png';
}

Loading…
Cancel
Save