Skip to content

Commit

Permalink
seeking by dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
mehranshoqi committed Feb 24, 2022
1 parent e033e6d commit cf276c3
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 392 deletions.
2 changes: 2 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ android {
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

buildTypes {
Expand All @@ -65,4 +66,5 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
}
4 changes: 2 additions & 2 deletions example/lib/pages/chat_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class _ChatPageState extends State<ChatPage> {
);

Widget _messagesList(BuildContext context) => ListView.builder(
itemCount: 6,
itemCount: 7,
itemBuilder: (BuildContext context, int index) => Bubble(
index == 1 || index == 4 || index == 6, // for two chat side.
index,
voice: index == 4,
voice: index == 4 || index == 5,
),
);
}
12 changes: 7 additions & 5 deletions example/lib/widgets/bubble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class Bubble extends StatelessWidget {
),
);

Widget _bubble(BuildContext context) => Container(
Widget _bubble(BuildContext context) => voice
? VoiceMessage(
audioSrc: 'https://sounds-mp3.com/mp3/0012660.mp3',
me: index == 5 ? false : true,
)
: Container(
constraints: BoxConstraints(maxWidth: 100.w * .7),
padding: EdgeInsets.symmetric(
horizontal: 4.w,
Expand All @@ -46,10 +51,7 @@ class Bubble extends StatelessWidget {
? S.pinkShadow(shadow: AppColors.pink100)
: [S.boxShadow(context, opacity: .05)],
),
child: voice
? const VoiceMessage(
audioSrc: 'https://sounds-mp3.com/mp3/0012660.mp3')
: Text(
child: Text(
me
? 'Hello, How are u?'
: Random().nextBool()
Expand Down
Loading

0 comments on commit cf276c3

Please sign in to comment.