Skip to content

Commit

Permalink
patch-IFIX-654 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
naveen-egov authored Nov 12, 2021
1 parent b7f94e9 commit de33901
Show file tree
Hide file tree
Showing 16 changed files with 512 additions and 455 deletions.
112 changes: 58 additions & 54 deletions frontend/mgramseva/lib/screeens/AddExpense/ExpenseDetails.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_focus_watcher/flutter_focus_watcher.dart';
import 'package:mgramseva/model/expensesDetails/expenses_details.dart';
import 'package:mgramseva/providers/expenses_details_provider.dart';
import 'package:mgramseva/screeens/AddExpense/AddExpenseWalkThrough/expenseWalkThrough.dart';
Expand Down Expand Up @@ -80,67 +81,68 @@ class _ExpenseDetailsState extends State<ExpenseDetails> {
if (!_numberFocus.hasFocus) {
Provider.of<ExpensesDetailsProvider>(context, listen: false)
..phoneNumberAutoValidation = true
..callNotifyer();
..callNotifyer();
}
}

@override
Widget build(BuildContext context) {
var expensesDetailsProvider =
Provider.of<ExpensesDetailsProvider>(context, listen: false);
return Scaffold(
appBar: CustomAppBar(),
drawer: DrawerWrapper(
Drawer(child: SideBar()),
),
body: SingleChildScrollView(
child: Column(children: [
StreamBuilder(
stream: expensesDetailsProvider.streamController.stream,
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
if (snapshot.data is String) {
return CommonWidgets.buildEmptyMessage(
snapshot.data, context);
}
return _buildUserView(snapshot.data);
} else if (snapshot.hasError) {
return Notifiers.networkErrorPage(
context,
() => expensesDetailsProvider.getExpensesDetails(
context, widget.expensesDetails, widget.id));
} else {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Loaders.CircularLoader();
case ConnectionState.active:
return Loaders.CircularLoader();
default:
return Container();
}
}
}),
Footer()
])),
bottomNavigationBar: Consumer<ExpensesDetailsProvider>(
builder: (_, expensesDetailsProvider, child) => BottomButtonBar(
i18.common.SUBMIT,
(isUpdate &&
(expensesDetailsProvider
.expenditureDetails.allowEdit ??
false)) ||
((isUpdate &&
!(expensesDetailsProvider
.expenditureDetails.allowEdit ??
false) &&
return FocusWatcher(
child: Scaffold(
appBar: CustomAppBar(),
drawer: DrawerWrapper(
Drawer(child: SideBar()),
),
body: SingleChildScrollView(
child: Column(children: [
StreamBuilder(
stream: expensesDetailsProvider.streamController.stream,
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
if (snapshot.data is String) {
return CommonWidgets.buildEmptyMessage(
snapshot.data, context);
}
return _buildUserView(snapshot.data);
} else if (snapshot.hasError) {
return Notifiers.networkErrorPage(
context,
() => expensesDetailsProvider.getExpensesDetails(
context, widget.expensesDetails, widget.id));
} else {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Loaders.CircularLoader();
case ConnectionState.active:
return Loaders.CircularLoader();
default:
return Container();
}
}
}),
Footer()
])),
bottomNavigationBar: Consumer<ExpensesDetailsProvider>(
builder: (_, expensesDetailsProvider, child) => BottomButtonBar(
i18.common.SUBMIT,
(isUpdate &&
(expensesDetailsProvider
.expenditureDetails.isBillCancelled ??
.expenditureDetails.allowEdit ??
false)) ||
!isUpdate)
? () => expensesDetailsProvider.validateExpensesDetails(
context, isUpdate)
: null),
));
((isUpdate &&
!(expensesDetailsProvider
.expenditureDetails.allowEdit ??
false) &&
(expensesDetailsProvider
.expenditureDetails.isBillCancelled ??
false)) ||
!isUpdate)
? () => expensesDetailsProvider.validateExpensesDetails(
context, isUpdate)
: null),
)));
}

saveInput(context) async {
Expand Down Expand Up @@ -246,15 +248,17 @@ class _ExpenseDetailsState extends State<ExpenseDetails> {
textInputType: TextInputType.number,
validator: Validators.mobileNumberValidator,
focusNode: _numberFocus,
autoValidation: expensesDetailsProvider.phoneNumberAutoValidation
autoValidation: expensesDetailsProvider
.phoneNumberAutoValidation
? AutovalidateMode.always
: AutovalidateMode.disabled,
maxLength: 10,
inputFormatter: [
FilteringTextInputFormatter.allow(
RegExp("[0-9]"))
],
onChange: expensesDetailsProvider.onChangeOfMobileNumber,
onChange: expensesDetailsProvider
.onChangeOfMobileNumber,
),
BuildTextField(
'${i18.expense.AMOUNT}',
Expand Down
55 changes: 30 additions & 25 deletions frontend/mgramseva/lib/screeens/ChangePassword/Changepassword.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_focus_watcher/flutter_focus_watcher.dart';
import 'package:mgramseva/model/changePasswordDetails/changePassword_details.dart';
import 'package:mgramseva/providers/common_provider.dart';
import 'package:mgramseva/providers/changePassword_details_provider.dart';
Expand Down Expand Up @@ -93,7 +94,9 @@ class _ChangePasswordState extends State<ChangePassword> {
isRequired: true,
maxLines: 1,
validator: (val) => Validators.passwordComparision(
val, ApplicationLocalizations.of(context).translate(i18.password.NEW_PASSWORD_ENTER)),
val,
ApplicationLocalizations.of(context)
.translate(i18.password.NEW_PASSWORD_ENTER)),
onChange: (value) => saveInput(value),
),
BuildTextField(
Expand All @@ -104,7 +107,8 @@ class _ChangePasswordState extends State<ChangePassword> {
maxLines: 1,
validator: (val) => Validators.passwordComparision(
val,
ApplicationLocalizations.of(context).translate(i18.password.CONFIRM_PASSWORD_ENTER),
ApplicationLocalizations.of(context)
.translate(i18.password.CONFIRM_PASSWORD_ENTER),
passwordDetails.newpasswordCtrl.text),
onChange: (value) => saveInput(value),
),
Expand All @@ -128,28 +132,29 @@ class _ChangePasswordState extends State<ChangePassword> {
Widget build(BuildContext context) {
var changePasswordProvider =
Provider.of<ChangePasswordProvider>(context, listen: false);
return Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: BaseAppBar(
Text(i18.common.MGRAM_SEVA),
AppBar(),
<Widget>[Icon(Icons.more_vert)],
),
drawer: DrawerWrapper(
Drawer(child: SideBar()),
),
body: SingleChildScrollView(
child: Column(
children: [
builduserView(changePasswordProvider.changePasswordDetails),
Footer()
],
)),
bottomNavigationBar: BottomButtonBar(
i18.password.CHANGE_PASSWORD,
() => saveInputandchangepass(
context,
changePasswordProvider.changePasswordDetails.getText(),
changePasswordProvider.changePasswordDetails)));
return FocusWatcher(
child: Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: BaseAppBar(
Text(i18.common.MGRAM_SEVA),
AppBar(),
<Widget>[Icon(Icons.more_vert)],
),
drawer: DrawerWrapper(
Drawer(child: SideBar()),
),
body: SingleChildScrollView(
child: Column(
children: [
builduserView(changePasswordProvider.changePasswordDetails),
Footer()
],
)),
bottomNavigationBar: BottomButtonBar(
i18.password.CHANGE_PASSWORD,
() => saveInputandchangepass(
context,
changePasswordProvider.changePasswordDetails.getText(),
changePasswordProvider.changePasswordDetails))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_focus_watcher/flutter_focus_watcher.dart';
import 'package:mgramseva/model/connection/search_connection.dart';
import 'package:mgramseva/providers/search_connection_provider.dart';
import 'package:mgramseva/widgets/customAppbar.dart';
Expand Down Expand Up @@ -40,7 +41,8 @@ class _SearchConsumerConnectionState extends State<SearchConsumerConnection> {
Widget build(BuildContext context) {
var searchConnectionProvider =
Provider.of<SearchConnectionProvider>(context, listen: false);
return Scaffold(
return FocusWatcher(
child: Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: CustomAppBar(),
drawer: DrawerWrapper(
Expand Down Expand Up @@ -192,6 +194,6 @@ class _SearchConsumerConnectionState extends State<SearchConsumerConnection> {
i18.searchWaterConnection.SEARCH_CONNECTION_BUTTON,
() => searchConnectionProvider.validatesearchConnectionDetails(
context, widget.arguments)),
);
));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_focus_watcher/flutter_focus_watcher.dart';
import 'package:mgramseva/model/connection/property.dart';
import 'package:mgramseva/model/connection/water_connection.dart';
import 'package:mgramseva/providers/common_provider.dart';
Expand Down Expand Up @@ -485,7 +486,8 @@ class _ConsumerDetailsState extends State<ConsumerDetails> {
@override
Widget build(BuildContext context) {
var userProvider = Provider.of<ConsumerProvider>(context, listen: false);
return Scaffold(
return FocusWatcher(
child: Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: CustomAppBar(),
drawer: DrawerWrapper(
Expand Down Expand Up @@ -516,6 +518,6 @@ class _ConsumerDetailsState extends State<ConsumerDetails> {
]))),
bottomNavigationBar: BottomButtonBar(i18.common.SUBMIT,
() => {userProvider.validateConsumerDetails(context)}),
);
));
}
}
18 changes: 10 additions & 8 deletions frontend/mgramseva/lib/screeens/Feedback/feed_back.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_focus_watcher/flutter_focus_watcher.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:mgramseva/model/localization/language.dart';
import 'package:mgramseva/model/success_handler.dart';
Expand Down Expand Up @@ -56,14 +57,15 @@ class _PaymentFeedBackState extends State<PaymentFeedBack> {

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: AppBar(
title: Text('mGramSeva'),
automaticallyImplyLeading: false,
actions: [_buildDropDown()],
),
body: _buildLocalizationData());
return FocusWatcher(
child: Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: AppBar(
title: Text('mGramSeva'),
automaticallyImplyLeading: false,
actions: [_buildDropDown()],
),
body: _buildLocalizationData()));
}

Widget _buildView() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_focus_watcher/flutter_focus_watcher.dart';
import 'package:mgramseva/providers/forgot_password_provider.dart';

import 'package:mgramseva/utils/Constants/I18KeyConstants.dart';
Expand Down Expand Up @@ -113,12 +114,13 @@ class _ForgotPasswordState extends State<ForgotPassword> {

@override
Widget build(BuildContext context) {
return Scaffold(body: LayoutBuilder(builder: (context, constraints) {
return FocusWatcher(
child: Scaffold(body: LayoutBuilder(builder: (context, constraints) {
if (constraints.maxWidth < 760) {
return MobileView(getForgotPasswordCard());
} else {
return DesktopView(getForgotPasswordCard());
}
}));
})));
}
}
Loading

0 comments on commit de33901

Please sign in to comment.