You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flutter_custom_calendar/lib/base_week_bar.dart

32 lines
597 B

import 'package:flutter/material.dart';
/**
* 顶部的固定的周显示
*/
abstract class BaseWeekBar extends StatelessWidget {
const BaseWeekBar({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: new Row(
children: getWeekDayWidget(),
),
);
}
Widget getWeekBarItem(int index);
List<Widget> getWeekDayWidget() {
return List.generate(7, (index) {
return getChild(index);
});
}
Widget getChild(int index) {
return new Expanded(
child: getWeekBarItem(index),
);
}
}