Skip to content

Commit

Permalink
Merge pull request #3 from KevinZhang19870314/dev
Browse files Browse the repository at this point in the history
feat: add wired calendar
  • Loading branch information
KevinZhang19870314 authored Jul 22, 2021
2 parents daa5497 + c9b5f38 commit cbdb788
Show file tree
Hide file tree
Showing 10 changed files with 401 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.1.4] - 2021-July-22.

* 1. Add wired widget `wired calendar`.

## [0.1.3] - 2021-July-12.

* 1. Add wired widget `wired toggle`.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Some screenshots of the example app:
<img src="https://raw.githubusercontent.com/KevinZhang19870314/wired_elements/main/example/assets/screenshots/wired_input.jpg" width="187" heght="333" />
<img src="https://raw.githubusercontent.com/KevinZhang19870314/wired_elements/main/example/assets/screenshots/wired_radio.jpg" width="187" heght="333" />
<img src="https://raw.githubusercontent.com/KevinZhang19870314/wired_elements/main/example/assets/screenshots/wired_slider.jpg" width="187" heght="333" />
<img src="https://raw.githubusercontent.com/KevinZhang19870314/wired_elements/main/example/assets/screenshots/wired_progress.jpg" width="187" heght="333" />
<img src="https://raw.githubusercontent.com/KevinZhang19870314/wired_elements/main/example/assets/screenshots/wired_calendar.jpg" width="187" heght="333" />
</p>
## Others
Expand Down
Binary file added example/assets/screenshots/wired_calendar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/screenshots/wired_progress.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions example/lib/demos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:example/src/wired_dialog_example.dart';
import 'package:example/src/wired_divider_example.dart';
import 'package:flutter/material.dart';
import 'src/wired_button_example.dart';
import 'src/wired_calendar_example.dart';
import 'src/wired_input_example.dart';
import 'src/wired_progress_example.dart';
import 'src/wired_radio_example.dart';
Expand Down Expand Up @@ -81,6 +82,12 @@ final List<Demo> demos = [
(_) => WiredProgressExample(title: 'Wired progress'),
const Icon(Icons.portrait, size: 36),
),
NormalDemo(
'Wired calendar example',
'Wired calendar',
(_) => WiredCalendarExample(title: 'Wired calendar'),
const Icon(Icons.calendar_today, size: 36),
),
];

abstract class Demo {
Expand Down
37 changes: 37 additions & 0 deletions example/lib/src/wired_calendar_example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:wired_elements/wired_elements.dart';

import 'wired_text.dart';

class WiredCalendarExample extends StatefulWidget {
final String title;
const WiredCalendarExample({Key? key, required this.title}) : super(key: key);

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

class _WiredCalendarExampleState extends State<WiredCalendarExample> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: WiredText(
'${widget.title}',
fontSize: 20.0,
),
),
body: Container(
color: Colors.grey.shade200,
padding: EdgeInsets.all(15.0),
height: 460.0,
child: WiredCalendar(
selected: '20210722',
onSelected: (value) {
print('Selected date: $value');
},
),
),
);
}
}
1 change: 1 addition & 0 deletions lib/src/const.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import 'package:flutter/material.dart';
// Colors
const Color borderColor = Color(0XFF1A2B3C);
const Color textColor = Colors.black;
const Color disabledTextColor = Colors.grey;
const Color filledColor = Color(0XFFFEFEFE);
4 changes: 3 additions & 1 deletion lib/src/wired_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ class WiredCircleBase extends WiredPainterBase {
Drawable figure = generator.circle(
size.width / 2,
size.height / 2,
size.width * diameterRatio,
size.width > size.height
? size.width * diameterRatio
: size.height * diameterRatio,
);
canvas.drawRough(
figure, WiredBase.pathPaint, WiredBase.fillPainter(fillColor));
Expand Down
Loading

0 comments on commit cbdb788

Please sign in to comment.