chatbar 0.0.5
chatbar: ^0.0.5 copied to clipboard
flutter plugin to add customizable whatsapp based chat appbar
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:chatbar/chatbar.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
@override
void initState() {
super.initState();
}
// Platform messages are asynchronous, so we initialize in an async method.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: ChatBar(
profilePic: "https://scontent.fdel8-1.fna.fbcdn.net/v/t1.0-9/55786278_1694407227328700_8743813181337501696_n.jpg?_nc_cat=101&_nc_oc=AQnH_MY2ofbfcVeo2-QeS6P10Kg88RnI_zTh78UQGpzY8wVasLyF4hF2_JH0bOB2b8c&_nc_ht=scontent.fdel8-1.fna&oh=ec6eedc22c681f49fa96714991fca364&oe=5D9BC9A5",
username: "Shivansh Talwar",
status: ChatBarState.ACTIVE,
color: Colors.green.shade400,
backbuttoncolor: Colors.white,
backbutton: IconButton(icon: Icon(Icons.keyboard_arrow_left), onPressed:(){},color:Colors.white,),
actions: <Widget>[
IconButton(
onPressed: () {},
icon: Icon(Icons.phone),
color: Colors.white,
),
IconButton(
onPressed: () {},
icon: Icon(Icons.videocam),
color: Colors.white,
),
PopupMenuButton<String>(
icon: Icon(
Icons.more_vert,
color: Colors.white,
),
enabled: true,
onSelected: (str) {},
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
const PopupMenuItem<String>(
value: 'View Contact',
child: Text('View Contact'),
),
const PopupMenuItem<String>(
value: 'Media',
child: Text('Media'),
),
const PopupMenuItem<String>(
value: 'Search',
child: Text('Search'),
),
const PopupMenuItem<String>(
value: 'Wallpaper',
child: Text('Wallpaper'),
),
],
)
],
),
body: Center(
child: Text(''),
),
),
);
}
}