Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] text audio #18

Merged
merged 2 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 32
ndkVersion flutter.ndkVersion

compileOptions {
Expand All @@ -47,7 +47,7 @@ android {
applicationId "com.example.leturn"
// 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 20
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
7 changes: 5 additions & 2 deletions frontend/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ void main() {
runApp(MyApp());
WidgetsFlutterBinding.ensureInitialized();
//화면 가로 고정
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
//SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
//풀화면 (로테이션 불가능)
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
//SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);*/
}

class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
return ScreenUtilInit(

designSize: Size(1180, 820),
builder: (context ,child) => MaterialApp(
debugShowCheckedModeBanner: false,
Expand Down
8 changes: 7 additions & 1 deletion frontend/lib/screens/home_screen/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:leturn/const/colors.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leturn/screens/home_screen/page_read.dart';
import 'package:leturn/screens/login/login_page.dart';


class HomeScreen extends StatelessWidget{
const HomeScreen({Key? key}) : super(key: key);

Expand Down Expand Up @@ -88,7 +90,11 @@ class _Buttons extends StatelessWidget{
)
],
),
onPressed: (){},
onPressed: (){
Navigator.push(context,
MaterialPageRoute(
builder: (_) => PageRead()));
},
),
),
//2. 카카오 로그인
Expand Down
103 changes: 103 additions & 0 deletions frontend/lib/screens/home_screen/page_read.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leturn/component/button_semantics.dart';
import 'package:just_audio/just_audio.dart';


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

@override
_PageReadState createState() => _PageReadState();
}

class _PageReadState extends State<PageRead> {

//오디오 재생 위젯
final _player = AudioPlayer();
bool isPlaying = false;

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

void _init(){
_player.setAudioSource(AudioSource.uri(Uri()));
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
_FixedTop(),
Container(
child: Text('data\n hey~~~')
),
],
),
),
),
);
}


Widget _FixedTop() {
return Container(
color: Colors.amber,
height: 90.h,

child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed:(){},
icon: const Icon(Icons.arrow_back_ios_new_outlined),
iconSize: 44.w,
),
Container(
child: Row(
children: [
ButtonSemantics(
child: IconButton(
onPressed: (){},
icon: Icon(Icons.bookmarks),
iconSize: 44.w,
),
excludeSemantics: false,
label: '북마크 모음',
),
ButtonSemantics(
child: IconButton(
onPressed: (){},
icon: Icon(Icons.search),
iconSize: 44.w,
),
excludeSemantics: false,
label: '페이지 이동',
),
ButtonSemantics(
child: IconButton(
onPressed: (){},
icon: Icon(Icons.bookmark_border),
iconSize: 44.w,
),
excludeSemantics: false,
label: '북마크 등록',
)
],
),
)
],
),
);
}


}
8 changes: 8 additions & 0 deletions frontend/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
import FlutterMacOS
import Foundation

import audio_session
import audioplayers
import just_audio
import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
AudioplayersPlugin.register(with: registry.registrar(forPlugin: "AudioplayersPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
Loading