make app bar gradient

merge_into_dev_9/13_final
Elham Rababah 5 years ago
parent 24a9f561ad
commit 543391e73a

File diff suppressed because one or more lines are too long

@ -50,7 +50,7 @@ class Utils {
return currentLocation; return currentLocation;
} }
static formatName(String name) { static formatStringToPascalCase(String name) {
List<String> names = name.split(" "); List<String> names = name.split(" ");
List<String> formattedNamesList = []; List<String> formattedNamesList = [];
names.forEach((name) { names.forEach((name) {

@ -88,7 +88,8 @@ class CustomerBriefCard extends StatelessWidget {
height: MediaQuery.of(context).size.width * 0.02, height: MediaQuery.of(context).size.width * 0.02,
), ),
Text( Text(
Utils.formatName('${customerFirstName} ${customerLastName}'), Utils.formatStringToPascalCase(
'${customerFirstName} ${customerLastName}'),
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,

@ -54,7 +54,7 @@ class OrderInfoCard extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(top: 20.0), padding: EdgeInsets.only(top: 20.0),
child: Text( child: Text(
Utils.formatName( Utils.formatStringToPascalCase(
order.firstName + ' ' + order.lastName), order.firstName + ' ' + order.lastName),
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,

@ -1,7 +1,9 @@
import 'package:driverapp/config/config.dart'; import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/viewModels/base_view_model.dart'; import 'package:driverapp/core/viewModels/base_view_model.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:driverapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gradient_app_bar/gradient_app_bar.dart';
import 'arrow_back.dart'; import 'arrow_back.dart';
import 'network_base_view.dart'; import 'network_base_view.dart';
@ -16,18 +18,19 @@ class AppScaffold extends StatelessWidget {
final Color titleColor; final Color titleColor;
final Color arrowColor; final Color arrowColor;
final Color appBarColor; final Color appBarColor;
final bool isAppBarGradient;
AppScaffold({ AppScaffold(
@required this.body, {@required this.body,
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
this.baseViewModel, this.baseViewModel,
this.bottomSheet, this.bottomSheet,
this.titleColor, this.titleColor,
this.arrowColor, this.arrowColor,
this.appBarColor, this.appBarColor,
}); this.isAppBarGradient});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -38,24 +41,27 @@ class AppScaffold extends StatelessWidget {
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor:
appBarColor ?? Theme.of(context).scaffoldBackgroundColor, appBarColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar appBar: isShowAppBar && !isAppBarGradient
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color, backgroundColor: Theme
textTheme: TextTheme( .of(context)
headline6: TextStyle( .appBarTheme
color: titleColor ?? Colors.white, .color,
fontWeight: FontWeight.bold), textTheme: TextTheme(
), headline6: TextStyle(
title: Text(appBarTitle.toUpperCase()), color: titleColor ?? Colors.white,
leading: Builder( fontWeight: FontWeight.bold),
builder: (BuildContext context) { ),
return ArrowBack( title: Text(Utils.formatStringToPascalCase(appBarTitle)),
arrowColor: arrowColor, leading: Builder(
); builder: (BuildContext context) {
}, return ArrowBack(
), arrowColor: arrowColor,
centerTitle: true, );
},
),
centerTitle: true,
// actions: <Widget>[ // actions: <Widget>[
// IconButton( // IconButton(
// icon: Icon(FontAwesomeIcons.home), // icon: Icon(FontAwesomeIcons.home),
@ -65,13 +71,28 @@ class AppScaffold extends StatelessWidget {
// }, // },
// ), // ),
// ], // ],
) )
: null, : isShowAppBar && isAppBarGradient ? GradientAppBar(
gradient: LINEAR_GRADIENT,
title: Text(
Utils.formatStringToPascalCase(appBarTitle),
style: TextStyle(color: Colors.white),
),
centerTitle: true,
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
)
) : null,
body: baseViewModel != null body: baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(), child: buildBodyWidget(),
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: buildBodyWidget(), : buildBodyWidget(),
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
), ),

Loading…
Cancel
Save