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;
}
static formatName(String name) {
static formatStringToPascalCase(String name) {
List<String> names = name.split(" ");
List<String> formattedNamesList = [];
names.forEach((name) {

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

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

@ -1,7 +1,9 @@
import 'package:driverapp/config/config.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:flutter/material.dart';
import 'package:gradient_app_bar/gradient_app_bar.dart';
import 'arrow_back.dart';
import 'network_base_view.dart';
@ -16,18 +18,19 @@ class AppScaffold extends StatelessWidget {
final Color titleColor;
final Color arrowColor;
final Color appBarColor;
final bool isAppBarGradient;
AppScaffold({
@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.baseViewModel,
this.bottomSheet,
this.titleColor,
this.arrowColor,
this.appBarColor,
});
AppScaffold(
{@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.baseViewModel,
this.bottomSheet,
this.titleColor,
this.arrowColor,
this.appBarColor,
this.isAppBarGradient});
@override
Widget build(BuildContext context) {
@ -38,24 +41,27 @@ class AppScaffold extends StatelessWidget {
child: Scaffold(
backgroundColor:
appBarColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
appBar: isShowAppBar && !isAppBarGradient
? AppBar(
elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6: TextStyle(
color: titleColor ?? Colors.white,
fontWeight: FontWeight.bold),
),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
),
centerTitle: true,
elevation: 0,
backgroundColor: Theme
.of(context)
.appBarTheme
.color,
textTheme: TextTheme(
headline6: TextStyle(
color: titleColor ?? Colors.white,
fontWeight: FontWeight.bold),
),
title: Text(Utils.formatStringToPascalCase(appBarTitle)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
),
centerTitle: true,
// actions: <Widget>[
// IconButton(
// 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
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
),

Loading…
Cancel
Save