-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Property ownUserName eloiminated. This is a braeking change!
- Loading branch information
Showing
4 changed files
with
73 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,74 @@ | ||
# flutter_basic_chat_bubble | ||
|
||
A new Flutter package project. | ||
The puropose of this package is it to show customizable chat bubbles. You can customize the bubbles in certain ways. The bubbles can just display text messages. At the moment other data types are not possible. | ||
|
||
## Getting Started | ||
 | ||
|
||
This project is a starting point for a Dart | ||
[package](https://flutter.dev/developing-packages/), | ||
a library module containing code that can be shared easily across | ||
multiple Flutter or Dart projects. | ||
## Usage | ||
|
||
### Set the dependency | ||
|
||
``` | ||
dependencies: | ||
flutter_basic_chat_bubble: ^0.0.1 | ||
``` | ||
|
||
### Install | ||
|
||
``` | ||
flutter pub get | ||
``` | ||
|
||
### Import it | ||
|
||
```dart | ||
import 'package:flutter_basic_chat_bubble/flutter_basic_chat_bubble.dart'; | ||
``` | ||
|
||
### Use it | ||
|
||
```dart | ||
return Scaffold( | ||
body: ListView.builder( | ||
itemCount: messages.length, | ||
itemBuilder: (BuildContext context, int index) { | ||
return BasicChatBubble( | ||
message: messages[index], | ||
isMe: index % 2 == | ||
0, // Every second bubble has the isMe flag set to true | ||
backgroundColor: index % 2 == 0 ? Colors.green[400] : Colors.blue, | ||
textColor: Colors.white, | ||
buttonWidget: index == messages.length - 1 | ||
? InkWell( | ||
child: CircleAvatar( | ||
backgroundColor: Colors.red, | ||
child: Icon( | ||
Icons.video_call, | ||
color: Colors.white, | ||
), | ||
), | ||
onTap: () { | ||
print('Button tapped $index'); | ||
}) | ||
: null, | ||
buttonText: 'Make a Call', | ||
); | ||
}, | ||
), | ||
); | ||
``` | ||
|
||
For more details see the **example**. | ||
|
||
## Properties | ||
|
||
```dart | ||
final BasicChatMessage message; | ||
final bool isMe; | ||
final Color backgroundColor; | ||
final Color textColor; | ||
final Color buttonColor; | ||
final Widget buttonWidget; | ||
final String buttonText; | ||
``` | ||
|
||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters