|
|
|
@ -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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|