Default App Bar
parent
42deeeb104
commit
8e315d54d0
@ -0,0 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/extensions/context_extension.dart';
|
||||
import 'package:test_sa/extensions/int_extensions.dart';
|
||||
|
||||
import '../../models/enums/translation_keys.dart';
|
||||
import '../app_style/app_color.dart';
|
||||
|
||||
class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final TranslationKeys title;
|
||||
const DefaultAppBar({@required this.title, Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
leading: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Icon(Icons.arrow_back_ios),
|
||||
),
|
||||
titleSpacing: 0,
|
||||
leadingWidth: 50.toScreenWidth,
|
||||
titleTextStyle: Theme.of(context).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.w600, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
||||
title: Text(context.translate(title)),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => Size.fromHeight(60.toScreenHeight);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/models/enums/translation_keys.dart';
|
||||
|
||||
import '../common_widgets/default_app_bar.dart';
|
||||
|
||||
class NewGasRefillRequestPage extends StatelessWidget {
|
||||
static const String routeName = "/new_gas_refill_request_page";
|
||||
const NewGasRefillRequestPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
appBar: DefaultAppBar(title: TranslationKeys.newGasRefillRequest),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/extensions/context_extension.dart';
|
||||
import 'package:test_sa/models/enums/translation_keys.dart';
|
||||
|
||||
import '../common_widgets/default_app_bar.dart';
|
||||
|
||||
class NewServiceRequestPage extends StatelessWidget {
|
||||
static const String routeName = "/new_service_request_page";
|
||||
const NewServiceRequestPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(context.translate(TranslationKeys.serviceRequest))),
|
||||
return const Scaffold(
|
||||
appBar: DefaultAppBar(title: TranslationKeys.newServiceRequest),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test_sa/models/enums/translation_keys.dart';
|
||||
|
||||
import '../common_widgets/default_app_bar.dart';
|
||||
|
||||
class NewTransferRequestPage extends StatelessWidget {
|
||||
static const String routeName = "/new_transfer_request_page";
|
||||
const NewTransferRequestPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
appBar: DefaultAppBar(title: TranslationKeys.newTransferRequest),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue