Skip to content

Commit

Permalink
Merge pull request #1 from ruqaiyasattar/prototype
Browse files Browse the repository at this point in the history
prototype added
  • Loading branch information
ruqaiyasattar authored Feb 10, 2023
2 parents 0d136d8 + cd41e96 commit d6d8cee
Show file tree
Hide file tree
Showing 23 changed files with 606 additions and 18 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
applicationId "com.mboalab.community.opensource.outreachy.mboathoscope"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Binary file added assets/images/img_explore.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 assets/images/img_head.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 assets/images/img_heart.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 assets/images/img_notiblack.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 assets/images/img_notification.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 assets/images/img_profile.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 assets/images/img_record.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 assets/images/img_recordings.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 assets/images/img_round.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 assets/images/img_setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions lib/Dialogue/alert_dialog_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';

class DialogUtils {
static final DialogUtils _instance = DialogUtils.internal();

DialogUtils.internal();

factory DialogUtils() => _instance;

static void showCustomDialog(BuildContext context,
{
required String title,
String deleteBtnText = "Delete",
String saveBtnText = "Save",
required Function deleteBtnFunction,
}) {
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(25.0)), //this right here
child: Container(
height: 200,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Name of recording'),
),
SizedBox(
width: 320.0,
child: TextButton(
onPressed: () {},
//color: const Color(0xFF1BC0C5),
child: const Text(
"Delete",
style: TextStyle(color: Colors.white),
),
),
)
],
),
),
),
);
});
}
}
27 changes: 27 additions & 0 deletions lib/buttons/CustomButton.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:flutter/material.dart';

class CustomButton extends StatelessWidget {
final String txt;

const CustomButton({
super.key,
required this.txt,
});

@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(left: 28.0, right: 28.0,top: 10.0, bottom: 10.0),
decoration: BoxDecoration(
color: const Color(0xffC5D7FE),
borderRadius: BorderRadius.circular(25.0),
),
child: InkWell(
child: Text(
txt,
style: const TextStyle(color: Colors.black),
),
),
);
}
}
122 changes: 122 additions & 0 deletions lib/buttons/RecordingList.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import 'package:flutter/material.dart';
import 'package:mboathoscope/buttons/WaveformButton.dart';

class RecordingList extends StatelessWidget {
//final List<ListItem> items;

const RecordingList({super.key});

@override
Widget build(BuildContext context) {
return SizedBox(
height: 230,
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
//final item = items[index];
return ListTile(
title: Row(
children: <Widget>[
const Expanded(
flex: 70,
child: WaveformButton(),
),
Expanded(
flex: 10,
child: GestureDetector(
onTap: (){
null;
//to do task
},
child: const Icon(
Icons.edit_outlined,
color: Colors.black,

),
),
),
const Expanded(
flex: 10,
child: Icon(
Icons.delete_sweep_outlined,
color: Colors.black,
),
),
const Expanded(
flex: 10,
child: Icon(
Icons.share,
color: Colors.black,
),
),
Expanded(
flex: 6,
child: Stack(
children: <Widget>[
Positioned(
child: Image.asset(
'assets/images/img_notiblack.png',
),
),
const Positioned(
top: 0.03,
left: 10,
child: CircleAvatar(
radius: 5,
backgroundColor: Color(0xff3D79FD),
foregroundColor: Colors.white,
), //CircularAvatar
),
]
),
),
],
),
subtitle: const Text("Recording 1"),
);
},
),
);
}
}

/// The base class for the different types of items the list can contain.
abstract class ListItem {
/// The title line to show in a list item.
Widget buildTitle(BuildContext context);

/// The subtitle line, if any, to show in a list item.
Widget buildSubtitle(BuildContext context);
}

/// A ListItem that contains data to display a heading.
class HeadingItem implements ListItem {
final String heading;

HeadingItem(this.heading);

@override
Widget buildTitle(BuildContext context) {
return Text(
heading,
style: Theme.of(context).textTheme.headlineSmall,
);
}

@override
Widget buildSubtitle(BuildContext context) => const SizedBox.shrink();
}

/// A ListItem that contains data to display a message.
class MessageItem implements ListItem {
final String sender;
final String body;

MessageItem(this.sender, this.body);

@override
Widget buildTitle(BuildContext context) => Text(sender);

@override
Widget buildSubtitle(BuildContext context) => Text(body);
}
31 changes: 31 additions & 0 deletions lib/buttons/SaveButton.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:mboathoscope/buttons/textButton.dart';

class SaveButton extends StatelessWidget {
final String txt;
final Function onPress;

const SaveButton({
super.key,
required this.txt,
required this.onPress,
});

@override
Widget build(BuildContext context) {

return TextButton(
style: flatButtonStyle,
onPressed: (){
onPress;
},
child: Text(
txt,
style: const TextStyle(
color: Color(0xff3D79FD),
),
),
);
}

}
93 changes: 93 additions & 0 deletions lib/buttons/WaveformButton.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@

import 'package:audio_waveforms/audio_waveforms.dart';
import 'package:flutter/material.dart';


class WaveformButton extends StatefulWidget {
const WaveformButton({Key? key}) : super(key: key);

@override
State<WaveformButton> createState() => _WaveformButtonState();
}


class _WaveformButtonState extends State<WaveformButton> {
late final RecorderController recorderController;

void _initialiseController() {
recorderController = RecorderController()
..androidEncoder = AndroidEncoder.aac
..androidOutputFormat = AndroidOutputFormat.mpeg4
..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC
..sampleRate = 16000;
}

@override
void initState() {
super.initState();
_initialiseController();
}

@override
Widget build(BuildContext context) {
late final PlayerController playerController;
return Container(
margin: const EdgeInsets.all(5.0),
padding: const EdgeInsets.all(3.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40.0),
color: const Color(0xffF3F7FF),
border: Border.all(color: Colors.black),
),
child: Row(
children: <Widget>[
Expanded(
flex: 16,
child: Padding(
padding: const EdgeInsets.all(2.0),
child: CircleAvatar(
maxRadius: 15.0,
backgroundColor: Colors.black,
child: IconButton(
color: Colors.white,
iconSize: 15,
icon: const Icon(
Icons.play_arrow,
color: Color(0xff3D79FD),
),
onPressed: () {
// do something
},
),
),
),
),
Expanded(
flex: 85,
child: AudioWaveforms(
enableGesture: true,
size: Size(MediaQuery.of(context).size.width, 20.0),
recorderController: recorderController,
waveStyle: const WaveStyle(
waveColor: Colors.black,
middleLineColor: Colors.black,
showDurationLabel: true,
extendWaveform: true,
showMiddleLine: true,
),
),
),
],
),
);
}
}
/*
void _startRecording() async {
await recorderController.record(path);
// update state here to, for eample, change the button's state
}
void _stopRecording() async {
final path = await recorderController.stop();
}*/
Loading

0 comments on commit d6d8cee

Please sign in to comment.