Creating custom design system similar to material by reusing the flutter/material as part of a package

We are trying get very specific customization possibility than what material design provides by default. One approach of course is to create a design similar to flutter material. But creating entire design system from scratch is cumbersome. So we are trying to reuse flutter material and then customize it with minimal changes.

Issue Description

  1. Copied material folder from flutter to a test package.
  2. Copied material.dart to src of test package and commented “export ‘widgets.dart’;”
  3. Created a new widget TestInputField and imported both local material.dart and flutter/widgets.
import 'package:flutter/widgets.dart';
import '../../material.dart';
  1. Added a demo app and included a new widget TestInputField in it.
  2. Execute flutter run on demo (GitHub - msbasanth/test_widgets)
  3. Getting error “No material widget found textfield widgets require a material widget ancestor”. We tried wrapping with Scaffold/Material no help. At the same time if we switch to package:flutter/material instead of locally copied one it works fine.

image

Is there a similar or better approach with which we can create custom widgets without writing it from scratch?