-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ruqaiyasattar/prototype
prototype added
- Loading branch information
Showing
23 changed files
with
606 additions
and
18 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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), | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
}); | ||
} | ||
} |
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 |
---|---|---|
@@ -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), | ||
), | ||
), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -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); | ||
} |
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 |
---|---|---|
@@ -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), | ||
), | ||
), | ||
); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -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(); | ||
}*/ |
Oops, something went wrong.