refactor: appbar
parent
fc93673bb6
commit
433a758771
|
|
@ -76,12 +76,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
|
||||||
borderRadius: BorderRadius.circular(3.0),
|
borderRadius: BorderRadius.circular(3.0),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {},
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => ChatUsPage()));
|
|
||||||
},
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import 'package:mobdr/ui/account/notification_setting.dart';
|
||||||
import 'package:mobdr/ui/account/order/order_list.dart';
|
import 'package:mobdr/ui/account/order/order_list.dart';
|
||||||
import 'package:mobdr/ui/account/log.dart';
|
import 'package:mobdr/ui/account/log.dart';
|
||||||
import 'package:mobdr/ui/account/set_address/set_address.dart';
|
import 'package:mobdr/ui/account/set_address/set_address.dart';
|
||||||
import 'package:mobdr/ui/general/chat_us.dart';
|
|
||||||
import 'package:mobdr/ui/general/notification.dart';
|
import 'package:mobdr/ui/general/notification.dart';
|
||||||
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -50,7 +49,9 @@ class _TabAccountPageState extends State<TabAccountPage>
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
automaticallyImplyLeading: false,
|
iconTheme: IconThemeData(
|
||||||
|
color: GlobalStyle.appBarIconThemeColor,
|
||||||
|
),
|
||||||
elevation: GlobalStyle.appBarElevation,
|
elevation: GlobalStyle.appBarElevation,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Account',
|
'Account',
|
||||||
|
|
@ -59,15 +60,9 @@ class _TabAccountPageState extends State<TabAccountPage>
|
||||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||||
actions: [
|
actions: [
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.push(context,
|
|
||||||
MaterialPageRoute(builder: (context) => ChatUsPage()));
|
|
||||||
},
|
|
||||||
child: Icon(Icons.email, color: BLACK_GREY)),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: _reusableWidget.customNotifIcon(
|
icon: _reusableWidget.customNotifIcon(
|
||||||
count: 8, notifColor: BLACK_GREY),
|
count: 0, notifColor: BLACK_GREY),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
|
|
||||||
|
|
@ -134,29 +134,31 @@ class _TabHomePageState extends State<TabHomePage>
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
elevation: GlobalStyle.appBarElevation,
|
elevation: GlobalStyle.appBarElevation,
|
||||||
title: Text(
|
title: Align(
|
||||||
AppLocalizations.of(context)!.translate('i18n_hello')! +
|
alignment: Alignment.centerLeft,
|
||||||
', ${SharedPrefs().prenom}',
|
child: Text(
|
||||||
style: GlobalStyle.appBarTitle,
|
AppLocalizations.of(context)!.translate('i18n_hello')! +
|
||||||
|
', ${SharedPrefs().prenom}',
|
||||||
|
style: GlobalStyle.appBarTitle,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||||
actions: [
|
actions: [
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.push(context,
|
|
||||||
MaterialPageRoute(builder: (context) => ChatUsPage()));
|
|
||||||
},
|
|
||||||
child: Icon(Icons.email, color: BLACK_GREY)),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: _reusableWidget.customNotifIcon(
|
icon: _reusableWidget.customNotifIcon(
|
||||||
count: 8, notifColor: BLACK_GREY),
|
count: 0,
|
||||||
onPressed: () {
|
notifColor: BLACK_GREY,
|
||||||
Navigator.push(
|
),
|
||||||
context,
|
onPressed: () {
|
||||||
MaterialPageRoute(
|
Navigator.push(
|
||||||
builder: (context) => NotificationPage()));
|
context,
|
||||||
}),
|
MaterialPageRoute(
|
||||||
|
builder: (context) => NotificationPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
|
|
|
||||||
|
|
@ -61,13 +61,14 @@ class ReusableWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget customNotifIcon(
|
Widget customNotifIcon({
|
||||||
{int count = 0,
|
int count = 0,
|
||||||
Color notifColor = Colors.grey,
|
Color notifColor = Colors.grey,
|
||||||
Color labelColor = Colors.pinkAccent,
|
Color labelColor = Colors.pinkAccent,
|
||||||
double notifSize = 24,
|
double notifSize = 24,
|
||||||
double labelSize = 14,
|
double labelSize = 14,
|
||||||
String position = 'right'}) {
|
String position = 'right',
|
||||||
|
}) {
|
||||||
double? posLeft;
|
double? posLeft;
|
||||||
double? posRight = 0;
|
double? posRight = 0;
|
||||||
if (position == 'left') {
|
if (position == 'left') {
|
||||||
|
|
@ -77,31 +78,33 @@ class ReusableWidget {
|
||||||
return Stack(
|
return Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.notifications, color: notifColor, size: notifSize),
|
Icon(Icons.notifications, color: notifColor, size: notifSize),
|
||||||
Positioned(
|
if (count >
|
||||||
left: posLeft,
|
0) // Condition pour afficher le badge uniquement si count > 0
|
||||||
right: posRight,
|
Positioned(
|
||||||
child: Container(
|
left: posLeft,
|
||||||
padding: EdgeInsets.all(1),
|
right: posRight,
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: labelColor,
|
padding: EdgeInsets.all(1),
|
||||||
borderRadius: BorderRadius.circular(labelSize),
|
decoration: BoxDecoration(
|
||||||
),
|
color: labelColor,
|
||||||
constraints: BoxConstraints(
|
borderRadius: BorderRadius.circular(labelSize),
|
||||||
minWidth: labelSize,
|
),
|
||||||
minHeight: labelSize,
|
constraints: BoxConstraints(
|
||||||
),
|
minWidth: labelSize,
|
||||||
child: Center(
|
minHeight: labelSize,
|
||||||
child: Text(
|
),
|
||||||
count.toString(),
|
child: Center(
|
||||||
style: TextStyle(
|
child: Text(
|
||||||
color: Colors.white,
|
count.toString(),
|
||||||
fontSize: 8,
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 8,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@ import 'package:intl/intl.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
|
||||||
|
import 'package:mobdr/config/global_style.dart';
|
||||||
import 'package:mobdr/main.dart';
|
import 'package:mobdr/main.dart';
|
||||||
import 'package:mobdr/events.dart';
|
import 'package:mobdr/events.dart';
|
||||||
|
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||||
import 'package:mobdr/service/shared_prefs.dart';
|
import 'package:mobdr/service/shared_prefs.dart';
|
||||||
import 'package:mobdr/network/api_provider.dart';
|
import 'package:mobdr/network/api_provider.dart';
|
||||||
import 'package:mobdr/db/box_visit_photo.dart';
|
import 'package:mobdr/db/box_visit_photo.dart';
|
||||||
|
|
@ -16,6 +18,9 @@ class SynchronizationPage extends StatefulWidget {
|
||||||
|
|
||||||
class _SynchronizationPageState extends State<SynchronizationPage>
|
class _SynchronizationPageState extends State<SynchronizationPage>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
|
// initialize reusable widget
|
||||||
|
final _reusableWidget = ReusableWidget();
|
||||||
|
|
||||||
late AnimationController _animationController;
|
late AnimationController _animationController;
|
||||||
late Animation<double> _rotationAnimation;
|
late Animation<double> _rotationAnimation;
|
||||||
|
|
||||||
|
|
@ -250,7 +255,17 @@ class _SynchronizationPageState extends State<SynchronizationPage>
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('Data synchronization'),
|
iconTheme: IconThemeData(
|
||||||
|
color: GlobalStyle.appBarIconThemeColor,
|
||||||
|
),
|
||||||
|
elevation: GlobalStyle.appBarElevation,
|
||||||
|
title: Text(
|
||||||
|
'Data synchronization',
|
||||||
|
style: GlobalStyle.appBarTitle,
|
||||||
|
),
|
||||||
|
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||||
|
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||||
|
bottom: _reusableWidget.bottomAppBar(),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import 'package:mobdr/main.dart';
|
import 'package:mobdr/main.dart';
|
||||||
import 'package:mobdr/config/global_style.dart';
|
import 'package:mobdr/config/global_style.dart';
|
||||||
|
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||||
|
|
||||||
import 'package:super_tag_editor/tag_editor.dart';
|
import 'package:super_tag_editor/tag_editor.dart';
|
||||||
import 'package:super_tag_editor/widgets/rich_text_widget.dart';
|
import 'package:super_tag_editor/widgets/rich_text_widget.dart';
|
||||||
|
|
@ -28,6 +29,9 @@ class PhotoTagPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PhotoTagPageState extends State<PhotoTagPage> {
|
class _PhotoTagPageState extends State<PhotoTagPage> {
|
||||||
|
// initialize reusable widget
|
||||||
|
final _reusableWidget = ReusableWidget();
|
||||||
|
|
||||||
late List<String> allTagsList = [];
|
late List<String> allTagsList = [];
|
||||||
late List<String> _selectedTags = [];
|
late List<String> _selectedTags = [];
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
|
|
@ -61,16 +65,18 @@ class _PhotoTagPageState extends State<PhotoTagPage> {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
iconTheme: IconThemeData(
|
iconTheme: IconThemeData(
|
||||||
color: GlobalStyle.appBarIconThemeColor,
|
color: GlobalStyle.appBarIconThemeColor,
|
||||||
),
|
),
|
||||||
elevation: GlobalStyle.appBarElevation,
|
elevation: GlobalStyle.appBarElevation,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Edit tags ...',
|
'Edit tags ...',
|
||||||
style: GlobalStyle.appBarTitle,
|
style: GlobalStyle.appBarTitle,
|
||||||
),
|
),
|
||||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle),
|
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||||
|
bottom: _reusableWidget.bottomAppBar(),
|
||||||
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:mobdr/config/global_style.dart';
|
||||||
import 'package:mobdr/main.dart';
|
import 'package:mobdr/main.dart';
|
||||||
import 'package:mobdr/ui/general/chat_us.dart';
|
import 'package:mobdr/ui/general/chat_us.dart';
|
||||||
import 'package:mobdr/ui/visit/visit_photo_tag.dart';
|
import 'package:mobdr/ui/visit/visit_photo_tag.dart';
|
||||||
|
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||||
|
|
||||||
import 'package:mobdr/db/box_visit_photo.dart';
|
import 'package:mobdr/db/box_visit_photo.dart';
|
||||||
import 'package:mobdr/db/box_photo_typology.dart';
|
import 'package:mobdr/db/box_photo_typology.dart';
|
||||||
|
|
@ -36,6 +37,9 @@ class VisitPhotoTypologyDetailPage extends StatefulWidget {
|
||||||
|
|
||||||
class _VisitPhotoTypologyDetailPageState
|
class _VisitPhotoTypologyDetailPageState
|
||||||
extends State<VisitPhotoTypologyDetailPage> {
|
extends State<VisitPhotoTypologyDetailPage> {
|
||||||
|
// initialize reusable widget
|
||||||
|
final _reusableWidget = ReusableWidget();
|
||||||
|
|
||||||
bool _isLoading = true;
|
bool _isLoading = true;
|
||||||
String _errorMessage = '';
|
String _errorMessage = '';
|
||||||
|
|
||||||
|
|
@ -90,16 +94,18 @@ class _VisitPhotoTypologyDetailPageState
|
||||||
}
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
iconTheme: IconThemeData(
|
iconTheme: IconThemeData(
|
||||||
color: GlobalStyle.appBarIconThemeColor,
|
color: GlobalStyle.appBarIconThemeColor,
|
||||||
),
|
),
|
||||||
elevation: GlobalStyle.appBarElevation,
|
elevation: GlobalStyle.appBarElevation,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Photo',
|
'Photo',
|
||||||
style: GlobalStyle.appBarTitle,
|
style: GlobalStyle.appBarTitle,
|
||||||
),
|
),
|
||||||
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||||
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle),
|
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||||
|
bottom: _reusableWidget.bottomAppBar(),
|
||||||
|
),
|
||||||
body: WillPopScope(
|
body: WillPopScope(
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
// fred
|
// fred
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,15 @@ import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
|
import 'package:mobdr/config/global_style.dart';
|
||||||
import 'package:mobdr/config/constant.dart';
|
import 'package:mobdr/config/constant.dart';
|
||||||
import 'package:mobdr/service/shared_prefs.dart';
|
import 'package:mobdr/service/shared_prefs.dart';
|
||||||
import 'package:mobdr/main.dart';
|
import 'package:mobdr/main.dart';
|
||||||
import 'package:mobdr/db/box_visit_photo.dart';
|
import 'package:mobdr/db/box_visit_photo.dart';
|
||||||
import 'package:mobdr/model/visit_model.dart';
|
import 'package:mobdr/model/visit_model.dart';
|
||||||
import 'package:mobdr/ui/reusable/global_widget.dart';
|
|
||||||
import 'package:mobdr/ui/visit/photo_camera.dart';
|
import 'package:mobdr/ui/visit/photo_camera.dart';
|
||||||
import 'package:mobdr/ui/visit/visit_photo_typology_detail.dart';
|
import 'package:mobdr/ui/visit/visit_photo_typology_detail.dart';
|
||||||
|
import 'package:mobdr/ui/reusable/reusable_widget.dart';
|
||||||
import 'package:mobdr/events.dart';
|
import 'package:mobdr/events.dart';
|
||||||
|
|
||||||
extension FileNameExtension on File {
|
extension FileNameExtension on File {
|
||||||
|
|
@ -47,7 +48,8 @@ class VisitPhotoTypologyListPage extends StatefulWidget {
|
||||||
|
|
||||||
class _VisitPhotoTypologyListPageState
|
class _VisitPhotoTypologyListPageState
|
||||||
extends State<VisitPhotoTypologyListPage> {
|
extends State<VisitPhotoTypologyListPage> {
|
||||||
final _globalWidget = GlobalWidget();
|
// initialize reusable widget
|
||||||
|
final _reusableWidget = ReusableWidget();
|
||||||
|
|
||||||
// initialize photos files list
|
// initialize photos files list
|
||||||
final List<File> _visitPhotoFiles = [];
|
final List<File> _visitPhotoFiles = [];
|
||||||
|
|
@ -77,37 +79,17 @@ class _VisitPhotoTypologyListPageState
|
||||||
final double boxImageSize = (MediaQuery.of(context).size.width / 4);
|
final double boxImageSize = (MediaQuery.of(context).size.width / 4);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
iconTheme: IconThemeData(
|
iconTheme: IconThemeData(
|
||||||
color: Colors.black, //change your color here
|
color: GlobalStyle.appBarIconThemeColor,
|
||||||
),
|
),
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
elevation: GlobalStyle.appBarElevation,
|
||||||
elevation: 0,
|
title: Text(
|
||||||
title: Text(
|
widget.pp_libelle_typologie,
|
||||||
widget.pp_libelle_typologie,
|
style: GlobalStyle.appBarTitle,
|
||||||
style: TextStyle(fontSize: 18, color: Colors.black),
|
),
|
||||||
),
|
backgroundColor: GlobalStyle.appBarBackgroundColor,
|
||||||
backgroundColor: Colors.white,
|
systemOverlayStyle: GlobalStyle.appBarSystemOverlayStyle,
|
||||||
actions: [
|
bottom: _reusableWidget.bottomAppBar()),
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Fluttertoast.showToast(
|
|
||||||
msg: 'Click message', toastLength: Toast.LENGTH_SHORT);
|
|
||||||
},
|
|
||||||
child: Icon(Icons.email, color: _color1)),
|
|
||||||
IconButton(
|
|
||||||
icon: _globalWidget.customNotifIcon(
|
|
||||||
count: 8,
|
|
||||||
notifColor: _color1,
|
|
||||||
notifSize: 24,
|
|
||||||
labelSize: 14),
|
|
||||||
//icon: _globalWidget.customNotifIcon2(8, _color1),
|
|
||||||
onPressed: () {
|
|
||||||
Fluttertoast.showToast(
|
|
||||||
msg: 'Click notification',
|
|
||||||
toastLength: Toast.LENGTH_SHORT);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
body: Column(children: [
|
body: Column(children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: AnimatedList(
|
child: AnimatedList(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue