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