This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/material.dart'; | |
class HomePage extends StatefulWidget { | |
const HomePage({super.key}); | |
@override | |
State<HomePage> createState() => _HomePageState(); |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:code_tutoorial/4/book_store/book_service.dart'; | |
import 'package:code_tutoorial/4/book_store/home_page.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
void main() { | |
runApp(MultiProvider( | |
providers: [ChangeNotifierProvider(create: (_) => BookService())], | |
child: const MyApp())); |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:code_tutoorial/4/book_store/book.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:url_launcher/url_launcher.dart'; | |
import 'book_service.dart'; | |
class HomePage extends StatelessWidget { | |
HomePage({super.key}); |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/material.dart'; | |
import 'book.dart'; | |
class BookService extends ChangeNotifier { | |
List<Book> bookList = []; |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
class Book { | |
String title; | |
String subtitle; | |
String thumbnail; | |
String previewLink; | |
Book({ | |
required this.title, |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:code_tutoorial/3/one-line_diary/home_page.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'diary_service.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:code_tutoorial/3/one-line_diary/diary_service.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:intl/intl.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:table_calendar/table_calendar.dart'; |
This file contains hidden or 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
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved. | |
import 'package:flutter/material.dart'; | |
import 'package:table_calendar/table_calendar.dart'; | |
import 'dart:convert'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
class Diary { | |
String text; // detail | |
DateTime createdAt; // creation time |
This file contains hidden or 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
import 'package:code_tutoorial/3/bucket_list_with_provider/bucket_service.dart'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
void main() { | |
runApp(MultiProvider( | |
providers: [ChangeNotifierProvider(create: (context) => BucketService())], | |
child: const MyApp(), | |
)); |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
import 'main.dart'; | |
/// Bucket responsible | |
class BucketService extends ChangeNotifier { | |
List<Bucket> bucketList = [ | |
Bucket('sleep', false), // dummy data | |
]; | |
/// Add bucket void |