가을기 Workspace

[플러터] 5일차 - 노트앱 만들기, 화면 구성 본문

개발/개인앱

[플러터] 5일차 - 노트앱 만들기, 화면 구성

가을기_ 2021. 6. 18. 00:14

new flutter project 후

android, ios 의 app id, bundle id를 수정한다.

  • android: android/app/build.gradle
defaultConfig {
  // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  applicationId "com.actumn.stickynotes"
  minSdkVersion 16
  targetSdkVersion 30
  versionCode flutterVersionCode.toInteger()
  versionName flutterVersionName
}

 

  • ios: macos가 없어서 스킵

xcode로 연 후에

runner target 수정

 

  • page/note_list_page.dart
import 'package:flutter/material.dart';

class NoteListPage extends StatefulWidget {

  @override
  State createState() => _NoteListPageState();
}

class _NoteListPageState extends State<NoteListPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Sticky Notes'),
      ),
    );
  }
}

 

  • main.dart
import 'package:flutter/material.dart';
import 'package:sticky_notes/page/note_list_page.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Sticky Notes',
      theme: ThemeData(
        primarySwatch: Colors.teal,
        visualDensity: VisualDensity.adaptivePlatformDensity
      ),
      home: NoteListPage(),
    );
  }
}

 

 

Comments