Merge remote-tracking branch 'origin/main_production_copilot' into main_production_copilot

main_production_copilot
WaseemAbbasi22 1 week ago
commit d5dc0bdf31

@ -132,6 +132,7 @@ class _CopilotChatPageState extends State<CopilotChatPage> {
return Scaffold( return Scaffold(
appBar: DefaultAppBar( appBar: DefaultAppBar(
title: "ATOMS – AI Assistant", title: "ATOMS – AI Assistant",
showCopilot: false,
actions: [ actions: [
IconButton( IconButton(
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const CopilotLiveTalkPage())), onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const CopilotLiveTalkPage())),

@ -122,7 +122,10 @@ class _CopilotPushToTalkPageState extends State<CopilotPushToTalkPage> with Widg
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: const DefaultAppBar(title: "Push to Talk"), appBar: const DefaultAppBar(
title: "Push to Talk",
showCopilot: false,
),
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -231,7 +234,7 @@ class _CopilotPushToTalkPageState extends State<CopilotPushToTalkPage> with Widg
theme: context.isDark ? ThinkingOrbTheme.dark : ThinkingOrbTheme.light, theme: context.isDark ? ThinkingOrbTheme.dark : ThinkingOrbTheme.light,
), ),
) )
: Icon(Icons.mic_rounded, color: Colors.white, size: isRecording ? 44 : 36), : Icon(Icons.mic_rounded, color: AppColor.icon2Color(context), size: isRecording ? 44 : 36),
), ),
), ),
// "atoms_logo".toSvgAsset().paddingAll(16), // "atoms_logo".toSvgAsset().paddingAll(16),

@ -92,6 +92,7 @@ class _DeviceFilterScreenState extends State<DeviceFilterScreen> {
appBar: DefaultAppBar( appBar: DefaultAppBar(
title: context.translation.filter, title: context.translation.filter,
showBackButtonAsCancel: true, showBackButtonAsCancel: true,
showCopilot: false,
actions: [ actions: [
if (loading == false && _showResetButton()) if (loading == false && _showResetButton())
TextButton( TextButton(

@ -62,6 +62,7 @@ class _DeviceSearchScreenState extends State<DeviceSearchScreen> {
appBar: DefaultAppBar( appBar: DefaultAppBar(
title: context.translation.search, title: context.translation.search,
showBackButtonAsCancel: true, showBackButtonAsCancel: true,
showCopilot: false,
actions: [ actions: [
if (_showResetButton()) if (_showResetButton())
TextButton( TextButton(

@ -1,10 +1,13 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/modules/copilot/controller/copilot_provider.dart';
import 'package:test_sa/modules/copilot/screens/copilot_chat_page.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart'; import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import 'package:test_sa/new_views/swipe_module/dialoge/acknowledge_work_dialog.dart'; import 'package:test_sa/new_views/swipe_module/dialoge/acknowledge_work_dialog.dart';
@ -20,9 +23,20 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
final VoidCallback? onWillPopScope; final VoidCallback? onWillPopScope;
final TextStyle? titleStyle; final TextStyle? titleStyle;
final bool showBackButtonAsCancel; final bool showBackButtonAsCancel;
final bool showCopilot;
const DefaultAppBar( const DefaultAppBar(
{this.title, this.onBackPress, this.onWillPopScope, this.actions, this.titleStyle, this.showHomeActionButton = false, this.showBackButton = true,this.backgroundColor, this.showBackButtonAsCancel = false, Key? key}) {this.title,
this.onBackPress,
this.onWillPopScope,
this.actions,
this.titleStyle,
this.showHomeActionButton = false,
this.showCopilot = true,
this.showBackButton = true,
this.backgroundColor,
this.showBackButtonAsCancel = false,
Key? key})
: super(key: key); : super(key: key);
@override @override
@ -44,10 +58,24 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
if (actions?.isNotEmpty ?? false) { if (actions?.isNotEmpty ?? false) {
_actions.addAll(actions!); _actions.addAll(actions!);
} }
if (showCopilot) {
_actions.add(
IconButton(
icon: "atoms_ai".toSvgAsset(),
padding: EdgeInsets.zero,
iconSize: 20,
visualDensity: VisualDensity.compact,
tooltip: "Barq",
onPressed: (() {
context.read<CopilotProvider>().startNewConversation();
Navigator.push(context, MaterialPageRoute(builder: (_) => const CopilotChatPage(isNewConversation: true))).then((_) => context.read<CopilotProvider>().loadHistory());
})),
);
}
return AppBar( return AppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
titleSpacing: 16, titleSpacing: 16,
backgroundColor:backgroundColor, backgroundColor: backgroundColor,
title: Row( title: Row(
children: [ children: [
if (showBackButton) if (showBackButton)

@ -179,6 +179,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
return Scaffold( return Scaffold(
appBar: DefaultAppBar( appBar: DefaultAppBar(
title: context.translation.filter,showBackButtonAsCancel: true, title: context.translation.filter,showBackButtonAsCancel: true,
showCopilot: false,
actions: [ actions: [
if (_showResetButton()) if (_showResetButton())
TextButton( TextButton(

@ -93,6 +93,7 @@ class _AllRequestsSearchPageState extends State<AllRequestsSearchPage> {
appBar: DefaultAppBar( appBar: DefaultAppBar(
title: context.translation.search, title: context.translation.search,
showBackButtonAsCancel: true, showBackButtonAsCancel: true,
showCopilot: false,
actions: [ actions: [
if (_showResetButton()) if (_showResetButton())
TextButton( TextButton(

Loading…
Cancel
Save