diff --git a/assets/binatang/burung.jpg b/assets/binatang/burung.jpg new file mode 100644 index 0000000..7844c24 Binary files /dev/null and b/assets/binatang/burung.jpg differ diff --git a/assets/binatang/gajah.jpg b/assets/binatang/gajah.jpg new file mode 100644 index 0000000..8fbbe93 Binary files /dev/null and b/assets/binatang/gajah.jpg differ diff --git a/assets/binatang/kelinci.jpg b/assets/binatang/kelinci.jpg new file mode 100644 index 0000000..fa24a97 Binary files /dev/null and b/assets/binatang/kelinci.jpg differ diff --git a/assets/binatang/monyet.jpg b/assets/binatang/monyet.jpg new file mode 100644 index 0000000..0da9dd1 Binary files /dev/null and b/assets/binatang/monyet.jpg differ diff --git a/assets/binatang/singa.jpg b/assets/binatang/singa.jpg new file mode 100644 index 0000000..df1f346 Binary files /dev/null and b/assets/binatang/singa.jpg differ diff --git a/assets/buah/alpukat.jpg b/assets/buah/alpukat.jpg new file mode 100644 index 0000000..d483112 Binary files /dev/null and b/assets/buah/alpukat.jpg differ diff --git a/assets/buah/apel.jpg b/assets/buah/apel.jpg new file mode 100644 index 0000000..f0b717a Binary files /dev/null and b/assets/buah/apel.jpg differ diff --git a/assets/buah/buah1.png b/assets/buah/buah1.png new file mode 100644 index 0000000..bf19e64 Binary files /dev/null and b/assets/buah/buah1.png differ diff --git a/assets/buah/buah2.png b/assets/buah/buah2.png new file mode 100644 index 0000000..6d461ef Binary files /dev/null and b/assets/buah/buah2.png differ diff --git a/assets/buah/lemon.jpg b/assets/buah/lemon.jpg new file mode 100644 index 0000000..ebb6216 Binary files /dev/null and b/assets/buah/lemon.jpg differ diff --git a/assets/buah/mangga.jpg b/assets/buah/mangga.jpg new file mode 100644 index 0000000..c202aa6 Binary files /dev/null and b/assets/buah/mangga.jpg differ diff --git a/assets/buah/pisang.jpg b/assets/buah/pisang.jpg new file mode 100644 index 0000000..2ede899 Binary files /dev/null and b/assets/buah/pisang.jpg differ diff --git a/assets/hewan/burung.jpg b/assets/hewan/burung.jpg deleted file mode 100644 index 88968e4..0000000 Binary files a/assets/hewan/burung.jpg and /dev/null differ diff --git a/assets/hewan/gajah.jpg b/assets/hewan/gajah.jpg deleted file mode 100644 index dc92914..0000000 Binary files a/assets/hewan/gajah.jpg and /dev/null differ diff --git a/assets/hewan/kelinci.jpg b/assets/hewan/kelinci.jpg deleted file mode 100644 index d41d9b4..0000000 Binary files a/assets/hewan/kelinci.jpg and /dev/null differ diff --git a/assets/hewan/monyet.jpg b/assets/hewan/monyet.jpg deleted file mode 100644 index 4a7d9ee..0000000 Binary files a/assets/hewan/monyet.jpg and /dev/null differ diff --git a/assets/hewan/singa.jpg b/assets/hewan/singa.jpg deleted file mode 100644 index 8ba1eb4..0000000 Binary files a/assets/hewan/singa.jpg and /dev/null differ diff --git a/assets/kenderaan/bis.jpg b/assets/kenderaan/bis.jpg new file mode 100644 index 0000000..13aa762 Binary files /dev/null and b/assets/kenderaan/bis.jpg differ diff --git a/assets/kenderaan/mobil.jpg b/assets/kenderaan/mobil.jpg new file mode 100644 index 0000000..937d2a4 Binary files /dev/null and b/assets/kenderaan/mobil.jpg differ diff --git a/assets/kenderaan/motor.jpg b/assets/kenderaan/motor.jpg new file mode 100644 index 0000000..eab196c Binary files /dev/null and b/assets/kenderaan/motor.jpg differ diff --git a/assets/kenderaan/pesawat.jpg b/assets/kenderaan/pesawat.jpg new file mode 100644 index 0000000..0d564a9 Binary files /dev/null and b/assets/kenderaan/pesawat.jpg differ diff --git a/assets/kenderaan/truk.jpg b/assets/kenderaan/truk.jpg new file mode 100644 index 0000000..8746ad0 Binary files /dev/null and b/assets/kenderaan/truk.jpg differ diff --git a/assets/sayur/cendawan.jpg b/assets/sayur/cendawan.jpg new file mode 100644 index 0000000..07b8543 Binary files /dev/null and b/assets/sayur/cendawan.jpg differ diff --git a/assets/sayur/kubis.jpg b/assets/sayur/kubis.jpg new file mode 100644 index 0000000..87c2740 Binary files /dev/null and b/assets/sayur/kubis.jpg differ diff --git a/assets/sayur/sayur.jpg b/assets/sayur/sayur.jpg new file mode 100644 index 0000000..95ddedc Binary files /dev/null and b/assets/sayur/sayur.jpg differ diff --git a/assets/sayur/sayur.png b/assets/sayur/sayur.png new file mode 100644 index 0000000..2e990e1 Binary files /dev/null and b/assets/sayur/sayur.png differ diff --git a/assets/sayur/terong.jpg b/assets/sayur/terong.jpg new file mode 100644 index 0000000..e1b310d Binary files /dev/null and b/assets/sayur/terong.jpg differ diff --git a/assets/sayur/tomat.jpg b/assets/sayur/tomat.jpg new file mode 100644 index 0000000..6006e2b Binary files /dev/null and b/assets/sayur/tomat.jpg differ diff --git a/assets/sayur/wortel.jpg b/assets/sayur/wortel.jpg new file mode 100644 index 0000000..fb20c37 Binary files /dev/null and b/assets/sayur/wortel.jpg differ diff --git a/lib/main.dart b/lib/main.dart index 73c09e8..1d57969 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,13 +1,26 @@ import 'package:flutter/material.dart'; -import 'package:mewarna/homepage.dart'; -import 'package:mewarna/pages/mewarna.dart'; -import 'package:mewarna/pages/pilihKategori.dart'; -import 'package:mewarna/pages/tentang.dart'; +import 'package:hive_flutter/hive_flutter.dart'; -import 'pages/binatang.dart'; +import 'package:mewarna/homepage.dart'; +// import 'package:mewarna/pages/mewarna.dart'; +import 'package:mewarna/pages/pilihKategori.dart'; +// import 'package:mewarna/pages/tentang.dart'; +import 'package:mewarna/pages/tentang1.dart'; + +import 'model/model_data.dart'; +import 'pages/kategori.dart'; import 'pages/mewarna1.dart'; -void main() { +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter/services.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Hive.initFlutter(); + + Hive.registerAdapter(ModelAdapter()); + await Hive.openBox('model'); + runApp(const MyApp()); } @@ -17,14 +30,19 @@ class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); return MaterialApp( //add the routes routes: { '/': (context) => const HomePage(), '/pilih_kategori': (context) => const PilihKategori(), - '/tentang': (context) => const Tentang(), - '/binatang': (context) => const BinatangPage(), - '/mewarna': (context) => const MewarnaPage(), + // '/tentang': (context) => const Tentang(), + '/tentang': (context) => const Tentang1(), + '/kategori': (context) => const KategoriPage(), + // '/mewarna': (context) => const MewarnaPage(), '/mewarna1': (context) => const Mewarna1Page(), }, initialRoute: '/', @@ -32,6 +50,7 @@ class MyApp extends StatelessWidget { theme: ThemeData( primarySwatch: Colors.blue, ), + builder: EasyLoading.init(), ); } } diff --git a/lib/model/model_data.dart b/lib/model/model_data.dart new file mode 100644 index 0000000..ff5ef48 --- /dev/null +++ b/lib/model/model_data.dart @@ -0,0 +1,12 @@ +import 'package:hive/hive.dart'; + +part 'model_data.g.dart'; + +@HiveType(typeId: 0) +class Model extends HiveObject { + @HiveField(0) + late DateTime createdDate; + + @HiveField(1) + late String datanya; +} diff --git a/lib/model/model_data.g.dart b/lib/model/model_data.g.dart new file mode 100644 index 0000000..27272bc --- /dev/null +++ b/lib/model/model_data.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'model_data.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class ModelAdapter extends TypeAdapter { + @override + final int typeId = 0; + + @override + Model read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Model() + ..createdDate = fields[0] as DateTime + ..datanya = fields[1] as String; + } + + @override + void write(BinaryWriter writer, Model obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.createdDate) + ..writeByte(1) + ..write(obj.datanya); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/pages/binatang.dart b/lib/pages/binatang.dart deleted file mode 100644 index 19d298b..0000000 --- a/lib/pages/binatang.dart +++ /dev/null @@ -1,103 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; - -class BinatangPage extends HookWidget { - const BinatangPage({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Binatang'), - ), - body: Stack( - fit: StackFit.expand, - children: [ - Image.asset( - "assets/bg.jpg", - fit: BoxFit.cover, - color: Colors.black.withOpacity(0.2), - colorBlendMode: BlendMode.darken, - ), - Center( - // add two buttons, one named "Pilih Kategori" , the other named "Tentang" - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - //make the button same width - SizedBox( - // width is half of the screen width - width: MediaQuery.of(context).size.width / 3, - child: ElevatedButton( - child: const Text('Burung'), - onPressed: () { - Navigator.pushNamed(context, '/mewarna1', - arguments: {'kategori': 'hewan', 'nama': 'burung'}); - }, - ), - ), - const SizedBox( - height: 15, - ), - SizedBox( - width: MediaQuery.of(context).size.width / 3, - child: ElevatedButton( - child: const Text('Kelinci'), - onPressed: () { - Navigator.pushNamed(context, '/mewarna1', arguments: { - 'kategori': 'hewan', - 'nama': 'kelinci' - }); - }, - ), - ), - const SizedBox( - height: 15, - ), - SizedBox( - width: MediaQuery.of(context).size.width / 3, - child: ElevatedButton( - child: const Text('Gajah'), - onPressed: () { - Navigator.pushNamed(context, '/mewarna1', - arguments: {'kategori': 'hewan', 'nama': 'gajah'}); - }, - ), - ), - const SizedBox( - height: 15, - ), - SizedBox( - width: MediaQuery.of(context).size.width / 3, - child: ElevatedButton( - child: const Text('Monyet'), - onPressed: () { - Navigator.pushNamed(context, '/mewarna1', - arguments: {'kategori': 'hewan', 'nama': 'monyet'}); - }, - ), - ), - const SizedBox( - height: 15, - ), - SizedBox( - width: MediaQuery.of(context).size.width / 3, - child: ElevatedButton( - child: const Text('Singa'), - onPressed: () { - Navigator.pushNamed(context, '/mewarna1', - arguments: {'kategori': 'hewan', 'nama': 'singa'}); - }, - ), - ), - ], - ), - ), - // child: Text('Home Page'), - ), - ], - ), - ); - } -} diff --git a/lib/pages/kategori.dart b/lib/pages/kategori.dart new file mode 100644 index 0000000..732e8d5 --- /dev/null +++ b/lib/pages/kategori.dart @@ -0,0 +1,188 @@ +import 'package:flutter/material.dart'; +// import 'package:flutter_hooks/flutter_hooks.dart'; + +class KategoriPage extends StatefulWidget { + const KategoriPage({Key? key}) : super(key: key); + + @override + State createState() => _KategoriPageState(); +} + +class _KategoriPageState extends State { + late String _kategori; + + late List _listKategori; + // late List _list; + + //create list of categories that contain map of category name + //and image path + final List> _categories = [ + { + 'name': 'Binatang', + 'folder': 'binatang', + 'list': ["Burung", "Kelinci", "Gajah", "Monyet", "Singa"], + }, + { + 'name': 'Kenderaan', + 'folder': 'kenderaan', + 'list': ["Mobil", "Motor", "Pesawat", "Bis", "Truk"], + }, + { + 'name': 'Sayur-Sayuran', + 'folder': 'sayur', + 'list': ["Kubis", "Terong", "Tomat", "Wortel", "Cendawan"], + }, + { + 'name': 'Buah-Buahan', + 'folder': 'buah', + 'list': ["Apel", "Alpukat", "Lemon", "Mangga", "Pisang"], + } + ]; + + @override + void didChangeDependencies() { + // ignore: todo + // TODO: implement didChangeDependencies + super.didChangeDependencies(); + _kategori = ModalRoute.of(context)!.settings.arguments as String; + List _list = _categories + .firstWhere((element) => element['name'] == _kategori)['list']; + String _folder = _categories + .firstWhere((element) => element['name'] == _kategori)['folder']; + // print(_categories); + // loop the _list and create a list of widget + _listKategori = _list.map((element) { + return Container( + margin: const EdgeInsets.all(10), + child: SizedBox( + width: MediaQuery.of(context).size.width / 3, + child: ElevatedButton( + child: Text(element), + onPressed: () { + Navigator.pushNamed( + context, + '/mewarna1', + arguments: { + 'kategori': _folder, + 'nama': element.toString().toLowerCase() + }, + ); + }, + ), + ), + ); + }).toList(); + + // print(_kategori); + } + + @override + void setState(VoidCallback fn) { + // ignore: todo + // TODO: implement setState + if (mounted) { + super.setState(fn); + } + // super.setState(fn); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Binatang'), + ), + body: Stack( + fit: StackFit.expand, + children: [ + Image.asset( + "assets/bg.jpg", + fit: BoxFit.cover, + color: Colors.black.withOpacity(0.2), + colorBlendMode: BlendMode.darken, + ), + Center( + // add two buttons, one named "Pilih Kategori" , the other named "Tentang" + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // load the _listKategori + ..._listKategori, + + //make the button same width + // SizedBox( + // // width is half of the screen width + // width: MediaQuery.of(context).size.width / 3, + // child: ElevatedButton( + // child: const Text('Burung'), + // onPressed: () { + // Navigator.pushNamed(context, '/mewarna1', + // arguments: {'kategori': 'hewan', 'nama': 'burung'}); + // }, + // ), + // ), + // const SizedBox( + // height: 15, + // ), + // SizedBox( + // width: MediaQuery.of(context).size.width / 3, + // child: ElevatedButton( + // child: const Text('Kelinci'), + // onPressed: () { + // Navigator.pushNamed(context, '/mewarna1', arguments: { + // 'kategori': 'hewan', + // 'nama': 'kelinci' + // }); + // }, + // ), + // ), + // const SizedBox( + // height: 15, + // ), + // SizedBox( + // width: MediaQuery.of(context).size.width / 3, + // child: ElevatedButton( + // child: const Text('Gajah'), + // onPressed: () { + // Navigator.pushNamed(context, '/mewarna1', + // arguments: {'kategori': 'hewan', 'nama': 'gajah'}); + // }, + // ), + // ), + // const SizedBox( + // height: 15, + // ), + // SizedBox( + // width: MediaQuery.of(context).size.width / 3, + // child: ElevatedButton( + // child: const Text('Monyet'), + // onPressed: () { + // Navigator.pushNamed(context, '/mewarna1', + // arguments: {'kategori': 'hewan', 'nama': 'monyet'}); + // }, + // ), + // ), + // const SizedBox( + // height: 15, + // ), + // SizedBox( + // width: MediaQuery.of(context).size.width / 3, + // child: ElevatedButton( + // child: const Text('Singa'), + // onPressed: () { + // Navigator.pushNamed(context, '/mewarna1', + // arguments: {'kategori': 'hewan', 'nama': 'singa'}); + // }, + // ), + // ), + ], + ), + ), + // child: Text('Home Page'), + ), + ], + ), + ); + } +} diff --git a/lib/pages/mewarna1.dart b/lib/pages/mewarna1.dart index 134adf1..9cb5362 100644 --- a/lib/pages/mewarna1.dart +++ b/lib/pages/mewarna1.dart @@ -1,10 +1,21 @@ +// ignore_for_file: avoid_print + +import 'dart:convert'; +import 'dart:io'; + +import 'dart:typed_data'; + import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter_colorpicker/flutter_colorpicker.dart'; -// import 'package:flutter/services.dart'; -// import 'dart:ui' as ui; +// import 'package:image_gallery_saver/image_gallery_saver.dart'; +import 'package:path_provider/path_provider.dart'; +import 'dart:ui' as ui; import '../controller/myCustonPainter.dart'; -// import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; + +import 'package:intl/intl.dart' show toBeginningOfSentenceCase; class Mewarna1Page extends StatefulWidget { const Mewarna1Page({Key? key}) : super(key: key); @@ -17,29 +28,72 @@ class _Mewarna1PageState extends State { // List points = []; List points = []; // List undoPoints = []; - Color selectedColor = Colors.black.withOpacity(0.08); + Color selectedColor = Colors.black.withOpacity(0.01); double strokeWidth = 2.0; // ui.Image? image; late Map args; - // @override - // void initState() { - // // TODO: implement initState - // super.initState(); - // // selectedColor = Colors.black; - // // strokeWidth = 2.0; - // // loadImage('assets/hewan/singa.jpg'); - // args = ModalRoute.of(context)?.settings.arguments as Map; - // print(args); + final GlobalKey _globalKey = GlobalKey(); + + Uint8List? _bytes; + String _ini = 'tiada'; + + bool _delete = false; + + // ignore: unused_element + // Future _saveNetworkImage() async { + // // String path = + // // 'https://image.shutterstock.com/image-photo/montreal-canada-july-11-2019-600w-1450023539.jpg'; + // // GallerySaver.saveImage(path, albumName: "Download"); // } + Future _saveImage(Uint8List bytes) async { + final appStorage = await getApplicationDocumentsDirectory(); + final file = File('${appStorage.path}/screenshot.png'); + await file.writeAsBytes(bytes); + } + + Future _capturePng() async { + // try { + await EasyLoading.show( + status: 'loading...', + maskType: EasyLoadingMaskType.black, + ); + RenderRepaintBoundary boundary = + _globalKey.currentContext!.findRenderObject()! as RenderRepaintBoundary; + ui.Image image = await boundary.toImage(pixelRatio: 3.0); + ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png); + var pngBytes = byteData!.buffer.asUint8List(); + var bs64 = base64Encode(pngBytes); + + setState(() { + _bytes = base64Decode(bs64); + _ini = 'ada'; + points.clear(); + }); + await _saveImage(base64Decode(bs64)); + // await _saveNetworkImage(); + + // await ImageGallerySaver.saveImage(Uint8List.fromList(pngBytes), + // quality: 60, name: "hello"); + + await EasyLoading.dismiss(); + + return pngBytes; + // } catch (e) { + // print(e); + // return null; + // } + } + @override void didChangeDependencies() { + // ignore: todo // TODO: implement didChangeDependencies super.didChangeDependencies(); args = ModalRoute.of(context)?.settings.arguments as Map; - print(args); + // print(args); } void selectColor() { @@ -51,9 +105,9 @@ class _Mewarna1PageState extends State { child: BlockPicker( pickerColor: selectedColor, onColorChanged: (color) { - print(colorToHex(color)); + // print(colorToHex(color)); setState(() { - selectedColor = color.withOpacity(0.08); + selectedColor = color.withOpacity(0.01); }); }, ), @@ -79,97 +133,156 @@ class _Mewarna1PageState extends State { return WillPopScope( onWillPop: _onWillPopScope, child: Scaffold( + appBar: AppBar( + title: Text(toBeginningOfSentenceCase(args['nama']?.toString()) ?? + 'Mewarna 1'), + actions: [ + Ink( + decoration: ShapeDecoration( + color: _delete ? Colors.red : Colors.transparent, + shape: const CircleBorder(), + ), + child: IconButton( + icon: const Icon(Icons.delete), + onPressed: () { + setState(() { + _delete = !_delete; + }); + }, + ), + ), + IconButton( + icon: const Icon(Icons.save_alt_outlined), + onPressed: () {}, + ), + ], + ), body: Stack( children: [ Container( decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ Color.fromRGBO(138, 35, 135, 1.0), Color.fromRGBO(233, 64, 87, 1.0), Color.fromRGBO(242, 113, 33, 1.0), - ])), + ], + ), + ), ), Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - width: width * 0.80, - height: height * 0.80, - decoration: BoxDecoration( - borderRadius: - const BorderRadius.all(Radius.circular(20.0)), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.4), - blurRadius: 5.0, - spreadRadius: 1.0, - ) - ], - image: DecorationImage( - image: AssetImage("assets/" + - args['kategori'] + - "/" + - args['nama'] + - ".jpg"), - fit: BoxFit.fill, + RepaintBoundary( + key: _globalKey, + child: Container( + width: width * 0.80, + height: height * 0.70, + decoration: BoxDecoration( + borderRadius: const BorderRadius.all( + Radius.circular(20.0), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.4), + blurRadius: 5.0, + spreadRadius: 1.0, + ) + ], + image: _ini == 'tiada' + ? DecorationImage( + image: AssetImage("assets/" + + args['kategori'] + + "/" + + args['nama'] + + ".jpg"), + fit: BoxFit.fill, + ) + : DecorationImage( + image: MemoryImage(_bytes!), + fit: BoxFit.cover, + ), ), - ), - child: GestureDetector( - onPanDown: (details) { - setState(() { - // points.add(details.localPosition); - // print(points); - points.add( - DrawingArea( - point: details.localPosition, - areaPaint: Paint() - ..strokeCap = StrokeCap.round - ..isAntiAlias = true - ..color = selectedColor - ..strokeWidth = strokeWidth, - ), - ); - }); - }, - onPanUpdate: (details) { - setState(() { - // points.add(details.localPosition); - // print(points); - points.add( - DrawingArea( - point: details.localPosition, - areaPaint: Paint() - ..strokeCap = StrokeCap.round - ..isAntiAlias = true - ..color = selectedColor - ..strokeWidth = strokeWidth, - ), - ); - }); - }, - onPanEnd: (details) { - setState(() { - points.add(null); - // print(details); - }); - }, - child: ClipRRect( - borderRadius: - const BorderRadius.all(Radius.circular(20.0)), - child: CustomPaint( - painter: MyCustomPainter(points: points), + child: GestureDetector( + onPanDown: (details) { + if (_delete) { + setState(() { + points.add( + DrawingArea( + point: details.localPosition, + areaPaint: Paint() + ..strokeCap = StrokeCap.round + ..isAntiAlias = true + ..color = Colors.white.withOpacity(0.07) + ..strokeWidth = strokeWidth, + ), + ); + }); + } else { + setState(() { + points.add( + DrawingArea( + point: details.localPosition, + areaPaint: Paint() + ..strokeCap = StrokeCap.round + ..isAntiAlias = true + ..color = selectedColor + ..strokeWidth = strokeWidth, + ), + ); + }); + } + }, + onPanUpdate: (details) { + if (_delete) { + setState(() { + points.add( + DrawingArea( + point: details.localPosition, + areaPaint: Paint() + ..strokeCap = StrokeCap.round + ..isAntiAlias = true + ..color = Colors.white.withOpacity(0.07) + ..strokeWidth = strokeWidth, + ), + ); + }); + } else { + setState(() { + points.add( + DrawingArea( + point: details.localPosition, + areaPaint: Paint() + ..strokeCap = StrokeCap.round + ..isAntiAlias = true + ..color = selectedColor + ..strokeWidth = strokeWidth, + ), + ); + }); + } + }, + onPanEnd: (details) { + setState(() { + points.add(null); + // print(details); + }); + }, + child: ClipRRect( + borderRadius: + const BorderRadius.all(Radius.circular(20.0)), + child: CustomPaint( + painter: MyCustomPainter(points: points), + ), ), ), ), ), - const SizedBox( - height: 10, - ), + const SizedBox(height: 5), Container( width: width * 0.80, decoration: const BoxDecoration( @@ -189,7 +302,7 @@ class _Mewarna1PageState extends State { Expanded( child: Slider( min: 1.0, - max: 7.0, + max: 20.0, activeColor: selectedColor.withOpacity(1), value: strokeWidth, onChanged: (value) { @@ -211,38 +324,30 @@ class _Mewarna1PageState extends State { //remove the 10 last points setState(() { if (points.isNotEmpty) { - if (points.length > 20) { + if (points.length > 200) { points.removeRange( - points.length - 20, points.length); + points.length - 200, points.length); } else { points.clear(); } } }); }, - child: Icon( + child: const Icon( Icons.layers_clear, color: Colors.black, ), ), - SizedBox( - width: 10, + IconButton( + onPressed: () async { + _capturePng(); + print("sini untuk simpan"); + // String path = + // 'https://image.shutterstock.com/image-photo/montreal-canada-july-11-2019-600w-1450023539.jpg'; + // await GallerySaver.saveImage(path); + }, + icon: const Icon(Icons.save_alt_outlined), ), - // IconButton( - // onPressed: () { - // // points.clear(); - // // points.removeLast(); - - // // search for undoPoints on points and remove it - // setState(() { - // // points.removeLast(); - // if (points.isNotEmpty) { - // points.removeLast(); - // } - // }); - // }, - // icon: Icon(Icons.layers_clear), - // ), ], ), ), diff --git a/lib/pages/pilihKategori.dart b/lib/pages/pilihKategori.dart index 27f81ca..311826e 100644 --- a/lib/pages/pilihKategori.dart +++ b/lib/pages/pilihKategori.dart @@ -34,7 +34,11 @@ class PilihKategori extends HookWidget { child: ElevatedButton( child: const Text('Binatang'), onPressed: () { - Navigator.pushNamed(context, '/binatang'); + Navigator.pushNamed( + context, + '/kategori', + arguments: "Binatang", + ); }, ), ), @@ -44,8 +48,14 @@ class PilihKategori extends HookWidget { SizedBox( width: MediaQuery.of(context).size.width / 3, child: ElevatedButton( - child: const Text('Kendaraan'), - onPressed: () {}, + child: const Text('Kenderaan'), + onPressed: () { + Navigator.pushNamed( + context, + '/kategori', + arguments: "Kenderaan", + ); + }, ), ), const SizedBox( @@ -55,7 +65,13 @@ class PilihKategori extends HookWidget { width: MediaQuery.of(context).size.width / 3, child: ElevatedButton( child: const Text('Sayur-Sayuran'), - onPressed: () {}, + onPressed: () { + Navigator.pushNamed( + context, + '/kategori', + arguments: "Sayur-Sayuran", + ); + }, ), ), const SizedBox( @@ -65,7 +81,13 @@ class PilihKategori extends HookWidget { width: MediaQuery.of(context).size.width / 3, child: ElevatedButton( child: const Text('Buah-Buahan'), - onPressed: () {}, + onPressed: () { + Navigator.pushNamed( + context, + '/kategori', + arguments: "Buah-Buahan", + ); + }, ), ), ], diff --git a/lib/pages/tentang.dart b/lib/pages/tentang.dart index 93acd51..b1f885f 100644 --- a/lib/pages/tentang.dart +++ b/lib/pages/tentang.dart @@ -1,18 +1,105 @@ import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; +// import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hive_flutter/hive_flutter.dart'; -class Tentang extends HookWidget { - const Tentang({ Key? key }) : super(key: key); +import '../model/model_data.dart'; + +class Tentang extends StatefulWidget { + const Tentang({Key? key}) : super(key: key); + + @override + _TentangState createState() => _TentangState(); +} + +class _TentangState extends State { + // late var box; + + Future> _openBox() async { + return await Hive.openBox('model'); + } + + @override + void dispose() { + Hive.close(); + super.dispose(); + } @override Widget build(BuildContext context) { + // _openBox(); return Scaffold( appBar: AppBar( - title : const Text('Tentang'), + title: const Text('Tentang'), ), - body: const Center( - child: Text('Tentang'), + body: Center( + child: Column( + children: [ + ElevatedButton( + child: const Text('Tentang'), + onPressed: () { + tambah_data(); + }, + ), + FutureBuilder( + future: _openBox(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + return ValueListenableBuilder>( + valueListenable: Hive.box('model').listenable(), + builder: (context, box, _) { + final model = box.values.toList().cast(); + // ignore: avoid_print + print(model); + // create widget of list + return Expanded( + child: ListView.builder( + padding: const EdgeInsets.all(8), + itemCount: model.length, + itemBuilder: (context, index) { + return Card( + child: ListTile( + title: Text(model[index].datanya), + subtitle: + Text(model[index].createdDate.toString()), + trailing: ElevatedButton( + onPressed: () { + box.deleteAt(index); + }, + child: const Text('Hapus')), + ), + ); + }, + ), + ); + }, + ); + } else { + return const Text('Loading...'); + } + }, + ), + ], + ), ), ); } -} \ No newline at end of file + + // ignore: non_constant_identifier_names + Future tambah_data() async { + // final box = await Hive.openBox('model'); + final model = Model() + ..createdDate = DateTime.now() + ..datanya = 'Tentang1'; + + final box = await Hive.openBox('model'); + box.add(model); + // box.add(model); + } +} + +// class Boxes { +// static Box getData() { +// Hive.openBox('model'); +// return Hive.box('model'); +// } +// } diff --git a/lib/pages/tentang1.dart b/lib/pages/tentang1.dart new file mode 100644 index 0000000..153a961 --- /dev/null +++ b/lib/pages/tentang1.dart @@ -0,0 +1,278 @@ +import 'package:flutter/material.dart'; +import 'package:mewarna/widgets/ourContainer.dart'; + +class Tentang1 extends StatelessWidget { + const Tentang1({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Tentang'), + ), + body: Stack( + fit: StackFit.expand, + children: [ + Image.asset( + "assets/bg.jpg", + fit: BoxFit.cover, + color: Colors.black.withOpacity(0.2), + colorBlendMode: BlendMode.darken, + ), + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.5, + child: OurContainer( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.26, + child: const Text( + 'Nama', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.left, + ), + ), + const SizedBox( + width: 10, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + child: const Text(" : "), + ), + const SizedBox( + width: 10, + ), + Flexible( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.5, + child: const Text( + 'DEWI REZKY RAMDHANI T', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.26, + child: const Text( + 'NIM', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.left, + ), + ), + const SizedBox( + width: 10, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + child: const Text(" : "), + ), + const SizedBox( + width: 10, + ), + Flexible( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.5, + child: const Text( + '217 280 140', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.26, + child: const Text( + 'Pembimbing 1', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.left, + ), + ), + const SizedBox( + width: 10, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + child: const Text(" : "), + ), + const SizedBox( + width: 10, + ), + Flexible( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.5, + child: const Text( + 'Ade Hastuty, ST., S. Kom., MT.', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.26, + child: const Text( + 'Pembimbing 2', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.left, + ), + ), + const SizedBox( + width: 10, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + child: const Text(" : "), + ), + const SizedBox( + width: 10, + ), + Flexible( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.5, + child: const Text( + 'Andi Wafiah, S. Kom., M. Kom.', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.26, + child: const Text( + 'Judul', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.left, + ), + ), + const SizedBox( + width: 10, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + child: const Text(" : "), + ), + const SizedBox( + width: 10, + ), + Flexible( + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.5, + child: const Text( + 'APLIKASI PENERAPAN PEMBELAJARAN INTERAKTIF BUKU MEWARNAI BERBASIS ANDROID', + textAlign: TextAlign.justify, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + ], + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/ourContainer.dart b/lib/widgets/ourContainer.dart new file mode 100644 index 0000000..6bb9c71 --- /dev/null +++ b/lib/widgets/ourContainer.dart @@ -0,0 +1,35 @@ +// ignore_for_file: file_names + +import 'package:flutter/material.dart'; + +class OurContainer extends StatelessWidget { + final Widget? child; + + const OurContainer({Key? key, this.child}) : super(key: key); + @override + Widget build(BuildContext context) { + final double left = (MediaQuery.of(context).size.width - + (MediaQuery.of(context).size.width * 0.9)) / + 2; + return Container( + width: MediaQuery.of(context).size.width * 0.9, + margin: EdgeInsets.only(left: left, right: left), + padding: const EdgeInsets.only(left: 20, right: 15, bottom: 20, top: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20), + boxShadow: const [ + BoxShadow( + color: Colors.grey, + blurRadius: 10, + spreadRadius: 1, + offset: Offset( + 4, + 4, + ), + ), + ]), + child: child, + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 201f57d..287b1a9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,27 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "31.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" async: dependency: transitive description: @@ -15,6 +36,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.7" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.10" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.12.2" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.12" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.4" characters: dependency: transitive description: @@ -29,6 +106,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" clock: dependency: transitive description: @@ -36,6 +127,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" collection: dependency: transitive description: @@ -43,6 +141,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" cupertino_icons: dependency: "direct main" description: @@ -50,6 +162,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" fake_async: dependency: transitive description: @@ -57,6 +176,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -69,6 +209,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.3" + flutter_easyloading: + dependency: "direct main" + description: + name: flutter_easyloading + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.3" flutter_hooks: dependency: "direct main" description: @@ -83,11 +230,116 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + gallery_saver: + dependency: "direct main" + description: + name: gallery_saver + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.2" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + hive: + dependency: "direct main" + description: + name: hive + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + hive_flutter: + dependency: "direct main" + description: + name: hive_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + hive_generator: + dependency: "direct dev" + description: + name: hive_generator + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + image_gallery_saver: + dependency: "direct main" + description: + name: image_gallery_saver + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.1" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" lints: dependency: transitive description: @@ -95,6 +347,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" matcher: dependency: transitive description: @@ -116,6 +375,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" path: dependency: transitive description: @@ -123,11 +396,137 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.12" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + source_helper: + dependency: transitive + description: + name: source_helper + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" source_span: dependency: transitive description: @@ -149,6 +548,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -170,6 +576,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.8" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" typed_data: dependency: transitive description: @@ -184,6 +597,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" sdks: dart: ">=2.16.0-134.5.beta <3.0.0" - flutter: ">=1.20.0" + flutter: ">=2.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8e20d87..8809b3e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,11 +36,24 @@ dependencies: cupertino_icons: ^1.0.2 flutter_hooks: ^0.18.2+1 flutter_colorpicker: ^1.0.3 + hive: ^2.1.0 + hive_flutter: ^1.1.0 + image_gallery_saver: ^1.7.1 + path_provider: ^2.0.9 + # permission_handler: ^9.2.0 + gallery_saver: ^2.3.2 + # scree + # loading_overlay: ^0.2.1 + flutter_easyloading: ^3.0.3 + intl: ^0.17.0 dev_dependencies: flutter_test: sdk: flutter + + build_runner: ^1.12.2 + hive_generator: ^1.0.1 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your @@ -62,7 +75,10 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/ - - assets/hewan/ + - assets/binatang/ + - assets/sayur/ + - assets/kenderaan/ + - assets/buah/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg