Skip to content

Commit

Permalink
add image bubble normal
Browse files Browse the repository at this point in the history
  • Loading branch information
prahack committed Dec 29, 2022
1 parent 6580a5a commit e86a8e2
Show file tree
Hide file tree
Showing 10 changed files with 334 additions and 48 deletions.
26 changes: 26 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:chat_bubbles/chat_bubbles.dart';
import 'package:audioplayers/audioplayers.dart';
import "package:cached_network_image/cached_network_image.dart";

void main() => runApp(MyApp());

Expand Down Expand Up @@ -45,6 +46,13 @@ class _MyHomePageState extends State<MyHomePage> {
SingleChildScrollView(
child: Column(
children: <Widget>[
BubbleNormalImage(
id: 'id001',
image: _image(),
color: Colors.purpleAccent,
tail: true,
delivered: true,
),
BubbleNormalAudio(
color: Color(0xFFE8E8EE),
duration: duration.inSeconds.toDouble(),
Expand Down Expand Up @@ -221,6 +229,24 @@ class _MyHomePageState extends State<MyHomePage> {
);
}

Widget _image() {
return
Container(
constraints: BoxConstraints(
minHeight: 20.0,
minWidth: 20.0,
),
child: CachedNetworkImage(
imageUrl: 'https://i.ibb.co/JCyT1kT/Asset-1.png',
progressIndicatorBuilder:
(context, url, downloadProgress) => CircularProgressIndicator(
value: downloadProgress.progress),
errorWidget: (context, url, error) =>
const Icon(Icons.error),
),
);
}

void _changeSeek(double value) {
setState(() {
audioPlayer.seek(new Duration(seconds: value.toInt()));
Expand Down
110 changes: 90 additions & 20 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.9.0"
audioplayers:
dependency: "direct dev"
description:
Expand All @@ -22,34 +22,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
cached_network_image:
dependency: "direct dev"
description:
name: cached_network_image
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.2"
cached_network_image_platform_interface:
dependency: transitive
description:
name: characters
name: cached_network_image_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
version: "2.0.0"
cached_network_image_web:
dependency: transitive
description:
name: charcode
name: cached_network_image_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.0.2"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
chat_bubbles:
dependency: "direct dev"
description:
path: ".."
relative: true
source: path
version: "1.3.0"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -77,7 +91,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.1"
ffi:
dependency: transitive
description:
Expand All @@ -97,6 +111,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_blurhash:
dependency: transitive
description:
name: flutter_blurhash
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.0"
flutter_cache_manager:
dependency: transitive
description:
name: flutter_cache_manager
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -141,28 +169,35 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
octo_image:
dependency: transitive
description:
name: octo_image
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
path_provider:
dependency: transitive
description:
Expand Down Expand Up @@ -212,6 +247,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
platform:
dependency: transitive
description:
Expand All @@ -233,6 +275,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.27.7"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -244,7 +293,21 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
version: "1.9.0"
sqflite:
dependency: transitive
description:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0+3"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0+2"
stack_trace:
dependency: transitive
description:
Expand All @@ -265,21 +328,28 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0+3"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
version: "0.4.12"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -316,5 +386,5 @@ packages:
source: hosted
version: "0.2.0+1"
sdks:
dart: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dev_dependencies:
chat_bubbles:
path: ../
audioplayers: ^0.20.1
cached_network_image: ^3.2.2


# For information on the generic Dart part of this file, see the
Expand Down
Binary file added images/messages/img1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/2022_12_29_main1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/2022_12_29_main2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/image_bubble.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e86a8e2

Please sign in to comment.